## adl-raw-syntax-predicates-g.pkg -- derived from ~/src/sml/nj/smlnj-110.60/MLRISC/Tools/ADL/mlrisc-defs.sml
#
# Abstract out lowhalf-specific things.
# Compiled by:
#
src/lib/compiler/back/low/tools/arch/make-sourcecode-for-backend-packages.lib### "Rest satisfied with doing well, and
### leave others to talk of you as they will."
###
### -- Pythagoras
# This generic is invoked in:
#
src/lib/compiler/back/low/tools/arch/adl-raw-syntax-predicates.pkggeneric package adl_raw_syntax_predicates_g (
# ===========================
#
raw: Adl_Raw_Syntax_Form # Adl_Raw_Syntax_Form is from
src/lib/compiler/back/low/tools/adl-syntax/adl-raw-syntax-form.api)
: (weak) Adl_Raw_Syntax_Predicates # Adl_Raw_Syntax_Predicates is from
src/lib/compiler/back/low/tools/arch/adl-raw-syntax-predicates.api{
package raw = raw; # "raw" == "raw_syntax".
# Never used by clients; needed only to get raw::Id type for API.
predefined_registerkinds
=
[ "INT_REGISTER", # The vanilla integer registers.
"FLOAT_REGISTER", # The main bank of floating-point registers.
"FLAGS_REGISTER", # We treat each bit in the physical Z/OV/... flags register as a logical one-bit condition-code register.
"RAM_BYTE", # Regular main memory.
"CONTROL_DEPENDENCY" # Control dependencies. It is technically convenient to treat these as "registers".
];
fun is_predefined_registerkind x
=
list::exists (\\ k = x==k) predefined_registerkinds;
pseudo_kinds = ["RAM_BYTE", "CONTROL_DEPENDENCY", "REGISTERSET"];
fun is_pseudo_registerkind x
=
list::exists (\\ k = x==k) pseudo_kinds;
};