[tbb-commits] [tor-browser] 21/43: Bug 1766806 - Avoid checkIntegrity failure in f32.copysign wasm instruction. r=lth, a=RyanVM
gitolite role
git at cupani.torproject.org
Tue May 31 07:07:04 UTC 2022
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-91.10.0esr-11.0-1
in repository tor-browser.
commit 9e62fd14089bc92867219df172a97bf26d80e35c
Author: Yury Delendik <ydelendik at mozilla.com>
AuthorDate: Tue May 3 16:32:07 2022 +0000
Bug 1766806 - Avoid checkIntegrity failure in f32.copysign wasm instruction. r=lth, a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D145009
---
js/src/jit-test/tests/wasm/regress/bug1762899.js | 15 +++++++++++++++
js/src/jit/arm64/Lowering-arm64.cpp | 4 +++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/js/src/jit-test/tests/wasm/regress/bug1762899.js b/js/src/jit-test/tests/wasm/regress/bug1762899.js
index 5df2a53404fcd..3938c93a02d1a 100644
--- a/js/src/jit-test/tests/wasm/regress/bug1762899.js
+++ b/js/src/jit-test/tests/wasm/regress/bug1762899.js
@@ -10,6 +10,17 @@ var ins = wasmEvalText(`
local.get 0
f32.copysign
)
+ (func (export "copysign_f64_2") (param f64 f64) (result f64)
+ local.get 1
+ f64.const 0x1.921fb54442d18p+0 (;=1.5708;)
+ f64.copysign
+ )
+ (func (export "copysign_f32_2") (param f32 f32) (result f32)
+ local.get 1
+ f32.const -0x1.921fb54442d18p+0 (;=1.5708;)
+ f32.copysign
+ )
+
)
`);
@@ -17,3 +28,7 @@ assertEq(ins.exports.copysign_f64(1, 0), 1.5707963267948966);
assertEq(ins.exports.copysign_f64(-1, 0), -1.5707963267948966);
assertEq(ins.exports.copysign_f32(1, 0), 1.5707963705062866);
assertEq(ins.exports.copysign_f32(-1, 0), -1.5707963705062866);
+assertEq(ins.exports.copysign_f64_2(0, 1), 1);
+assertEq(ins.exports.copysign_f64_2(0, -1), 1);
+assertEq(ins.exports.copysign_f32_2(0, 1), -1);
+assertEq(ins.exports.copysign_f32_2(0, -1), -1);
diff --git a/js/src/jit/arm64/Lowering-arm64.cpp b/js/src/jit/arm64/Lowering-arm64.cpp
index 1e1a4d78e6369..95d581c559279 100644
--- a/js/src/jit/arm64/Lowering-arm64.cpp
+++ b/js/src/jit/arm64/Lowering-arm64.cpp
@@ -960,7 +960,9 @@ void LIRGenerator::visitCopySign(MCopySign* ins) {
}
lir->setOperand(0, useRegisterAtStart(lhs));
- lir->setOperand(1, useRegisterAtStart(rhs));
+ lir->setOperand(1, willHaveDifferentLIRNodes(lhs, rhs)
+ ? useRegister(rhs)
+ : useRegisterAtStart(rhs));
// The copySignDouble and copySignFloat32 are optimized for lhs == output.
// It also prevents rhs == output when lhs != output, avoids clobbering.
defineReuseInput(lir, ins, 0);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the tbb-commits
mailing list