2 #define coerce(n, f, t) \
3 MLTON_CODEGEN_STATIC_INLINE \
4 t f##_##n##To##t (f x) { \
7 #define bothFromWordCoerce(name, from, to) \
8 coerce (name, Word##S##from, to) \
9 coerce (name, Word##U##from, to)
10 #define bothToWordCoerce(name, from, to) \
11 coerce (name, from, Word##S##to) \
12 coerce (name, from, Word##U##to)
14 #define allWordCoerce(size) \
15 bothToWordCoerce(rnd, Real32, size) \
16 bothToWordCoerce(rnd, Real64, size) \
17 bothFromWordCoerce(extd, size, Word8) \
18 bothFromWordCoerce(extd, size, Word16) \
19 bothFromWordCoerce(extd, size, Word32) \
20 bothFromWordCoerce(extd, size, Word64)
28 #undef bothToWordCoerce
29 #undef bothFromWordCoerce
31 coerce(rnd
, Real32
, Real32
)
32 coerce(rnd
, Real32
, Real64
)
33 coerce(rnd
, Real64
, Real32
)
34 coerce(rnd
, Real64
, Real64
)
39 MLTON_CODEGEN_STATIC_INLINE \
40 t f##_castTo##t (f x) { \
42 memcpy(&y, &x, sizeof(t)); \