2018-09-22 09:19:00 +00:00
|
|
|
# The second column indicates the type inference rules:
|
2016-10-22 21:04:13 +00:00
|
|
|
#
|
|
|
|
# I, F, L, D: int, float, long, double
|
2018-09-22 09:19:00 +00:00
|
|
|
# i, f: int, float; promoted to long, double based on size
|
2016-10-22 21:04:13 +00:00
|
|
|
# .: ignore this parameter
|
|
|
|
# ?: pull/push types from other ? parameters
|
2016-09-24 16:31:35 +00:00
|
|
|
|
|
|
|
# Simple terminals
|
2016-10-29 09:57:56 +00:00
|
|
|
S ?=.. CONST
|
2016-10-22 21:04:13 +00:00
|
|
|
V ?=.. REG
|
2016-10-23 19:54:14 +00:00
|
|
|
S ?=?. NOP
|
2016-10-22 21:04:13 +00:00
|
|
|
S I=.. LABEL
|
|
|
|
S I=.. BLOCK
|
|
|
|
V ?=.. PAIR
|
|
|
|
S ?=.. ANY
|
|
|
|
S ?=.. LOCAL
|
|
|
|
V ?=.. PHI
|
2016-09-24 16:31:35 +00:00
|
|
|
|
|
|
|
# Magic stack operations
|
2016-10-22 21:04:13 +00:00
|
|
|
S ?=?. PUSH
|
|
|
|
S ?=.. POP
|
2016-09-26 20:12:46 +00:00
|
|
|
|
2016-10-22 21:04:13 +00:00
|
|
|
# Memory operations
|
2016-10-23 19:54:14 +00:00
|
|
|
S ?=I. LOAD
|
|
|
|
S I=I. LOADB
|
|
|
|
S I=I. LOADH
|
2016-10-22 21:04:13 +00:00
|
|
|
S ?=I? STORE
|
2016-10-23 19:54:14 +00:00
|
|
|
S ?=I? STOREB
|
|
|
|
S ?=I? STOREH
|
2016-09-24 16:31:35 +00:00
|
|
|
|
|
|
|
# Arithemetic operations
|
2016-10-22 21:04:13 +00:00
|
|
|
S i=ii ADD
|
|
|
|
S i=ii SUB
|
|
|
|
S i=ii MUL
|
|
|
|
S i=ii DIV
|
|
|
|
S i=ii DIVU
|
|
|
|
S i=ii MOD
|
|
|
|
S i=ii MODU
|
|
|
|
S i=ii NEG
|
|
|
|
|
|
|
|
S f=ff ADDF
|
|
|
|
S f=ff SUBF
|
|
|
|
S f=ff MULF
|
|
|
|
S f=ff DIVF
|
|
|
|
S f=ff NEGF
|
|
|
|
|
|
|
|
S i=ii AND
|
|
|
|
S i=ii OR
|
|
|
|
S i=ii EOR
|
|
|
|
S i=ii NOT
|
|
|
|
S i=ii ASL
|
|
|
|
S i=ii ASR
|
|
|
|
S i=ii LSL
|
|
|
|
S i=ii LSR
|
|
|
|
|
|
|
|
# Bitwise conversions
|
|
|
|
# (Remember, these don't change the value, merely move it)
|
2016-10-23 19:54:14 +00:00
|
|
|
# (order is important here; the 8-byte version of each must immediate succeed
|
|
|
|
# the 4-byte version)
|
|
|
|
S F=I. COPYI
|
|
|
|
S I=F. COPYF
|
|
|
|
S D=L. COPYL
|
|
|
|
S L=D. COPYD
|
2016-10-22 21:04:13 +00:00
|
|
|
|
|
|
|
# Semantic conversions
|
2016-10-23 19:54:14 +00:00
|
|
|
# (order is important here; the 8-byte version of each must immediate succeed
|
|
|
|
# the 4-byte version)
|
|
|
|
S ?=I. FROMUI
|
|
|
|
S ?=L. FROMUL
|
|
|
|
S ?=I. FROMSI
|
|
|
|
S ?=L. FROMSL
|
2016-11-20 10:27:40 +00:00
|
|
|
S ?=F. FROMUF
|
|
|
|
S ?=D. FROMUD
|
|
|
|
S ?=F. FROMSF
|
|
|
|
S ?=D. FROMSD
|
2016-10-29 10:48:05 +00:00
|
|
|
S L=II FROMIPAIR
|
|
|
|
S I=L. FROML0
|
|
|
|
S I=L. FROML1
|
2016-10-23 19:54:14 +00:00
|
|
|
|
|
|
|
# The H versions are only used if wordsize > 2
|
|
|
|
S I=I. EXTENDB
|
|
|
|
S I=I. EXTENDH
|
|
|
|
S I=I. TRUNCATEB
|
|
|
|
S I=I. TRUNCATEH
|
2016-10-21 22:48:26 +00:00
|
|
|
|
2016-09-24 16:31:35 +00:00
|
|
|
# Tristate comparisons
|
2016-10-23 19:54:14 +00:00
|
|
|
# (order is important here; the 8-byte version of each must immediate succeed
|
|
|
|
# the 4-byte version)
|
|
|
|
S I=II COMPARESI
|
|
|
|
S I=LL COMPARESL
|
|
|
|
S I=II COMPAREUI
|
|
|
|
S I=LL COMPAREUL
|
|
|
|
S I=FF COMPAREF
|
|
|
|
S I=DD COMPARED
|
2016-09-26 20:12:46 +00:00
|
|
|
|
2016-10-22 18:32:51 +00:00
|
|
|
# Tristate to boolean conversion
|
2016-10-22 21:04:13 +00:00
|
|
|
S I=I. IFEQ
|
|
|
|
S I=I. IFLT
|
|
|
|
S I=I. IFLE
|
2016-09-26 20:12:46 +00:00
|
|
|
|
2016-09-24 16:31:35 +00:00
|
|
|
# Procedures
|
2016-10-29 09:57:56 +00:00
|
|
|
S i=I. CALL
|
|
|
|
S i=?. GETRET
|
|
|
|
S ?=i. SETRET
|
2016-09-26 20:12:46 +00:00
|
|
|
|
2016-09-24 16:31:35 +00:00
|
|
|
# Flow control --- these never return
|
2016-10-22 21:04:13 +00:00
|
|
|
V .=i. JUMP
|
2016-11-19 09:55:41 +00:00
|
|
|
V .=i. FARJUMP
|
2016-10-22 21:04:13 +00:00
|
|
|
V .=i. CJUMPEQ
|
|
|
|
V .=i. CJUMPLT
|
|
|
|
V .=i. CJUMPLE
|
|
|
|
V .=.. RET
|
2016-09-24 16:31:35 +00:00
|
|
|
|
|
|
|
# Special
|
2016-10-22 21:04:13 +00:00
|
|
|
S ?=i. STACKADJUST
|
|
|
|
S i=.. GETFP
|
2016-10-29 09:57:56 +00:00
|
|
|
S ?=i. SETFP
|
2016-10-22 21:04:13 +00:00
|
|
|
S i=.. GETSP
|
|
|
|
S ?=i. SETSP
|
|
|
|
S i=i. CHAINFP
|
2016-10-29 09:57:56 +00:00
|
|
|
S i=i. FPTOAB
|
|
|
|
S i=i. FPTOLB
|
2016-09-24 16:31:35 +00:00
|
|
|
|