Skip to content

Commit

Permalink
x64: store to all scalar sizes
Browse files Browse the repository at this point in the history
Previously, `Inst::store` only understood a subset of the scalar types, which resulted in failures seen in bytecodealliance#2826. This change allows `Inst::store` to generate instructions for all scalar widths (`8 | 16 | 32 | 64`) since all of these are supported in the emission code of `Inst::MovRM`.
  • Loading branch information
abrown authored and mchesser committed May 24, 2021
1 parent da4dbf3 commit 01b9a87
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cranelift/codegen/src/isa/x64/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,16 +1126,7 @@ impl Inst {
pub(crate) fn store(ty: Type, from_reg: Reg, to_addr: impl Into<SyntheticAmode>) -> Inst {
let rc = from_reg.get_class();
match rc {
RegClass::I64 => Inst::mov_r_m(
match ty {
types::B1 => OperandSize::Size8,
types::I32 | types::R32 => OperandSize::Size32,
types::I64 | types::R64 => OperandSize::Size64,
_ => unimplemented!("integer store of type: {}", ty),
},
from_reg,
to_addr,
),
RegClass::I64 => Inst::mov_r_m(OperandSize::from_ty(ty), from_reg, to_addr),
RegClass::V128 => {
let opcode = match ty {
types::F32 => SseOpcode::Movss,
Expand Down

0 comments on commit 01b9a87

Please sign in to comment.