GPROFFSET = { GPR reg; INT off; } 4 off "(" reg ")".
GPRGPR = { GPR reg1; GPR reg2; } 4 "(" reg1 "," reg2 ")".
GPRINC = { GPR reg; } 4 "(" reg ")++".
+ ADDCMPB_LL = { GPR rd; INT val; INT vs; ADDR dest; } 4 rd ",#" val ",#" vs "," dest.
/* Primitives */
add GPR:wo, GPR:ro, GPR+CONST:ro.
add GPR:rw, GPR+CONST:ro.
+ addcmpbge "addcmpb.ge" ADDCMPB_LL:rw.
adds2 GPR:rw, GPR+CONST:ro.
adds4 GPR:rw, GPR+CONST:ro.
adds8 GPR:rw, GPR+CONST:ro.
push GPR0+GPR6+GPR16+GPRFP:ro, GPRLR:ro.
sub GPR:wo, GPR:ro, CONST+GPR:ro.
sub GPR:rw, GPR+CONST:ro.
+ st GPR:ro, GPRINC:rw.
st GPR:ro, GPROFFSET+GPRGPR+LABEL:ro.
stb GPR:ro, GPROFFSET+GPRGPR+LABEL:ro.
sth GPR:ro, GPROFFSET+GPRGPR+LABEL:ro.
ld %b, {GPROFFSET, %b, 4}
yields %b %a
- pat loi !nicesize($1) /* Load arbitrary size */
+ pat loi $1==3*QUAD /* Load triple-quad indirect */
+ with LABEL
+ uses REG, REG, REG
+ gen
+ lea %b, %1
+ ld %a, {GPROFFSET, %b, 0}
+ ld %b, {GPROFFSET, %b, 4}
+ ld %b, {GPROFFSET, %b, 8}
+ yields %c %b %a
+ with GPR
+ uses reusing %1, REG, REG, REG
+ gen
+ add %b, %1, GP
+ ld %a, {GPROFFSET, %b, 0}
+ ld %b, {GPROFFSET, %b, 4}
+ ld %c, {GPROFFSET, %b, 8}
+ yields %c %b %a
+
+ pat loi /* Load arbitrary size */
leaving
loc $1
los QUAD
st %2, {GPROFFSET, %a, 0}
st %3, {GPROFFSET, %a, 4}
+ pat sti $1==3*QUAD /* Load triple-quad indirect */
+ with LABEL GPR GPR GPR
+ uses REG
+ gen
+ lea %a, %1
+ st %2, {GPROFFSET, %a, 0}
+ st %3, {GPROFFSET, %a, 4}
+ st %4, {GPROFFSET, %a, 8}
+ with GPR GPR GPR GPR
+ uses reusing %1, REG=%1
+ gen
+ add %a, GP
+ st %2, {GPROFFSET, %a, 0}
+ st %3, {GPROFFSET, %a, 4}
+ st %4, {GPROFFSET, %a, 8}
+
pat sti /* Store arbitrary size */
leaving
loc $1
sts QUAD
- pat sts /* Load arbitrary size */
- with STACK
- kills ALL
- gen
- bl {LABEL, ".sts"}
+ pat sts /* Store arbitrary size */
+ leaving
+ cal ".sts"