[flang] Modifications to ieee floating point environment procedures (#121949)
Intrinsic module procedures ieee_get_modes, ieee_set_modes, ieee_get_status, and ieee_set_status store and retrieve opaque data values whose size varies by machine and OS environment. These data values are usually, but not always small. Their sizes are not directly known in a cross compilation environment. Address this issue by implementing two mechanisms for processing these data values. Environments that use typical small data sizes can access storage defined at compile time. When this is not valid, data storage of any size can be allocated at runtime.
This commit is contained in:
@@ -36,13 +36,15 @@ module __fortran_ieee_exceptions
|
||||
ieee_all(*) = [ ieee_usual, ieee_underflow, ieee_inexact ]
|
||||
|
||||
type, public :: ieee_modes_type ! Fortran 2018, 17.7
|
||||
private ! opaque fenv.h femode_t data
|
||||
private ! opaque fenv.h femode_t data; code will access only one component
|
||||
integer(kind=4) :: __data(_FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT)
|
||||
integer(kind=1), allocatable :: __allocatable_data(:)
|
||||
end type ieee_modes_type
|
||||
|
||||
type, public :: ieee_status_type ! Fortran 2018, 17.7
|
||||
private ! opaque fenv.h fenv_t data
|
||||
private ! opaque fenv.h fenv_t data; code will access only one component
|
||||
integer(kind=4) :: __data(_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT)
|
||||
integer(kind=1), allocatable :: __allocatable_data(:)
|
||||
end type ieee_status_type
|
||||
|
||||
! Define specifics with 1 LOGICAL or REAL argument for generic G.
|
||||
|
||||
Reference in New Issue
Block a user