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

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

Issue 1419753008: MIPS: [turbofan] Properly implement Float64/32 Min/Max instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant functions. Created 5 years, 1 month 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
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | test/unittests/compiler/mips/instruction-selector-mips-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbea5fec06e6f07b79e8fe623f03fe095e2e77a6..ae06b8603ef1cbe74934ef1ab67fa1038fbc6455 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -3391,6 +3391,70 @@ TEST(RunFloat64AddP) {
}
+TEST(RunFloa32MaxP) {
+ RawMachineAssemblerTester<int32_t> m;
+ Float32BinopTester bt(&m);
+ if (!m.machine()->Float32Max().IsSupported()) return;
+
+ bt.AddReturn(m.Float32Max(bt.param0, bt.param1));
+
+ FOR_FLOAT32_INPUTS(pl) {
+ FOR_FLOAT32_INPUTS(pr) {
+ double expected = *pl > *pr ? *pl : *pr;
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
+ }
+ }
+}
+
+
+TEST(RunFloat64MaxP) {
+ RawMachineAssemblerTester<int32_t> m;
+ Float64BinopTester bt(&m);
+ if (!m.machine()->Float64Max().IsSupported()) return;
+
+ bt.AddReturn(m.Float64Max(bt.param0, bt.param1));
+
+ FOR_FLOAT64_INPUTS(pl) {
+ FOR_FLOAT64_INPUTS(pr) {
+ double expected = *pl > *pr ? *pl : *pr;
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
+ }
+ }
+}
+
+
+TEST(RunFloat32MinP) {
+ RawMachineAssemblerTester<int32_t> m;
+ Float32BinopTester bt(&m);
+ if (!m.machine()->Float32Min().IsSupported()) return;
+
+ bt.AddReturn(m.Float32Min(bt.param0, bt.param1));
+
+ FOR_FLOAT32_INPUTS(pl) {
+ FOR_FLOAT32_INPUTS(pr) {
+ double expected = *pl < *pr ? *pl : *pr;
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
+ }
+ }
+}
+
+
+TEST(RunFloat64MinP) {
+ RawMachineAssemblerTester<int32_t> m;
+ Float64BinopTester bt(&m);
+ if (!m.machine()->Float64Min().IsSupported()) return;
+
+ bt.AddReturn(m.Float64Min(bt.param0, bt.param1));
+
+ FOR_FLOAT64_INPUTS(pl) {
+ FOR_FLOAT64_INPUTS(pr) {
+ double expected = *pl < *pr ? *pl : *pr;
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
+ }
+ }
+}
+
+
TEST(RunFloat32SubP) {
RawMachineAssemblerTester<int32_t> m;
Float32BinopTester bt(&m);
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | test/unittests/compiler/mips/instruction-selector-mips-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698