## treecode-extension.api -- architecture-specific extensions to Treecode_Form.
#
# CONTEXT:
#
# The Mythryl compiler code representations used are, in order:
#
# 1) Raw Syntax is the initial frontend code representation.
# 2) Deep Syntax is the second and final frontend code representation.
# 3) Lambdacode (polymorphically typed lambda calculus) is the first backend code representation, used only transitionally.
# 4) Anormcode (A-Normal format, which preserves expression tree structure) is the second backend code representation, and the first used for optimization.
# 5) Nextcode ("continuation-passing style", a single-assignment basic-block-graph form where call and return are essentially the same) is the third and chief backend tophalf code representation.
# 6) Treecode is the backend tophalf/lowhalf transitional code representation. It is typically slightly specialized for each target architecture, e.g. Intel32 (x86).
# 7) Machcode abstracts the target architecture machine instructions. It gets specialized for each target architecture.
# 8) Execode is absolute executable binary machine instructions for the target architecture.
#
# For general context, see
#
# src/A.COMPILER-PASSES.OVERVIEW
#
# Treecode_Form, defined in
#
#
src/lib/compiler/back/low/treecode/treecode-form.api#
# is intended to be a largely architecture-agnostic intermediate
# code representation, but we do allow architecture-specific
# extensions to it, primarily to support architecture-specific
# features such as sparc register windows and the x86 floating-point
# stack -- features which cannot be described in terms of the standard
# treecode primitives.
#
# Since the mainline Mythryl compiler code knows nothing about these
# architecture-specific extensions, if you define extended instructions
# or such here you will also have to provide custom code to compile them.
# The api for doing that is defined in
#
#
src/lib/compiler/back/low/treecode/treecode-extension-compiler.api#
# See also:
#
src/lib/compiler/back/low/main/nextcode/treecode-extension-mythryl.api#
# For the original MLRISC docs see:
#
# http://www.cs.nyu.edu/leunga/MLRISC/Doc/html/mltree-ext.html
# Compiled by:
#
src/lib/compiler/back/low/lib/lowhalf.lib# This api is used in:
#
#
src/lib/compiler/back/low/treecode/treecode-form-g.pkg#
api Treecode_Extension {
#
Sx (S, R, F, C); # "Sx" == "statement extension".
Rx (S, R, F, C); # "Rx" == "(integer) register extension".
Fx (S, R, F, C); # "Fx" == "float-register extension".
Ccx (S, R, F, C); # "Ccx" == "condition code extension". Condition codes reflect ALU bits like Parity/Overflow/Equal/Lessthan/...
};