PreviousUpNext

15.3.174  src/lib/compiler/back/low/tools/arch/lowhalf-types.api

## lowhalf-types.api -- derived from   ~/src/sml/nj/smlnj-110.60/MLRISC/Tools/ADL/mlrisc-types.sig 
#
# This module defines special handling of various types in lowhalf

# Compiled by:
#     src/lib/compiler/back/low/tools/arch/make-sourcecode-for-backend-packages.lib

stipulate
    package raw =   adl_raw_syntax_form;                                                                # adl_raw_syntax_form   is from   src/lib/compiler/back/low/tools/adl-syntax/adl-raw-syntax-form.pkg
herein

    # This api is implemented in:
    #     src/lib/compiler/back/low/tools/arch/lowhalf-types-g.pkg
    #
    api Lowhalf_Types {
        #
        package rtl:    Treecode_Rtl;                                                                   # Treecode_Rtl          is from   src/lib/compiler/back/low/treecode/treecode-rtl.api

        # Does this type has special meaning in an instruction representation? 
        # If so, we warn the user if the argument is somehow not mentioned
        # in the RTL:
        #
        is_special_rep_type:  raw::Type -> Bool;


        # Given a type for an rtl argument, 
        # return actual representation type in lowhalf:
        #
        representation_of
            :
            ( raw::Id,
              raw::Id,
              raw::Loc,
              raw::Type
            )
            ->
            ( Int,
              raw::Id
            );


        # Given an rtl argument and the actual representation type,
        # insert coercion if possible:
        #
        insert_rep_coercion:  (rtl::Expression, raw::Type) -> Void;


        # Code generation magic
        #
        is_const:  rtl::tcf::Rep -> Bool;                                                               # Does it represent a constant?

        of_registerkind:  (rtl::Expression, raw::Register_Set) -> Bool;


        # Generate code for extracting an operand.
        # The functions generated are
        #   get_registerset,
        #   get_register,
        #   get_label, 
        #   get_operand, 
        # etc.
        #
        Conv = IGNORE
             | CONV  String
             | MULTI String
             ;

        get_opnd:  
            List( (String, Conv) )
            -> 
            { decl:  raw::Declaration,
              get:  (raw::Expression, rtl::Expression, raw::Expression) -> raw::Expression 
            };

    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext