riscv64: Clear the top 32bits in the br_table index (#5831)

We were unintentionally relying on these to be zeroed when jumping.
This commit is contained in:
Afonso Bordado
2023-02-21 18:05:51 +00:00
committed by GitHub
parent 4d954f5c0e
commit 0f51338def
6 changed files with 157 additions and 7 deletions

View File

@@ -378,6 +378,7 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Riscv64Backend> {
fn lower_br_table(&mut self, index: Reg, targets: &VecMachLabel) -> Unit {
let tmp1 = self.temp_writable_reg(I64);
let tmp2 = self.temp_writable_reg(I64);
let targets: Vec<BranchTarget> = targets
.into_iter()
.copied()
@@ -386,6 +387,7 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Riscv64Backend> {
self.emit(&MInst::BrTable {
index,
tmp1,
tmp2,
targets,
});
}