if (!emit_checkofs(ai, ofs)) {
Reg rn = ra_alloc1(as, ref, allow);
Reg rm = ra_allock(as, ofs, rset_exclude(allow, rn));
- emit_dnm(as, (ai ^ 0x01204800), rd, rn, rm);
+ emit_dnm(as, (ai^A64I_LS_R)|A64I_LS_UXTWx, rd, rn, rm);
return;
}
}
ra_allock(as, (irt_toitype(ir->t) << 15) | 0x7fff, allow), tmp);
}
if (ofs & FUSE_REG)
- emit_dnm(as, (A64I_LDRx^A64I_LS_R)|A64I_LS_UXTWx, tmp, idx, (ofs & 31));
+ emit_dnm(as, (A64I_LDRx^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, tmp, idx, (ofs & 31));
else
emit_lso(as, A64I_LDRx, tmp, idx, ofs);
}
src = ra_alloc1(as, ir->op2, RSET_FPR);
idx = asm_fuseahuref(as, ir->op1, &ofs, allow, A64I_STRd);
if (ofs & FUSE_REG)
- emit_dnm(as, (A64I_STRd^A64I_LS_R)|A64I_LS_UXTWx, (src & 31), idx, (ofs &31));
+ emit_dnm(as, (A64I_STRd^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, (src & 31), idx, (ofs &31));
else
emit_lso(as, A64I_STRd, (src & 31), idx, ofs);
} else {
idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type),
A64I_STRx);
if (ofs & FUSE_REG)
- emit_dnm(as, (A64I_STRx^A64I_LS_R)|A64I_LS_UXTWx, tmp, idx, (ofs & 31));
+ emit_dnm(as, (A64I_STRx^A64I_LS_R)|A64I_LS_UXTWx|A64I_LS_SH, tmp, idx, (ofs & 31));
else
emit_lso(as, A64I_STRx, tmp, idx, ofs);
if (ra_hasreg(src)) {
A64I_LS_U = 0x01000000,
A64I_LS_S = 0x00800000,
A64I_LS_R = 0x01200800,
- A64I_LS_UXTWx = 0x00005000,
- A64I_LS_LSLx = 0x00007000,
+ A64I_LS_SH = 0x00001000,
+ A64I_LS_UXTWx = 0x00004000,
+ A64I_LS_SXTWx = 0x0000c000,
+ A64I_LS_SXTXx = 0x0000e000,
+ A64I_LS_LSLx = 0x00006000,
A64I_ADDw = 0x0b000000,
A64I_ADDx = 0x8b000000,