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

Unified Diff: crosstest/test_icmp.cpp

Issue 1406593003: Optimize 64-bit compares with zero (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Simplify header file Created 5 years, 2 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: crosstest/test_icmp.cpp
diff --git a/crosstest/test_icmp.cpp b/crosstest/test_icmp.cpp
index 60575450a13b4f26bddc682ea5484a480c315833..5e716a94a481d0cd655a8bb9fa25094bf011e687 100644
--- a/crosstest/test_icmp.cpp
+++ b/crosstest/test_icmp.cpp
@@ -29,6 +29,14 @@ ICMP_U_TABLE
#undef X
#define X(cmp, op) \
+ bool icmp_zero##cmp(uint8_t a) { return a op 0; } \
Jim Stichnoth 2015/10/14 18:04:49 Can you just add these to the above list, like it'
sehr 2015/10/15 00:19:34 Done.
+ bool icmp_zero##cmp(uint16_t a) { return a op 0; } \
+ bool icmp_zero##cmp(uint32_t a) { return a op 0; } \
+ bool icmp_zero##cmp(uint64 a) { return a op 0; }
+ICMP_U_TABLE
+#undef X
+
+#define X(cmp, op) \
bool icmp##cmp(myint8_t a, myint8_t b) { return a op b; } \
bool icmp##cmp(int16_t a, int16_t b) { return a op b; } \
bool icmp##cmp(int32_t a, int32_t b) { return a op b; } \
@@ -38,3 +46,11 @@ ICMP_U_TABLE
v16si8 icmp##cmp(v16si8 a, v16si8 b) { return a op b; }
ICMP_S_TABLE
#undef X
+
+#define X(cmp, op) \
+ bool icmp_zero##cmp(myint8_t a) { return a op 0; } \
+ bool icmp_zero##cmp(int16_t a) { return a op 0; } \
+ bool icmp_zero##cmp(int32_t a) { return a op 0; } \
+ bool icmp_zero##cmp(int64 a) { return a op 0; }
+ICMP_S_TABLE
+#undef X

Powered by Google App Engine
This is Rietveld 408576698