s390x: Move the value out of the casloop_val_reg with mov_preg (#5430)

The casloop_emit function in the s390x backend was using the fixed non-allocatable register %r0 directly with move instructions, which produced a panic in the regalloc2 checker (#5425). This PR changes the casloop_result function to use mov_preg instead of copy_reg to fetch the result, as it's not viewed by regalloc2 as a move.

Fixes #5425
This commit is contained in:
Trevor Elliott
2022-12-14 13:06:35 -08:00
committed by GitHub
parent 8383e4b6bd
commit 9dc4f1a83c
5 changed files with 37 additions and 7 deletions

View File

@@ -938,6 +938,11 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, S390xBackend> {
stack_reg().to_real_reg().unwrap().into()
}
#[inline]
fn preg_gpr_0(&mut self) -> PReg {
gpr(0).to_real_reg().unwrap().into()
}
#[inline]
fn writable_regpair(&mut self, hi: WritableReg, lo: WritableReg) -> WritableRegPair {
WritableRegPair { hi, lo }