The attach patch shuffles lines around to eliminate 80 lines of #ifdef...#endif; thereby making the file more readable. Tested on i586-*-freebsd and x86_64-*-freebsd. Patch is a pre-requisite to fixing issues and adding missing functionality. OK to commit?
2018-12-18 Steven G. Kargl <ka...@gcc.gnu.org> * libgfortran/ieee/ieee_arithmetic.F90: Re-organize file to eliminate excessive #ifdef ... #endif. -- Steve
Index: libgfortran/ieee/ieee_arithmetic.F90 =================================================================== --- libgfortran/ieee/ieee_arithmetic.F90 (revision 267191) +++ libgfortran/ieee/ieee_arithmetic.F90 (working copy) @@ -228,38 +228,28 @@ module IEEE_ARITHMETIC end function interface -COPYSIGN_MACRO(4,4) -COPYSIGN_MACRO(4,8) -#ifdef HAVE_GFC_REAL_10 -COPYSIGN_MACRO(4,10) -#endif #ifdef HAVE_GFC_REAL_16 -COPYSIGN_MACRO(4,16) -#endif -COPYSIGN_MACRO(8,4) -COPYSIGN_MACRO(8,8) +COPYSIGN_MACRO(16,16) #ifdef HAVE_GFC_REAL_10 -COPYSIGN_MACRO(8,10) +COPYSIGN_MACRO(16,10) +COPYSIGN_MACRO(10,16) #endif -#ifdef HAVE_GFC_REAL_16 +COPYSIGN_MACRO(16,8) +COPYSIGN_MACRO(16,4) COPYSIGN_MACRO(8,16) +COPYSIGN_MACRO(4,16) #endif #ifdef HAVE_GFC_REAL_10 -COPYSIGN_MACRO(10,4) -COPYSIGN_MACRO(10,8) COPYSIGN_MACRO(10,10) -#ifdef HAVE_GFC_REAL_16 -COPYSIGN_MACRO(10,16) +COPYSIGN_MACRO(10,8) +COPYSIGN_MACRO(10,4) +COPYSIGN_MACRO(8,10) +COPYSIGN_MACRO(4,10) #endif -#endif -#ifdef HAVE_GFC_REAL_16 -COPYSIGN_MACRO(16,4) -COPYSIGN_MACRO(16,8) -#ifdef HAVE_GFC_REAL_10 -COPYSIGN_MACRO(16,10) -#endif -COPYSIGN_MACRO(16,16) -#endif +COPYSIGN_MACRO(8,8) +COPYSIGN_MACRO(8,4) +COPYSIGN_MACRO(4,8) +COPYSIGN_MACRO(4,4) end interface interface IEEE_COPY_SIGN @@ -268,32 +258,22 @@ COPYSIGN_MACRO(16,16) _gfortran_ieee_copy_sign_16_16, & #ifdef HAVE_GFC_REAL_10 _gfortran_ieee_copy_sign_16_10, & + _gfortran_ieee_copy_sign_10_16, & #endif _gfortran_ieee_copy_sign_16_8, & _gfortran_ieee_copy_sign_16_4, & + _gfortran_ieee_copy_sign_8_16, & + _gfortran_ieee_copy_sign_4_16, & #endif #ifdef HAVE_GFC_REAL_10 -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_copy_sign_10_16, & -#endif _gfortran_ieee_copy_sign_10_10, & _gfortran_ieee_copy_sign_10_8, & _gfortran_ieee_copy_sign_10_4, & -#endif -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_copy_sign_8_16, & -#endif -#ifdef HAVE_GFC_REAL_10 _gfortran_ieee_copy_sign_8_10, & + _gfortran_ieee_copy_sign_4_10, & #endif _gfortran_ieee_copy_sign_8_8, & _gfortran_ieee_copy_sign_8_4, & -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_copy_sign_4_16, & -#endif -#ifdef HAVE_GFC_REAL_10 - _gfortran_ieee_copy_sign_4_10, & -#endif _gfortran_ieee_copy_sign_4_8, & _gfortran_ieee_copy_sign_4_4 end interface @@ -309,38 +289,28 @@ COPYSIGN_MACRO(16,16) end function interface -UNORDERED_MACRO(4,4) -UNORDERED_MACRO(4,8) -#ifdef HAVE_GFC_REAL_10 -UNORDERED_MACRO(4,10) -#endif #ifdef HAVE_GFC_REAL_16 -UNORDERED_MACRO(4,16) -#endif -UNORDERED_MACRO(8,4) -UNORDERED_MACRO(8,8) +UNORDERED_MACRO(16,16) #ifdef HAVE_GFC_REAL_10 -UNORDERED_MACRO(8,10) +UNORDERED_MACRO(16,10) +UNORDERED_MACRO(10,16) #endif -#ifdef HAVE_GFC_REAL_16 +UNORDERED_MACRO(16,8) +UNORDERED_MACRO(16,4) UNORDERED_MACRO(8,16) +UNORDERED_MACRO(4,16) #endif #ifdef HAVE_GFC_REAL_10 -UNORDERED_MACRO(10,4) -UNORDERED_MACRO(10,8) UNORDERED_MACRO(10,10) -#ifdef HAVE_GFC_REAL_16 -UNORDERED_MACRO(10,16) +UNORDERED_MACRO(10,8) +UNORDERED_MACRO(10,4) +UNORDERED_MACRO(8,10) +UNORDERED_MACRO(4,10) #endif -#endif -#ifdef HAVE_GFC_REAL_16 -UNORDERED_MACRO(16,4) -UNORDERED_MACRO(16,8) -#ifdef HAVE_GFC_REAL_10 -UNORDERED_MACRO(16,10) -#endif -UNORDERED_MACRO(16,16) -#endif +UNORDERED_MACRO(8,8) +UNORDERED_MACRO(8,4) +UNORDERED_MACRO(4,8) +UNORDERED_MACRO(4,4) end interface interface IEEE_UNORDERED @@ -349,32 +319,22 @@ UNORDERED_MACRO(16,16) _gfortran_ieee_unordered_16_16, & #ifdef HAVE_GFC_REAL_10 _gfortran_ieee_unordered_16_10, & + _gfortran_ieee_unordered_10_16, & #endif _gfortran_ieee_unordered_16_8, & _gfortran_ieee_unordered_16_4, & + _gfortran_ieee_unordered_8_16, & + _gfortran_ieee_unordered_4_16, & #endif #ifdef HAVE_GFC_REAL_10 -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_unordered_10_16, & -#endif _gfortran_ieee_unordered_10_10, & _gfortran_ieee_unordered_10_8, & _gfortran_ieee_unordered_10_4, & -#endif -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_unordered_8_16, & -#endif -#ifdef HAVE_GFC_REAL_10 _gfortran_ieee_unordered_8_10, & + _gfortran_ieee_unordered_4_10, & #endif _gfortran_ieee_unordered_8_8, & _gfortran_ieee_unordered_8_4, & -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_unordered_4_16, & -#endif -#ifdef HAVE_GFC_REAL_10 - _gfortran_ieee_unordered_4_10, & -#endif _gfortran_ieee_unordered_4_8, & _gfortran_ieee_unordered_4_4 end interface @@ -424,38 +384,28 @@ UNORDERED_MACRO(16,16) end function interface -NEXT_AFTER_MACRO(4,4) -NEXT_AFTER_MACRO(4,8) -#ifdef HAVE_GFC_REAL_10 -NEXT_AFTER_MACRO(4,10) -#endif #ifdef HAVE_GFC_REAL_16 -NEXT_AFTER_MACRO(4,16) -#endif -NEXT_AFTER_MACRO(8,4) -NEXT_AFTER_MACRO(8,8) +NEXT_AFTER_MACRO(16,16) #ifdef HAVE_GFC_REAL_10 -NEXT_AFTER_MACRO(8,10) +NEXT_AFTER_MACRO(16,10) +NEXT_AFTER_MACRO(10,16) #endif -#ifdef HAVE_GFC_REAL_16 +NEXT_AFTER_MACRO(16,8) +NEXT_AFTER_MACRO(16,4) NEXT_AFTER_MACRO(8,16) +NEXT_AFTER_MACRO(4,16) #endif #ifdef HAVE_GFC_REAL_10 -NEXT_AFTER_MACRO(10,4) -NEXT_AFTER_MACRO(10,8) NEXT_AFTER_MACRO(10,10) -#ifdef HAVE_GFC_REAL_16 -NEXT_AFTER_MACRO(10,16) +NEXT_AFTER_MACRO(10,8) +NEXT_AFTER_MACRO(10,4) +NEXT_AFTER_MACRO(8,10) +NEXT_AFTER_MACRO(4,10) #endif -#endif -#ifdef HAVE_GFC_REAL_16 -NEXT_AFTER_MACRO(16,4) -NEXT_AFTER_MACRO(16,8) -#ifdef HAVE_GFC_REAL_10 -NEXT_AFTER_MACRO(16,10) -#endif -NEXT_AFTER_MACRO(16,16) -#endif +NEXT_AFTER_MACRO(8,8) +NEXT_AFTER_MACRO(8,4) +NEXT_AFTER_MACRO(4,8) +NEXT_AFTER_MACRO(4,4) end interface interface IEEE_NEXT_AFTER @@ -464,32 +414,22 @@ NEXT_AFTER_MACRO(16,16) _gfortran_ieee_next_after_16_16, & #ifdef HAVE_GFC_REAL_10 _gfortran_ieee_next_after_16_10, & + _gfortran_ieee_next_after_10_16, & #endif _gfortran_ieee_next_after_16_8, & _gfortran_ieee_next_after_16_4, & + _gfortran_ieee_next_after_8_16, & + _gfortran_ieee_next_after_4_16, & #endif #ifdef HAVE_GFC_REAL_10 -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_next_after_10_16, & -#endif _gfortran_ieee_next_after_10_10, & _gfortran_ieee_next_after_10_8, & _gfortran_ieee_next_after_10_4, & -#endif -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_next_after_8_16, & -#endif -#ifdef HAVE_GFC_REAL_10 _gfortran_ieee_next_after_8_10, & + _gfortran_ieee_next_after_4_10, & #endif _gfortran_ieee_next_after_8_8, & _gfortran_ieee_next_after_8_4, & -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_next_after_4_16, & -#endif -#ifdef HAVE_GFC_REAL_10 - _gfortran_ieee_next_after_4_10, & -#endif _gfortran_ieee_next_after_4_8, & _gfortran_ieee_next_after_4_4 end interface @@ -505,38 +445,28 @@ NEXT_AFTER_MACRO(16,16) end function interface -REM_MACRO(4,4,4) -REM_MACRO(8,4,8) -#ifdef HAVE_GFC_REAL_10 -REM_MACRO(10,4,10) -#endif #ifdef HAVE_GFC_REAL_16 -REM_MACRO(16,4,16) -#endif -REM_MACRO(8,8,4) -REM_MACRO(8,8,8) +REM_MACRO(16,16,16) #ifdef HAVE_GFC_REAL_10 -REM_MACRO(10,8,10) +REM_MACRO(16,16,10) +REM_MACRO(16,10,16) #endif -#ifdef HAVE_GFC_REAL_16 +REM_MACRO(16,16,8) +REM_MACRO(16,16,4) REM_MACRO(16,8,16) +REM_MACRO(16,4,16) #endif #ifdef HAVE_GFC_REAL_10 -REM_MACRO(10,10,4) -REM_MACRO(10,10,8) REM_MACRO(10,10,10) -#ifdef HAVE_GFC_REAL_16 -REM_MACRO(16,10,16) +REM_MACRO(10,10,8) +REM_MACRO(10,10,4) +REM_MACRO(10,8,10) +REM_MACRO(10,4,10) #endif -#endif -#ifdef HAVE_GFC_REAL_16 -REM_MACRO(16,16,4) -REM_MACRO(16,16,8) -#ifdef HAVE_GFC_REAL_10 -REM_MACRO(16,16,10) -#endif -REM_MACRO(16,16,16) -#endif +REM_MACRO(8,8,8) +REM_MACRO(8,8,4) +REM_MACRO(8,4,8) +REM_MACRO(4,4,4) end interface interface IEEE_REM @@ -545,32 +475,22 @@ REM_MACRO(16,16,16) _gfortran_ieee_rem_16_16, & #ifdef HAVE_GFC_REAL_10 _gfortran_ieee_rem_16_10, & + _gfortran_ieee_rem_10_16, & #endif _gfortran_ieee_rem_16_8, & _gfortran_ieee_rem_16_4, & + _gfortran_ieee_rem_8_16, & + _gfortran_ieee_rem_4_16, & #endif #ifdef HAVE_GFC_REAL_10 -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_rem_10_16, & -#endif _gfortran_ieee_rem_10_10, & _gfortran_ieee_rem_10_8, & _gfortran_ieee_rem_10_4, & -#endif -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_rem_8_16, & -#endif -#ifdef HAVE_GFC_REAL_10 _gfortran_ieee_rem_8_10, & + _gfortran_ieee_rem_4_10, & #endif _gfortran_ieee_rem_8_8, & _gfortran_ieee_rem_8_4, & -#ifdef HAVE_GFC_REAL_16 - _gfortran_ieee_rem_4_16, & -#endif -#ifdef HAVE_GFC_REAL_10 - _gfortran_ieee_rem_4_10, & -#endif _gfortran_ieee_rem_4_8, & _gfortran_ieee_rem_4_4 end interface