1(* -------------------------------------------------------------------------
2   Floating-point (for unsupported size)
3   ------------------------------------------------------------------------- *)
4
5structure FP32 :> FP =
6struct
7
8   type ieee_flags = {DivideByZero: bool,
9                      InvalidOp: bool,
10                      Overflow: bool,
11                      Precision: bool,
12                      Underflow: bool}
13
14   val posInf = BitsN.BV (0, 0)
15   val negInf = BitsN.BV (0, 0)
16   val posZero = BitsN.BV (0, 0)
17   val negZero = BitsN.BV (0, 0)
18   val sNan = BitsN.BV (0, 0)
19   val qNan = BitsN.BV (0, 0)
20
21   fun err s = raise Fail (s ^ ": not supported")
22
23   fun toInt _ = err "toInt"
24   fun fromInt _ = err "fromInt"
25   fun fromString _ = err "fromString"
26
27   fun isFinite _ = err "isFinite"
28   fun isNan _ = err "isNan"
29   fun isSignallingNan _ = err "isSignallingNan"
30   fun isNormal _ = err "isNormal"
31   fun isSubnormal _ = err "isSubnormal"
32   fun isIntegral _ = err "isIntegral"
33   fun abs _ = err "abs"
34   fun neg _ = err "neg"
35   fun add _ = err "add"
36   fun mul _ = err "mul"
37   fun mul_add _ = err "mul_add"
38   fun mul_sub _ = err "mul_sub"
39   fun sub _ = err "sub"
40   fun sqrt _ = err "sqrt"
41   fun op div _ = err "div"
42   fun equal _ = err "equal"
43   fun compare _ = err "compare"
44   fun greaterThan _ = err "greaterThan"
45   fun greaterEqual _ = err "greaterEqual"
46   fun lessThan _ = err "lessThan"
47   fun lessEqual _ = err "lessEqual"
48   fun roundToIntegral _ = err "lessEqual"
49
50end (* structure FP32 *)
51