Message ID | ydd38edim3a.fsf@lokon.CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
> FWIW, those FP_* values are also enum values in IRIX 6.5 <ieeefp.h>, the > only other SysV target I have around. Seems this file is common between > all of them, so the risk should be manageable. > > The following patch does away with the #ifdef stuff and lets all > gfortran.dg/ieee tests PASS on sparc-sun-solaris2.11. Google for a few more targets (BSD, cygwin, etc.) confirms that there is little variation in this part of the file. Given that your patch fixes a target, and sounds good to both you and me, I suggest you commit it in 24 hours unless someone objects (or you get an actual review). Also, related to that: could you also confirm that FP_X_INV (and others) are indeed macros, on solaris? FX
FX <fxcoudert@gmail.com> writes: >> FWIW, those FP_* values are also enum values in IRIX 6.5 <ieeefp.h>, the >> only other SysV target I have around. Seems this file is common between >> all of them, so the risk should be manageable. >> >> The following patch does away with the #ifdef stuff and lets all >> gfortran.dg/ieee tests PASS on sparc-sun-solaris2.11. > > Google for a few more targets (BSD, cygwin, etc.) confirms that there is > little variation in this part of the file. > > Given that your patch fixes a target, and sounds good to both you and me, I > suggest you commit it in 24 hours unless someone objects (or you get an > actual review). ok, thanks. > Also, related to that: could you also confirm that FP_X_INV (and others) > are indeed macros, on solaris? I already did, and the rounding mode related ones are the only enums currently used. There's also fpclass_t, but that's not used right now. Rainer
diff --git a/libgfortran/config/fpu-sysv.h b/libgfortran/config/fpu-sysv.h --- a/libgfortran/config/fpu-sysv.h +++ b/libgfortran/config/fpu-sysv.h @@ -333,25 +335,14 @@ get_fpu_rounding_mode (void) { switch (fpgetround ()) { -#ifdef FP_RN case FP_RN: return GFC_FPE_TONEAREST; -#endif - -#ifdef FP_RP case FP_RP: return GFC_FPE_UPWARD; -#endif - -#ifdef FP_RM case FP_RM: return GFC_FPE_DOWNWARD; -#endif - -#ifdef FP_RZ case FP_RZ: return GFC_FPE_TOWARDZERO; -#endif default: return GFC_FPE_INVALID; } @@ -365,29 +356,18 @@ set_fpu_rounding_mode (int mode) switch (mode) { -#ifdef FP_RN case GFC_FPE_TONEAREST: rnd_mode = FP_RN; break; -#endif - -#ifdef FP_RP case GFC_FPE_UPWARD: rnd_mode = FP_RP; break; -#endif - -#ifdef FP_RM case GFC_FPE_DOWNWARD: rnd_mode = FP_RM; break; -#endif - -#ifdef FP_RZ case GFC_FPE_TOWARDZERO: rnd_mode = FP_RZ; break; -#endif default: return; } @@ -401,33 +381,13 @@ support_fpu_rounding_mode (int mode) switch (mode) { case GFC_FPE_TONEAREST: -#ifdef FP_RN return 1; -#else - return 0; -#endif - case GFC_FPE_UPWARD: -#ifdef FP_RP return 1; -#else - return 0; -#endif - case GFC_FPE_DOWNWARD: -#ifdef FP_RM return 1; -#else - return 0; -#endif - case GFC_FPE_TOWARDZERO: -#ifdef FP_RZ return 1; -#else - return 0; -#endif - default: return 0; }