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

Side by Side 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 unified diff | Download patch
OLDNEW
1 //===- subzero/crosstest/test_icmp.cpp - Implementation for tests ---------===// 1 //===- subzero/crosstest/test_icmp.cpp - Implementation for tests ---------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This aims to test the icmp bitcode instruction across all PNaCl primitive 10 // This aims to test the icmp bitcode instruction across all PNaCl primitive
(...skipping 11 matching lines...) Expand all
22 bool icmp##cmp(uint16_t a, uint16_t b) { return a op b; } \ 22 bool icmp##cmp(uint16_t a, uint16_t b) { return a op b; } \
23 bool icmp##cmp(uint32_t a, uint32_t b) { return a op b; } \ 23 bool icmp##cmp(uint32_t a, uint32_t b) { return a op b; } \
24 bool icmp##cmp(uint64 a, uint64 b) { return a op b; } \ 24 bool icmp##cmp(uint64 a, uint64 b) { return a op b; } \
25 v4ui32 icmp##cmp(v4ui32 a, v4ui32 b) { return a op b; } \ 25 v4ui32 icmp##cmp(v4ui32 a, v4ui32 b) { return a op b; } \
26 v8ui16 icmp##cmp(v8ui16 a, v8ui16 b) { return a op b; } \ 26 v8ui16 icmp##cmp(v8ui16 a, v8ui16 b) { return a op b; } \
27 v16ui8 icmp##cmp(v16ui8 a, v16ui8 b) { return a op b; } 27 v16ui8 icmp##cmp(v16ui8 a, v16ui8 b) { return a op b; }
28 ICMP_U_TABLE 28 ICMP_U_TABLE
29 #undef X 29 #undef X
30 30
31 #define X(cmp, op) \ 31 #define X(cmp, op) \
32 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.
33 bool icmp_zero##cmp(uint16_t a) { return a op 0; } \
34 bool icmp_zero##cmp(uint32_t a) { return a op 0; } \
35 bool icmp_zero##cmp(uint64 a) { return a op 0; }
36 ICMP_U_TABLE
37 #undef X
38
39 #define X(cmp, op) \
32 bool icmp##cmp(myint8_t a, myint8_t b) { return a op b; } \ 40 bool icmp##cmp(myint8_t a, myint8_t b) { return a op b; } \
33 bool icmp##cmp(int16_t a, int16_t b) { return a op b; } \ 41 bool icmp##cmp(int16_t a, int16_t b) { return a op b; } \
34 bool icmp##cmp(int32_t a, int32_t b) { return a op b; } \ 42 bool icmp##cmp(int32_t a, int32_t b) { return a op b; } \
35 bool icmp##cmp(int64 a, int64 b) { return a op b; } \ 43 bool icmp##cmp(int64 a, int64 b) { return a op b; } \
36 v4si32 icmp##cmp(v4si32 a, v4si32 b) { return a op b; } \ 44 v4si32 icmp##cmp(v4si32 a, v4si32 b) { return a op b; } \
37 v8si16 icmp##cmp(v8si16 a, v8si16 b) { return a op b; } \ 45 v8si16 icmp##cmp(v8si16 a, v8si16 b) { return a op b; } \
38 v16si8 icmp##cmp(v16si8 a, v16si8 b) { return a op b; } 46 v16si8 icmp##cmp(v16si8 a, v16si8 b) { return a op b; }
39 ICMP_S_TABLE 47 ICMP_S_TABLE
40 #undef X 48 #undef X
49
50 #define X(cmp, op) \
51 bool icmp_zero##cmp(myint8_t a) { return a op 0; } \
52 bool icmp_zero##cmp(int16_t a) { return a op 0; } \
53 bool icmp_zero##cmp(int32_t a) { return a op 0; } \
54 bool icmp_zero##cmp(int64 a) { return a op 0; }
55 ICMP_S_TABLE
56 #undef X
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698