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

Unified Diff: crosstest/test_bitmanip.cpp

Issue 595093002: Handle "inplace" ops and unary ops w/ assembler (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: format Created 6 years, 3 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_bitmanip.h ('k') | crosstest/test_bitmanip_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/test_bitmanip.cpp
diff --git a/crosstest/test_bitmanip.cpp b/crosstest/test_bitmanip.cpp
index 7106767b305cc7df00774441e06c91e663eba91e..181286e492d88ede1c02e110dee74695899024b1 100644
--- a/crosstest/test_bitmanip.cpp
+++ b/crosstest/test_bitmanip.cpp
@@ -40,6 +40,18 @@ FOR_ALL_BMI_OP_TYPES(X)
#undef X
#define X(type, builtin_name) \
- type test_bswap(type a) { return builtin_name(a); }
+ type test_bswap(type a) { return builtin_name(a); } \
+ type test_bswap_alloca(type a) { \
+ const size_t buf_size = 8; \
+ type buf[buf_size]; \
+ for (size_t i = 0; i < buf_size; ++i) { \
+ buf[i] = builtin_name(a * i) + builtin_name(a + i); \
+ } \
+ type sum = 0; \
+ for (size_t i = 0; i < buf_size; ++i) { \
+ sum += buf[i]; \
+ } \
+ return sum; \
+ }
BSWAP_TABLE
#undef X
« no previous file with comments | « crosstest/test_bitmanip.h ('k') | crosstest/test_bitmanip_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698