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

Side by Side Diff: crosstest/test_strengthreduce.cpp

Issue 1146803002: Subzero: Strength-reduce mul by certain constants. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove a TODO Created 5 years, 6 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
« no previous file with comments | « crosstest/test_strengthreduce.h ('k') | crosstest/test_strengthreduce.def » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 //===- subzero/crosstest/test_strengthreduce.cpp - Strength reduction -----===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Implementation for crosstesting strength reduction.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "test_strengthreduce.h"
15
16 // TODO(stichnot): Extend to i16 and i8 types, and also test the
17 // commutativity transformations. This may require hand-generating
18 // .ll files, because of C/C++ integer promotion rules for arithmetic,
19 // and because clang prefers to do its own commutativity
20 // transformation.
21
22 #define X(constant, suffix) \
23 uint32_t multiplyByConst##suffix(uint32_t Val) { \
24 return Val * (uint32_t)constant; \
25 } \
26 int32_t multiplyByConst##suffix(int32_t Val) { \
27 return Val * (int32_t)constant; \
28 }
29 CONST_TABLE
30 #undef X
OLDNEW
« no previous file with comments | « crosstest/test_strengthreduce.h ('k') | crosstest/test_strengthreduce.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698