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

Side by Side Diff: tests_lit/llvm2ice_tests/shift.ll

Issue 1339603006: Subzero: Generate correct code for shifts by a large immediate. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change comment Created 5 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 unified diff | Download patch
« no previous file with comments | « src/IceAssemblerX86BaseImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This is a test of C-level conversion operations that clang lowers 1 ; This is a test of C-level conversion operations that clang lowers
2 ; into pairs of shifts. 2 ; into pairs of shifts.
3 3
4 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 4 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
5 ; RUN: --target x8632 -i %s --args -O2 \ 5 ; RUN: --target x8632 -i %s --args -O2 \
6 ; RUN: | %if --need=target_X8632 --command FileCheck %s 6 ; RUN: | %if --need=target_X8632 --command FileCheck %s
7 7
8 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 8 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
9 ; RUN: --target x8632 -i %s --args -Om1 \ 9 ; RUN: --target x8632 -i %s --args -Om1 \
10 ; RUN: | %if --need=target_X8632 --command FileCheck %s 10 ; RUN: | %if --need=target_X8632 --command FileCheck %s
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 store i32 %v1, i32* %__4, align 1 57 store i32 %v1, i32* %__4, align 1
58 ret void 58 ret void
59 } 59 }
60 ; CHECK-LABEL: conv2 60 ; CHECK-LABEL: conv2
61 ; CHECK: shl {{.*}},0x10 61 ; CHECK: shl {{.*}},0x10
62 ; CHECK: shr {{.*}},0x10 62 ; CHECK: shr {{.*}},0x10
63 63
64 ; ARM32-LABEL: conv2 64 ; ARM32-LABEL: conv2
65 ; ARM32: lsl {{.*}}, #16 65 ; ARM32: lsl {{.*}}, #16
66 ; ARM32: lsr {{.*}}, #16 66 ; ARM32: lsr {{.*}}, #16
67
68 define i32 @shlImmLarge(i32 %val) {
69 entry:
70 %result = shl i32 %val, 257
71 ret i32 %result
72 }
73 ; CHECK-LABEL: shlImmLarge
74 ; CHECK: shl {{.*}},0x1
75
76 define i32 @shlImmNeg(i32 %val) {
77 entry:
78 %result = shl i32 %val, -1
79 ret i32 %result
80 }
81 ; CHECK-LABEL: shlImmNeg
82 ; CHECK: shl {{.*}},0xff
83
84 define i32 @lshrImmLarge(i32 %val) {
85 entry:
86 %result = lshr i32 %val, 257
87 ret i32 %result
88 }
89 ; CHECK-LABEL: lshrImmLarge
90 ; CHECK: shr {{.*}},0x1
91
92 define i32 @lshrImmNeg(i32 %val) {
93 entry:
94 %result = lshr i32 %val, -1
95 ret i32 %result
96 }
97 ; CHECK-LABEL: lshrImmNeg
98 ; CHECK: shr {{.*}},0xff
99
100 define i32 @ashrImmLarge(i32 %val) {
101 entry:
102 %result = ashr i32 %val, 257
103 ret i32 %result
104 }
105 ; CHECK-LABEL: ashrImmLarge
106 ; CHECK: sar {{.*}},0x1
107
108 define i32 @ashrImmNeg(i32 %val) {
109 entry:
110 %result = ashr i32 %val, -1
111 ret i32 %result
112 }
113 ; CHECK-LABEL: ashrImmNeg
114 ; CHECK: sar {{.*}},0xff
OLDNEW
« no previous file with comments | « src/IceAssemblerX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698