x64: use constant pool for u64 constants rather than movabs. (#4088)
* Allow emitting u64 constants into constant pool. * Use constant pool for constants on x64 that do not fit in a simm32 and are needed as a RegMem or RegMemImm. * Fix rip-relative addressing bug in pinsrd emission.
This commit is contained in:
@@ -78,10 +78,11 @@ where
|
||||
return imm.to_reg_mem_imm();
|
||||
}
|
||||
|
||||
// Generate constants fresh at each use to minimize long-range
|
||||
// A load from the constant pool is better than a
|
||||
// rematerialization into a register, because it reduces
|
||||
// register pressure.
|
||||
let ty = self.value_type(val);
|
||||
return RegMemImm::reg(generated_code::constructor_imm(self, ty, c).unwrap());
|
||||
let vcode_constant = self.emit_u64_le_const(c);
|
||||
return RegMemImm::mem(SyntheticAmode::ConstantOffset(vcode_constant));
|
||||
}
|
||||
|
||||
if let InputSourceInst::UniqueUse(src_insn, 0) = inputs.inst {
|
||||
@@ -99,10 +100,11 @@ where
|
||||
let inputs = self.lower_ctx.get_value_as_source_or_const(val);
|
||||
|
||||
if let Some(c) = inputs.constant {
|
||||
// Generate constants fresh at each use to minimize long-range
|
||||
// A load from the constant pool is better than a
|
||||
// rematerialization into a register, because it reduces
|
||||
// register pressure.
|
||||
let ty = self.value_type(val);
|
||||
return RegMem::reg(generated_code::constructor_imm(self, ty, c).unwrap());
|
||||
let vcode_constant = self.emit_u64_le_const(c);
|
||||
return RegMem::mem(SyntheticAmode::ConstantOffset(vcode_constant));
|
||||
}
|
||||
|
||||
if let InputSourceInst::UniqueUse(src_insn, 0) = inputs.inst {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src/clif.isle 443b34b797fc8ace
|
||||
src/prelude.isle 97c4b6eebbab9f05
|
||||
src/isa/x64/inst.isle a7f86254b89a7136
|
||||
src/prelude.isle e6c91b0115343ab9
|
||||
src/isa/x64/inst.isle 833710d359126637
|
||||
src/isa/x64/lower.isle 4c567e9157f84afb
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user