yields %a
pat and defined($1) /* AND set */
- with STACK
- kills ALL
- gen
- move {CONST, $1}, R3
- bl {LABEL, ".and"}
+ leaving
+ loc $1
+ cal ".and"
+
+ pat and !defined($1)
+ leaving
+ cal ".and"
pat ior $1==4 /* OR word */
with REG NOT_R
yields {NOT_R, %1}
pat com defined($1) /* NOT set */
- with STACK
- gen
- move {CONST, $1}, R3
- bl {LABEL, ".com"}
+ leaving
+ loc $1
+ cal ".com"
+
+ pat com !defined($1)
+ leaving
+ cal ".com"
pat zer $1==4 /* Push zero */
leaving
loc $1
cal ".inn"
+ pat inn !defined($1)
+ leaving
+ cal ".inn"
+
/* Boolean resolutions */
ass 4
pat lae rck $2==4 /* Range check */
- with GPR
+ with REG
uses CR0
gen
cmpli %a, {CONST, 0}, %1, {CONST, rom($1, 1)}
bc IFTRUE, LT, {LABEL, ".trap_erange"}
cmpli %a, {CONST, 0}, %1, {CONST, rom($1, 2)}
bc IFTRUE, GT, {LABEL, ".trap_erange"}
+ yields %1
}
case op_trp: helper_function(".trp"); break;
- case op_sig: helper_function(".sig"); break;
+
+ case op_sig:
+ {
+ struct ir* value = pop(EM_pointersize);
+ appendir(
+ store(
+ EM_pointersize,
+ new_labelir(".trppc"), 0,
+ value
+ )
+ );
+ break;
+ }
case op_rtt:
{
if (size > (2*EM_wordsize))
{
if (!fallback)
- fatal("treebuilder: can't do opcode %d with size %d", opcode, size);
+ fatal("treebuilder: can't do opcode %s with size %d", em_mnem[opcode - sp_fmnem], size);
push(
new_wordir(size)
);
if (size > (2*EM_wordsize))
{
if (!fallback)
- fatal("treebuilder: can't do opcode %d with size %d", opcode, size);
+ fatal("treebuilder: can't do opcode %s with size %d", em_mnem[opcode - sp_fmnem], size);
push(
new_wordir(size)
);
case op_rmu: simple_alu2(opcode, value, IR_MODU, NULL); break;
case op_dvu: simple_alu2(opcode, value, IR_DIVU, NULL); break;
- case op_and: simple_alu2(opcode, value, IR_AND, NULL); break;
+ case op_and: simple_alu2(opcode, value, IR_AND, ".and"); break;
case op_ior: simple_alu2(opcode, value, IR_OR, ".ior"); break;
case op_xor: simple_alu2(opcode, value, IR_EOR, NULL); break;
- case op_com: simple_alu1(opcode, value, IR_NOT, NULL); break;
+ case op_com: simple_alu1(opcode, value, IR_NOT, ".com"); break;
case op_adf: simple_alu2(opcode, value, IR_ADDF, NULL); break;
case op_sbf: simple_alu2(opcode, value, IR_SUBF, NULL); break;