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

Unified Diff: test/cctest/test-assembler-arm.cc

Issue 2628153003: [ARM] Add tolerance to vrecpe, vrsqrte instruction tests. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-arm.cc
diff --git a/test/cctest/test-assembler-arm.cc b/test/cctest/test-assembler-arm.cc
index 274ff0c12bbe790751641dc65e22bc045ff86e10..a60710f7c9c5a737e52e51402c4cfb18a261ad88 100644
--- a/test/cctest/test-assembler-arm.cc
+++ b/test/cctest/test-assembler-arm.cc
@@ -1233,6 +1233,16 @@ TEST(14) {
CHECK_EQ(ex2, t.field[2]); \
CHECK_EQ(ex3, t.field[3]);
+#define CHECK_ESTIMATE(expected, tolerance, value) \
+ CHECK_LT((expected) - (tolerance), value); \
+ CHECK_GT((expected) + (tolerance), value);
+
+#define CHECK_ESTIMATE_SPLAT(field, ex, tol) \
+ CHECK_ESTIMATE(ex, tol, t.field[0]); \
+ CHECK_ESTIMATE(ex, tol, t.field[1]); \
+ CHECK_ESTIMATE(ex, tol, t.field[2]); \
+ CHECK_ESTIMATE(ex, tol, t.field[3]);
+
#define INT32_TO_FLOAT(val) \
std::round(static_cast<float>(bit_cast<int32_t>(val)))
#define UINT32_TO_FLOAT(val) \
@@ -1822,9 +1832,9 @@ TEST(15) {
CHECK_EQ_SPLAT(vaddf, 2.0);
CHECK_EQ_SPLAT(vsubf, -1.0);
CHECK_EQ_SPLAT(vmulf, 4.0);
- CHECK_EQ_SPLAT(vrecpe, 0.5f); // 1 / 2
+ CHECK_ESTIMATE_SPLAT(vrecpe, 0.5f, 0.1f); // 1 / 2
CHECK_EQ_SPLAT(vrecps, -1.0f); // 2 - (2 * 1.5)
- CHECK_EQ_SPLAT(vrsqrte, 0.5f); // 1 / sqrt(4)
+ CHECK_ESTIMATE_SPLAT(vrsqrte, 0.5f, 0.1f); // 1 / sqrt(4)
CHECK_EQ_SPLAT(vrsqrts, -1.0f); // (3 - (2 * 2.5)) / 2
CHECK_EQ_SPLAT(vceqf, 0xffffffffu);
// [0] >= [-1, 1, -0, 0]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698