serror("16-bit value out of range");
$$ = (uint16_t) $1;
}
- | OP_HA ASC_LPAR expr ASC_RPAR { $$ = emit_ha(&$3, false); }
- | OP_HAS ASC_LPAR expr ASC_RPAR { $$ = emit_ha(&$3, true); }
+ | OP_HI ASC_LPAR expr ASC_RPAR { $$ = emit_hi(&$3, false); }
+ | OP_HA ASC_LPAR expr ASC_RPAR { $$ = emit_hi(&$3, true); }
| OP_LO ASC_LPAR expr ASC_RPAR { $$ = emit_lo(&$3); }
;
/* Primitives */
LABEL = { ADDR adr; } 4 adr.
+ LABEL_OFFSET_HI = { ADDR adr; } 4 "hi16[" adr "]".
LABEL_OFFSET_HA = { ADDR adr; } 4 "ha16[" adr "]".
- LABEL_OFFSET_HAS = { ADDR adr; } 4 "has16[" adr "]".
LABEL_OFFSET_LO = { ADDR adr; } 4 "lo16[" adr "]".
LOCAL = { INT off; } 4.
add GPR:wo, GPR:ro, GPR:ro.
addX "add." GPR:wo, GPR:ro, GPR:ro.
addi GPR:wo, GPR:ro, CONST:ro.
- addis GPR:wo, GPR:ro, CONST+LABEL_OFFSET_HA+LABEL_OFFSET_HAS:ro.
+ addis GPR:wo, GPR:ro, CONST+LABEL_OFFSET_HI+LABEL_OFFSET_HA:ro.
and GPR:wo, GPR:ro, GPR:ro.
andc GPR:wo, GPR:ro, GPR:ro.
andiX "andi." GPR:wo:cc, GPR:ro, CONST:ro.
from LABEL to GPR
gen
COMMENT("move LABEL->GPR")
- addis %2, R0, {LABEL_OFFSET_HA, %1.adr}
+ addis %2, R0, {LABEL_OFFSET_HI, %1.adr}
ori %2, %2, {LABEL_OFFSET_LO, %1.adr}
/* Sign extension */
with LABEL
uses REG
gen
- addis %a, R0, {LABEL_OFFSET_HAS, %1.adr}
+ addis %a, R0, {LABEL_OFFSET_HA, %1.adr}
lwz %a, {GPRINDIRECT_OFFSET_LO, %a, %1.adr}
yields %a
with GPR