mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
Add constant folding rulues for ADDR
This commit is contained in:
parent
9a9c6f2aaf
commit
9dda4e7553
@ -278,6 +278,7 @@ IR_FOLD(ADD(C_U8, C_U8))
|
||||
IR_FOLD(ADD(C_U16, C_U16))
|
||||
IR_FOLD(ADD(C_U32, C_U32))
|
||||
IR_FOLD(ADD(C_U64, C_U64))
|
||||
IR_FOLD(ADD(C_ADDR, C_ADDR))
|
||||
{
|
||||
IR_ASSERT(IR_OPT_TYPE(opt) == op1_insn->type);
|
||||
IR_FOLD_CONST_U(op1_insn->val.u64 + op2_insn->val.u64);
|
||||
@ -308,6 +309,7 @@ IR_FOLD(SUB(C_U8, C_U8))
|
||||
IR_FOLD(SUB(C_U16, C_U16))
|
||||
IR_FOLD(SUB(C_U32, C_U32))
|
||||
IR_FOLD(SUB(C_U64, C_U64))
|
||||
IR_FOLD(SUB(C_ADDR, C_ADDR))
|
||||
{
|
||||
IR_ASSERT(IR_OPT_TYPE(opt) == op1_insn->type);
|
||||
IR_FOLD_CONST_U(op1_insn->val.u64 - op2_insn->val.u64);
|
||||
|
Loading…
x
Reference in New Issue
Block a user