[RFC] Support of IEEE modules, first draft for comments

Dominique Dhumieres dominiq@lps.ens.fr
Sun Nov 17 13:02:00 GMT 2013


Hi FX,

I have applied your patch on x86_64-apple-darwin13 and powerpc-apple-darwin9.
I have bootstapped both platforms without any problem. The test ieee_1.F90
succeeds on x86_64-apple-darwin13, but not on powerpc-apple-darwin9

Fatal Error: Can't open module file 'ieee_features.mod' for reading at (1): No such file or directory

It seems that ieee_support_rounding(*) is not implemented.
It seems also that the changing the rounding mode has no
effect on the result:

program example_ieee_rounding_mode

  use, intrinsic :: ieee_arithmetic

  integer, parameter :: sp = kind(1.0)
  TYPE(IEEE_ROUND_TYPE) ROUND_VALUE

  call ieee_get_rounding_mode(ROUND_VALUE)
  print *, ROUND_VALUE == ieee_nearest, ROUND_VALUE == ieee_to_zero
  print *, ROUND_VALUE == ieee_up, ROUND_VALUE == ieee_down
  call ieee_set_rounding_mode(ieee_nearest)
  call ieee_get_rounding_mode(ROUND_VALUE)
  print *, ROUND_VALUE == ieee_nearest
  write(unit=*, fmt="(F40.35)") 1.0_sp/3
  call ieee_set_rounding_mode(ieee_up)
  call ieee_get_rounding_mode(ROUND_VALUE)
  print *, ROUND_VALUE == ieee_up
  write(unit=*, fmt="(F40.35)") 1.0_sp/3
  call ieee_set_rounding_mode(ieee_to_zero)
  call ieee_get_rounding_mode(ROUND_VALUE)
  print *, ROUND_VALUE == ieee_to_zero
  write(unit=*, fmt="(F40.35)") 1.0_sp/3
  call ieee_set_rounding_mode(ieee_down)
  call ieee_get_rounding_mode(ROUND_VALUE)
  print *, ROUND_VALUE == ieee_down
  write(unit=*, fmt="(F40.35)") 1.0_sp/3

end program example_ieee_rounding_mode

gives

 T F
 F F
 T
   0.33333334326744079589843750000000000
 T
   0.33333334326744079589843750000000000
 T
   0.33333334326744079589843750000000000
 T
   0.33333334326744079589843750000000000

Dominique



More information about the Fortran mailing list