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

Unified Diff: test/cctest/compiler/codegen-tester.h

Issue 1044793002: [turbofan] Add backend support for float32 operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add MachineOperator unit tests. Created 5 years, 9 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/codegen-tester.h
diff --git a/test/cctest/compiler/codegen-tester.h b/test/cctest/compiler/codegen-tester.h
index d45d1fdc3322fc279185e54b0c2b0be44af15ff7..f2fc48a4799536f1774c2df968f22c1fe5837187 100644
--- a/test/cctest/compiler/codegen-tester.h
+++ b/test/cctest/compiler/codegen-tester.h
@@ -143,7 +143,7 @@ class BinopTester {
CHECK_EQ(CHECK_VALUE, T->Call());
return result;
} else {
- return T->Call();
+ return static_cast<CType>(T->Call());
}
}
@@ -200,6 +200,17 @@ class Uint32BinopTester
};
+// A helper class for testing code sequences that take two float parameters and
+// return a float value.
+// TODO(titzer): figure out how to return floats correctly on ia32.
+class Float32BinopTester
+ : public BinopTester<float, kMachFloat32, USE_RESULT_BUFFER> {
+ public:
+ explicit Float32BinopTester(RawMachineAssemblerTester<int32_t>* tester)
+ : BinopTester<float, kMachFloat32, USE_RESULT_BUFFER>(tester) {}
+};
+
+
// A helper class for testing code sequences that take two double parameters and
// return a double value.
// TODO(titzer): figure out how to return doubles correctly on ia32.
@@ -334,6 +345,14 @@ class Int32BinopInputShapeTester {
};
// TODO(bmeurer): Drop this crap once we switch to GTest/Gmock.
+static inline void CheckFloatEq(volatile float x, volatile float y) {
+ if (std::isnan(x)) {
+ CHECK(std::isnan(y));
+ } else {
+ CHECK(x == y);
+ }
+}
+
static inline void CheckDoubleEq(volatile double x, volatile double y) {
if (std::isnan(x)) {
CHECK(std::isnan(y));

Powered by Google App Engine
This is Rietveld 408576698