Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/mltree/mltree-basis.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/mltree/mltree-basis.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 744, Fri Dec 8 04:11:42 2000 UTC revision 1120, Wed Mar 6 17:16:36 2002 UTC
# Line 1  Line 1 
1    (* mltree-basis.sml
2     *
3     * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
4     *)
5    
6  structure MLTreeBasis : MLTREE_BASIS =  structure MLTreeBasis : MLTREE_BASIS =
7  struct  struct
8    
# Line 9  Line 14 
14                  | SETCC                  | SETCC
15                  | MISC_COND of {name:string, hash:word, attribs:attribs ref}                  | MISC_COND of {name:string, hash:word, attribs:attribs ref}
16    
17    datatype fcond = ? | !<=> | == | ?= | !<> | !?>= | < | ?< | !>= | !?> |  (* Floating-point conditions: see mltree-basis.sig for documentation *)
18                     <= | ?<= | !> | !?<= | > | ?> | !<= | !?< | >= | ?>= |    datatype fcond
19                     !< | !?= | <> | != | !? | <=> | ?<> | SETFCC |      = == | ?<> | > | >= | < | <= | ? | <> | <=>
20                     MISC_FCOND of {name:string, hash:word, attribs:attribs ref}      | ?> | ?>= | ?< | ?<= | ?=
21        | SETFCC
22        | MISC_FCOND of {name:string, hash:word, attribs:word ref}
23    
24    datatype ext = SIGN_EXTEND | ZERO_EXTEND    datatype ext = SIGN_EXTEND | ZERO_EXTEND
25    
# Line 34  Line 41 
41        | SETCC => "SETCC"        | SETCC => "SETCC"
42        | MISC_COND{name,...} => name        | MISC_COND{name,...} => name
43    
44    fun fcondToString fcond =    fun fcondToString fcond = case fcond
45        case fcond of       of ==  => "==" | ?<> => "?<>"
46          ?     => "?"   | !<=>  => "!<=>" | ==    => "==" | ?=    => "?="        | > => ">"    | >= => ">="   | <   => "<"  | <=  => "<="
47        | !<>   => "!<>" | !?>=  => "!?>=" | <     => "<"  | ?<    => "?<"        | ? => "?"    | <>  => "<>"  | <=> => "<=>"
48        | !>=   => "!>=" | !?>   => "!?>"  | <=    => "<=" | ?<=   => "?<="        | ?> => "?<"  | ?>= => "?>=" | ?< => "?<"  | ?<= => "?<=" | ?= => "?="
       | !>    => "!>"  | !?<=  => "!?<=" | >     => ">"  | ?>    => "?>"  
       | !<=   => "!<=" | !?<   => "!?<"  | >=    => ">=" | ?>=   => "?>="  
       | !<    => "!<"  | !?=   => "!?="  | <>    => "<>" | !=    => "!="  
       | !?    => "!?"  | <=>   => "<=>"  | ?<>   => "?<>"  
49        | SETFCC => "SETFCC"        | SETFCC => "SETFCC"
50        | MISC_FCOND{name, ...} => name        | MISC_FCOND{name, ...} => name
51    
# Line 52  Line 55 
55        | NE  => NE | GE  => LE | GEU => LEU | GT  => LT | GTU => LTU        | NE  => NE | GE  => LE | GEU => LEU | GT  => LT | GTU => LTU
56        | cond => error("swapCond",condToString cond)        | cond => error("swapCond",condToString cond)
57    
58    (* swap order of arguments *)
59    fun swapFcond fcond =    fun swapFcond fcond =
60        case fcond of        case fcond of
61          ?     => ?   | !<=>  => !<=> | ==    => ==          ?     => ?   | ==    => ==
62        | ?=    => ?=  | !<>   => !<>  | !?>=  => !?<=        | ?=    => ?=
63        | <     => >   | ?<    => ?>   | !>=   => !<=        | <     => >   | ?<    => ?>
64        | !?>   => !?< | <=    => >=   | ?<=   => ?>=        | <=    => >=  | ?<=   => ?>=
65        | !>    => !<  | !?<=  => !?>= | >     => <        | >     => <
66        | ?>    => ?<  | !<=   => !>=  | !?<   => !?>        | ?>    => ?<
67        | >=    => <=  | ?>=   => ?<=  | !<    => !>        | >=    => <=  | ?>=   => ?<=
68        | !?=   => !?= | <>    => <>   | !=    => !=        | <>    => <>
69        | !?    => !?  | <=>   => <=>  | ?<>   => ?<>        | <=>   => <=> | ?<>   => ?<>
70        | fcond => error("swapFcond",fcondToString fcond)        | fcond => error("swapFcond",fcondToString fcond)
71    
72    fun negateCond cond =    fun negateCond cond =
# Line 73  Line 77 
77    
78    fun negateFcond fcond =    fun negateFcond fcond =
79        case fcond of        case fcond of
80          ==   => != | ?<>  => ==   | ?    => <=>          ==   => ?<> | ?<>  => ==   | ?    => <=>
81        | <=>  => ?  | >    => ?<=  | >=   => ?<        | <=>  => ?  | >    => ?<=  | >=   => ?<
82        | ?>   => <= | ?>=  => <    | <    => ?>=        | ?>   => <= | ?>=  => <    | <    => ?>=
83        | <=   => ?> | ?<   => >=   | ?<=  => >        | <=   => ?> | ?<   => >=   | ?<=  => >
84        | <>   => ?= | ?=   => <>   (* missing some cases here XXX *)        | <>   => ?= | ?=   => <>
85        | _    => error("negateFcond", fcondToString fcond)        | _    => error("negateFcond", fcondToString fcond)
86    
87    fun hashCond cond =    fun hashCond cond =
# Line 90  Line 94 
94    
95    fun hashFcond fcond =    fun hashFcond fcond =
96        case fcond of        case fcond of
97          ?     => 0w123 | !<=>  => 0w1234 | ==    => 0w12345 | ?=    => 0w123456          ?     => 0w123 | ==    => 0w12345 | ?=    => 0w123456
98        | !<>   => 0w234 | !?>=  => 0w2345 | <   => 0w23456 | ?<    => 0w345        | <   => 0w23456 | ?<    => 0w345
99        | !>=   => 0w3456 | !?>   => 0w34567 | <=  => 0w456   | ?<=   => 0w4567        | <=  => 0w456   | ?<=   => 0w4567
100        | !>    => 0w45678 | !?<=  => 0w567 | >  => 0w5678  | ?>    => 0w56789        | >  => 0w5678  | ?>    => 0w56789
101        | !<=   => 0w678 | !?<   => 0w6789 | >=    => 0w67890 | ?>=   => 0w789        | >=    => 0w67890 | ?>=   => 0w789
102        | !<    => 0w7890 | !?=   => 0w78901 | <>    => 0w890 | !=    => 0w8901        | <>    => 0w890
103        | !?    => 0w89012 | <=>   => 0w991 | ?<>   => 0w391        | <=>   => 0w991 | ?<>   => 0w391
104        | SETFCC => 0w94        | SETFCC => 0w94
105        | MISC_FCOND{hash, ...} => hash        | MISC_FCOND{hash, ...} => hash
106    

Legend:
Removed from v.744  
changed lines
  Added in v.1120

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0