p->push();
p->curr.flag = 0;
p->curr.subFlag = 1;
- p->CMP(GenReg::null(), GEN_CONDITIONAL_G, pred, GenReg::immuw(nextLabel));
+ p->CMP(GenReg::null(), GEN_CONDITIONAL_G, ip, GenReg::immuw(nextLabel));
// Branch to the jump target
this->branchPos.insert(std::make_pair(&insn, p->insnNum));
GenInstruction &insn = this->store[insnID];
assert(insnID < this->insnNum);
assert(insn.header.opcode == GEN_OPCODE_JMPI);
- this->setSrc1(&insn, GenReg::retype(GenReg::immw(jumpDistance), GEN_TYPE_D));
+ union { int32_t i32; int16_t i16; } target;
+ target.i32 = 0;
+ target.i16 = int16_t(jumpDistance);
+ //this->setSrc1(&insn, GenReg::retype(GenReg::immw(jumpDistance), GEN_TYPE_D));
+ this->setSrc1(&insn, GenReg::immd(target.i32));
}
/* To integrate with the above, it makes sense that the comparison