}
else if (fmt == IF_T2_N1)
{
+ assert(ins == INS_movt || ins == INS_movw);
code |= insEncodeRegT2_D(id->idReg1());
- unsigned imm = distVal;
- if (ins == INS_movw)
- {
- imm &= 0xffff;
- }
- else
- {
- imm = (imm >> 16) & 0xffff;
- }
((instrDescJmp*)id)->idjTemp.idjAddr = (dstOffs > srcOffs) ? dst : NULL;
- code |= insEncodeImmT2_Mov(imm);
- dst += emitOutput_Thumb2Instr(dst, code);
-
- if (id->idIsCnsReloc() || id->idIsDspReloc())
+ if (id->idIsReloc())
{
- assert(ins == INS_movt || ins == INS_movw);
+ dst += emitOutput_Thumb2Instr(dst, code);
if ((ins == INS_movt) && emitComp->info.compMatchedVM)
emitHandlePCRelativeMov32((void*)(dst - 8), (void*)distVal);
}
+ else
+ {
+ assert(sizeof(size_t) == sizeof(target_size_t));
+ target_size_t imm = (target_size_t)distVal;
+ if (ins == INS_movw)
+ {
+ imm &= 0xffff;
+ }
+ else
+ {
+ imm = (imm >> 16) & 0xffff;
+ }
+ code |= insEncodeImmT2_Mov(imm);
+ dst += emitOutput_Thumb2Instr(dst, code);
+ }
}
else
{