Skip to content

Commit 3dc4574

Browse files
committed
Store only last 8 bits of host cpsr
1 parent df8098b commit 3dc4574

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jit/assembler/block_inst.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ impl BlockInstKind {
596596
fn save_guest_cpsr(opcodes: &mut Vec<u32>, thread_regs_addr_reg: Reg, host_reg: Reg) {
597597
opcodes.push(Mrs::cpsr(host_reg, Cond::AL));
598598
// Only copy the cond flags from host cpsr
599-
opcodes.push(AluShiftImm::mov(host_reg, host_reg, ShiftType::Lsr, 16, Cond::AL));
600-
opcodes.push(LdrStrImmSBHD::strh(host_reg, thread_regs_addr_reg, Reg::CPSR as u8 * 4 + 2, Cond::AL));
599+
opcodes.push(AluShiftImm::mov(host_reg, host_reg, ShiftType::Lsr, 24, Cond::AL));
600+
opcodes.push(LdrStrImm::strb_offset_al(host_reg, thread_regs_addr_reg, Reg::CPSR as u16 * 4 + 3));
601601
}
602602

603603
pub fn emit_opcode(&mut self, opcodes: &mut Vec<u32>, opcode_index: usize, branch_placeholders: &mut Vec<usize>, opcodes_offset: usize, used_host_regs: RegReserve) {

0 commit comments

Comments
 (0)