## operand-table.api -- derived from ~/src/sml/nj/smlnj-110.58/new/new/src/MLRISC/mltree/operand-table.sig
#
# A table for storing operands for a compilation unit.
# We give each distinct operand a unique (negative) value number.
# Compiled by:
#
src/lib/compiler/back/low/lib/rtl.libstipulate
package rkj = registerkinds_junk; # registerkinds_junk is from
src/lib/compiler/back/low/code/registerkinds-junk.pkgherein
# This api is currently referenced only in
#
#
src/lib/compiler/back/low/treecode/operand-table-g.pkg #
# but see also
#
# src/lib/compiler/back/low/tools/arch/adl-gen-ssaprops.pkg: "package operand_table: OPERAND_TABLE where I = Instr",
# src/lib/compiler/back/low/tools/arch/adl-gen-rtlprops.pkg: "package operand_table: OPERAND_TABLE where I = Instr",
#
api Operand_Table {
#
package mcf: Machcode_Form; # Machcode_Form is from
src/lib/compiler/back/low/code/machcode-form.api Operand_Table;
Value_Number = rkj::Codetemp_Info;
Const
= INT Int # Small integer operand.
| INTEGER machine_int::Machine_Int
# Large integer operand.
| OPERAND mcf::Operand
# Other operand.
;
Value_Number_Methods
=
VALUE_NUMBERING
{ int: Int -> Value_Number,
unt: Unt -> Value_Number,
#
one_word_unt: one_word_unt::Unt -> Value_Number,
one_word_int: one_word_int::Int -> Value_Number,
#
integer: multiword_int::Int -> Value_Number,
operand: mcf::Operand -> Value_Number
};
exception NO_OPERAND;
exception NO_INT;
exception NO_MULTIWORD_INT;
exception NO_CONST;
# Special values:
#
bot: Value_Number;
top: Value_Number;
volatile: Value_Number;
create: Ref(Int) -> Operand_Table; # Create a new table.
# Lookup methods:
#
const: Value_Number -> Const; # Value number -> int/operand/label
#
int: Operand_Table -> Int -> Value_Number;
unt: Operand_Table -> Unt -> Value_Number;
one_word_int: Operand_Table -> one_word_int::Int -> Value_Number;
one_word_unt: Operand_Table -> one_word_unt::Unt -> Value_Number;
integer: Operand_Table -> multiword_int::Int -> Value_Number;
operand: Operand_Table -> mcf::Operand -> Value_Number;
make_new_value_numbers: Operand_Table -> Value_Number_Methods; # Create new value numbers.
#
lookup_value_numbers: Operand_Table -> Value_Number_Methods; # Look up but don't create.
};
end;