PreviousUpNext

15.3.201  src/lib/compiler/back/low/treecode/treecode-pith.api

## treecode-pith.api  -- derived from  ~/src/sml/nj/smlnj-110.58/new/new/src/MLRISC/mltree/mltree-basis.sig 

# Compiled by:
#     src/lib/compiler/back/low/lib/lowhalf.lib



###             "Mathematics is not the rigid and rigidity-producing
###              schema that the layman thinks it is; rather, in it
###              we find ourselves at that meeting point of constraint
###              and freedom that is the very essence of human nature."
###
###                                        -- Hermann Weyl



api Treecode_Pith {

    Attributes = Unt;

    Misc_Op = { name:           String,
                hash:           Unt,
                attributes:     Ref( Attributes )
              };



    #     "The most important of these are the types Cond and Fcond,
    #      which represent the set of integer and floating point comparisions.
    #      These types can be combined with the comparison constructors
    #      CMP and FCMP to form integer and floating point comparisions."
    #
    #                             -- http://www.cs.nyu.edu/leunga/MLRISC/Doc/html/mltree.html
    #
    # For CMP and FCMP see:  src/lib/compiler/back/low/treecode/treecode-form.api 
    #
    Cond = LT           # Signed less than
         | LTU          # Unsigned less than
         | LE           # Signed less than or equal
         | LEU          # Unsigned less than or equal
         | EQ           # Equal
         | NE           # Not equal
         | GE           # Signed greater than or equal
         | GEU          # Unsigned greater than or equal
         | GT           # Signed greater than
         | GTU          # Unsigned greater than
         | SETCC 
         | MISC_COND  { name:           String,
                        hash:           Unt,
                        attributes:     Ref( Unt )
                      }
         ;

    # Floating-point conditions; the semantics follow the IEEE specification and
    # are determined by four properties:
    #     GT -- greater than,
    #     EQ -- equal,
    #     LT -- less than,
    #     UO -- unordered.
    # In the table below, we have a column
    # for each of these properties and one for the negation of the operator.
    #
    Fcond     # Was     #  GT   EQ   LT   UO   negation 
                        #  ---  ---  ---  ---  -------- 
     = FEQ    # ====    #   F    T    F    F      ?<>   
     | FNEU   # ?<>     #   T    F    T    T      ==    
     | FGT    # >       #   T    F    F    F      ?<=   
     | FGE    # >=      #   T    T    F    F      ?<    
     | FLT    # <       #   F    F    T    F      ?>=   
     | FLE    # <=      #   F    T    T    F      ?>    
     | FUO    # ?       #   F    F    F    T      <=>   
     | FNE    # <>      #   T    F    T    F      ?=    
     | FGLE   # <=>     #   T    T    T    F      ?     
     | FGTU   # ?>      #   T    F    F    T      <=    
     | FGEU   # ?>=     #   T    T    F    T      <     
     | FLTU   # ?<      #   F    F    T    T      >=    
     | FLEU   # ?<=     #   F    T    T    T      >     
     | FEQU   # ?=      #   F    T    F    T      <>    
     | SETFCC
     | MISC_FCOND { name:       String,
                    hash:       Unt,
                    attributes: Ref( Unt )
                  }
     ;

    Rounding_Mode = ROUND_TO_NEAREST
                  | ROUND_TO_NEGINF
                  | ROUND_TO_POSINF
                  | ROUND_TO_ZERO
                  ;

    package d: api {
        #
        Div_Rounding_Mode = ROUND_TO_NEGINF                                     # Wrapped in private package 'd' to keep this ROUND_TO_ZERO and ROUND_TO_NEGINF from conflicting with preceding ones.
                          | ROUND_TO_ZERO
                          ;
    };

    Ext = DO_SIGN_EXTEND | DO_ZERO_EXTEND;

    # Should be sumtypes, but highcode
    # does not optimize them well:              XXX BUGGO FIXME
    #
    Int_Bitsize = Int;                          # Size-in-bits for int ops.           This is called 'ty'  in SML/NJ.
    Float_Bitsize = Int;                        #                                     This is called 'fty' in SML/NJ.

    # Invert the conditional when swapping the
    # two arguments of the comparision.
    # IMPORTANT: these are not negation!
    #
    swap_cond:    Cond ->  Cond;
    swap_fcond:  Fcond -> Fcond;

    # These are the negations! 
    #
    negate_cond:    Cond ->  Cond;
    negate_fcond:  Fcond -> Fcond;

    # Hashing functions:
    #
    hash_cond:          Cond -> Unt;
    hash_fcond:         Fcond -> Unt;
    hash_rounding_mode:  Rounding_Mode -> Unt;

    # Prettyprinting:
    #
    cond_to_string:          Cond -> String;
    fcond_to_string:         Fcond -> String;
    rounding_mode_to_string:  Rounding_Mode -> String;

};


## COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext