Skip to content

Truly independent web browser

LibJS/JIT: Move float64 constants into registers without a GPR

Andreas Klinge232e81eefd2
diff --git a/Libraries/LibJS/JIT/Rust/src/codegen/mod.rs b/Libraries/LibJS/JIT/Rust/src/codegen/mod.rs
index 6b6545d2020..77097810024 100644
--- a/Libraries/LibJS/JIT/Rust/src/codegen/mod.rs
+++ b/Libraries/LibJS/JIT/Rust/src/codegen/mod.rs
@@ -1171,10 +1171,7 @@ impl<M: PortableMacroAssembler> Codegen<'_, M> {
}
(Location::Constant(bits), Location::Register(to)) => match register_of(to) {
Register::General(to) => self.masm.move_imm64(to, bits),
- Register::Float(to) => {
- self.masm.move_imm64(self.pinned.scratch, bits);
- self.masm.move_gpr_to_double(to, self.pinned.scratch);
- }
+ Register::Float(to) => self.masm.move_double_imm(to, f64::from_bits(bits)),
},
(Location::Constant(bits), Location::Stack(to)) => {
let address = self.spill_address(to);