ack/util/mcgg/ir.dat
David Given cc176e5183 Keep more data around about ir instructions. Implement a half-baked type
inference routine to propagate information about floats up the tree, so we know
whether to put floats into special registers as early as possible.
2016-09-26 22:12:46 +02:00

92 lines
1.1 KiB
Text

# Flags:
# S: has size (use in CONST1, CONST2, CONST4, CONST8 forms)
# V: has no size (use in JUMP, CJUMP, RET forms)
#
# Types:
# I, F: integer, float
# A: any (will be coerced to I or F during IR postprocessing)
#
# Any instruction with an A type must be followed by the corresponding F
# version.
# Simple terminals
SA.. CONST
SF.. CONSTF
SA.. REG
SF.. REGF
SI.. LABEL
SI.. BLOCK
V... PAIR
SA.. ANY
SF.. ANYF
S... LOCAL
S... PHI
# Magic stack operations
S.A. PUSH
S.F. PUSHF
SA.. POP
SF.. POPF
#... Memory operations
SAI. LOAD
SFI. LOADF
S.IA STORE
S.IF STOREF
# Arithemetic operations
SIII ADD
SIII SUB
SIII MUL
SIII DIV
SIII MOD
SIII NEG
SFFF ADDF
SFFF SUBF
SFFF MULF
SFFF DIVF
SFFF NEGF
SIII AND
SIII OR
SIII EOR
SIII NOT
# Conversions
SIII CII1
SIII CII2
SIII CII4
SIII CII8
SIII CIU1
SIII CIU2
SIII CIU4
SIII CIU8
# Tristate comparisons
SIII COMPARES
SIII COMPAREU
# Boolean comparisons
SIII IFEQ
SIII IFLT
SIII IFLE
# Procedures
VI.. CALL
# Flow control --- these never return
V.I. JUMP
VIII CJUMPEQ
VIII CJUMPLT
VIII CJUMPLE
V... RET
# Special
SI.. STACKADJUST
SA.. GETRET
SF.. GETRETF
S.A. SETRET
S.F. SETRETF