Skip to content

UFUNC_CHECK_STATUS doesn't correctly clear the fp flags on AIX (Trac #362) #960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 1 comment

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/362 on 2006-10-22 by trac user bgranger, assigned to unknown.

On AIX, UFUNC_CHECK_STATUS (in ufuncobject.h) always return 8 indicating that an INVALID floating point error has occured. This is happening because the fp flags are not being cleared. The current code tries to clear the flags with the call:

fp_clr_flag( FP_DIV_BY_ZERO | FP_OVERFLOW | FP_UNDERFLOW | FP_INVALID);

But this doesn't work as expected. Instead, after this call is made the FP_INVALID flag is set to true so all further calls to UFUNC_CHECK_STATUS return 8. The correct way to clear the fp flags on AIX is:

fp_swap_flag(0);

the AIX documentation:

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/fp_clr_flag.htm

Makes only a vague reference to this being necessary, but apparently it is.

Could we fix this before 1.0? Thanks!!!!

@numpy-gitbot
Copy link
Author

@teoliphant wrote on 2006-10-23

Changed in r3381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant