Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 1046893002: [x64] Match -0 - x with sign bit flip. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unittest Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index fdc1a48eafb6ea3afee1b0ad06c93ac389e22832..1686d377883e9c68898e301461b46d36a384384a 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -3212,6 +3212,46 @@ TEST(RunFloat32SubP) {
}
+TEST(RunFloat32SubImm1) {
+ float input = 0.0f;
+ float output = 0.0f;
+
+ FOR_FLOAT32_INPUTS(i) {
+ RawMachineAssemblerTester<int32_t> m;
+ Node* t0 = m.LoadFromPointer(&input, kMachFloat32);
+ Node* t1 = m.Float32Sub(m.Float32Constant(*i), t0);
+ m.StoreToPointer(&output, kMachFloat32, t1);
+ m.Return(m.Int32Constant(0));
+ FOR_FLOAT32_INPUTS(j) {
+ input = *j;
+ float expected = *i - input;
+ CHECK_EQ(0, m.Call());
+ CheckFloatEq(expected, output);
+ }
+ }
+}
+
+
+TEST(RunFloat32SubImm2) {
+ float input = 0.0f;
+ float output = 0.0f;
+
+ FOR_FLOAT32_INPUTS(i) {
+ RawMachineAssemblerTester<int32_t> m;
+ Node* t0 = m.LoadFromPointer(&input, kMachFloat32);
+ Node* t1 = m.Float32Sub(t0, m.Float32Constant(*i));
+ m.StoreToPointer(&output, kMachFloat32, t1);
+ m.Return(m.Int32Constant(0));
+ FOR_FLOAT32_INPUTS(j) {
+ input = *j;
+ float expected = input - *i;
+ CHECK_EQ(0, m.Call());
+ CheckFloatEq(expected, output);
+ }
+ }
+}
+
+
TEST(RunFloat64SubP) {
RawMachineAssemblerTester<int32_t> m;
Float64BinopTester bt(&m);
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | test/unittests/compiler/x64/instruction-selector-x64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698