| 1 |
(* mltree-basis.sig |
| 2 |
* |
| 3 |
* COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies |
| 4 |
*) |
| 5 |
|
| 6 |
signature MLTREE_BASIS = |
| 7 |
sig |
| 8 |
|
| 9 |
type attribs = word |
| 10 |
|
| 11 |
type misc_op = {name:string, hash:word, attribs:attribs ref} |
| 12 |
|
| 13 |
datatype cond = LT | LTU | LE | LEU | EQ | NE | GE | GEU | GT | GTU |
| 14 |
| SETCC |
| 15 |
| MISC_COND of {name:string, hash:word, attribs:word ref} |
| 16 |
|
| 17 |
(* Floating-point conditions; the semantics follow the IEEE specification and |
| 18 |
* are determined by four properties: GT -- greater than, EQ -- equal, |
| 19 |
* LT -- less than, UO -- unordered. In the table below, we have a column |
| 20 |
* for each of these properties and one for the negation of the operator. |
| 21 |
*) |
| 22 |
datatype fcond (* GT EQ LT UO negation *) |
| 23 |
(* --- --- --- --- -------- *) |
| 24 |
= == (* F T F F ?<> *) |
| 25 |
| ?<> (* T F T T == *) |
| 26 |
| > (* T F F F ?<= *) |
| 27 |
| >= (* T T F F ?< *) |
| 28 |
| < (* F F F F ?>= *) |
| 29 |
| <= (* F T F F ?> *) |
| 30 |
| ? (* F F F T <=> *) |
| 31 |
| <> (* T F T F ?= *) |
| 32 |
| <=> (* T T T F ? *) |
| 33 |
| ?> (* T F F T <= *) |
| 34 |
| ?>= (* T T F T < *) |
| 35 |
| ?< (* F F F T >= *) |
| 36 |
| ?<= (* F T F T > *) |
| 37 |
| ?= (* F T F T <> *) |
| 38 |
| SETFCC |
| 39 |
| MISC_FCOND of {name:string, hash:word, attribs:word ref} |
| 40 |
|
| 41 |
datatype rounding_mode = TO_NEAREST | TO_NEGINF | TO_POSINF | TO_ZERO |
| 42 |
|
| 43 |
datatype div_rounding_mode = DIV_TO_NEGINF | DIV_TO_ZERO |
| 44 |
|
| 45 |
datatype ext = SIGN_EXTEND | ZERO_EXTEND |
| 46 |
|
| 47 |
(* Should be datatypes, but FLINT does not optimize them well *) |
| 48 |
type ty = int |
| 49 |
type fty = int |
| 50 |
|
| 51 |
(* Invert the conditional when swapping the two arguments |
| 52 |
* of the comparision. IMPORTANT: this is not the negation! |
| 53 |
*) |
| 54 |
val swapCond : cond -> cond |
| 55 |
|
| 56 |
(* Invert the conditional when swapping the two arguments |
| 57 |
* of the comparision. IMPORTANT: this is not the negation! |
| 58 |
*) |
| 59 |
val swapFcond : fcond -> fcond |
| 60 |
|
| 61 |
(* This is the negation! *) |
| 62 |
val negateCond : cond -> cond |
| 63 |
|
| 64 |
(* This is the negation! *) |
| 65 |
val negateFcond : fcond -> fcond |
| 66 |
|
| 67 |
(* hashing functions *) |
| 68 |
val hashCond : cond -> word |
| 69 |
val hashFcond : fcond -> word |
| 70 |
val hashRoundingMode : rounding_mode -> word |
| 71 |
|
| 72 |
(* pretty printing *) |
| 73 |
val condToString : cond -> string |
| 74 |
val fcondToString : fcond -> string |
| 75 |
val roundingModeToString : rounding_mode -> string |
| 76 |
|
| 77 |
end |