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

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: Add isZero utility function, fix comments. 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
« no previous file with comments | « crosstest/test_icmp.h ('k') | crosstest/test_icmp_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/test_icmp.cpp
diff --git a/crosstest/test_icmp.cpp b/crosstest/test_icmp.cpp
index 60575450a13b4f26bddc682ea5484a480c315833..0b1d1aaa7547010c73d8162e55c32904dd4efb0d 100644
--- a/crosstest/test_icmp.cpp
+++ b/crosstest/test_icmp.cpp
@@ -24,7 +24,11 @@
bool icmp##cmp(uint64 a, uint64 b) { return a op b; } \
v4ui32 icmp##cmp(v4ui32 a, v4ui32 b) { return a op b; } \
v8ui16 icmp##cmp(v8ui16 a, v8ui16 b) { return a op b; } \
- v16ui8 icmp##cmp(v16ui8 a, v16ui8 b) { return a op b; }
+ v16ui8 icmp##cmp(v16ui8 a, v16ui8 b) { return a op b; } \
+ bool icmp_zero##cmp(uint8_t a) { return a op 0; } \
+ 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
@@ -35,6 +39,10 @@ ICMP_U_TABLE
bool icmp##cmp(int64 a, int64 b) { return a op b; } \
v4si32 icmp##cmp(v4si32 a, v4si32 b) { return a op b; } \
v8si16 icmp##cmp(v8si16 a, v8si16 b) { return a op b; } \
- v16si8 icmp##cmp(v16si8 a, v16si8 b) { return a op b; }
+ v16si8 icmp##cmp(v16si8 a, v16si8 b) { return a op b; } \
+ 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
« no previous file with comments | « crosstest/test_icmp.h ('k') | crosstest/test_icmp_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698