x64: Improve codegen for vectors with constant shift amounts (#5797)

I stumbled across this working on #5795 and figured this was a nice
opportunity to improve the codegen here.
This commit is contained in:
Alex Crichton
2023-02-16 14:47:59 -06:00
committed by GitHub
parent 1efee4abdf
commit cae3b26623
4 changed files with 344 additions and 63 deletions

View File

@@ -259,6 +259,10 @@ impl Context for IsleContext<'_, '_, MInst, X64Backend> {
ty.lane_bits() - 1
}
fn shift_amount_masked(&mut self, ty: Type, val: Imm64) -> u32 {
(val.bits() as u32) & self.shift_mask(ty)
}
#[inline]
fn simm32_from_value(&mut self, val: Value) -> Option<GprMemImm> {
let inst = self.lower_ctx.dfg().value_def(val).inst()?;