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

Side by Side Diff: tests_lit/llvm2ice_tests/randomize-pool-immediate-basic.ll

Issue 1185703004: Add constant blinding/pooling option for X8632 code translation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: change the default sz-seed back to 1. 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 | « src/IceTargetLoweringX8632.cpp ('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
(Empty)
1 ; This is a smoke test of constant blinding and constant pooling.
2
3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
4 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \
5 ; RUN: -randomize-pool-threshold=0x1 \
6 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2
7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
8 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \
9 ; RUN: -randomize-pool-threshold=0x1 \
10 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1
11
12 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
13 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \
14 ; RUN: -randomize-pool-threshold=0x1 \
15 ; RUN: | FileCheck %s --check-prefix=POOLING
16 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
17 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \
18 ; RUN: -randomize-pool-threshold=0x1 \
19 ; RUN: | FileCheck %s --check-prefix=POOLING
20
21
22 define i32 @add_arg_plus_200000(i32 %arg) {
23 entry:
24 %res = add i32 200000, %arg
25 ret i32 %res
26
27 ; BLINDINGO2-LABEL: add_arg_plus_200000
28 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x34ee7
29 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x41a7{{[]]}}
30
31 ; BLINDINGOM1-LABEL: add_arg_plus_200000
32 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x34ee7
33 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x41a7{{[]]}}
34
35 ; POOLING-LABEL: add_arg_plus_200000
36 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0- 9]*}}
37 }
38
39 define float @load_arg_plus_200000(float* %arg) {
40 entry:
41 %arg.int = ptrtoint float* %arg to i32
42 %addr.int = add i32 %arg.int, 200000
43 %addr.ptr = inttoptr i32 %addr.int to float*
44 %addr.load = load float, float* %addr.ptr, align 4
45 ret float %addr.load
46 ; BLINDINGO2-LABEL: load_arg_plus_200000
47 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x34ee7{{[]]}}
48
49 ; BLINDINGOM1-LABEL: load_arg_plus_200000
50 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x41a7{{[]]}}
51
52 ; POOLING-LABEL: load_arg_plus_200000
53 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0- 9]*}}
54 }
55
56 define i64 @add_arg_plus_64bits(i32 %arg) {
57 entry:
58 %0 = sext i32 %arg to i64
59 %res = add i64 90000000000, %0
60 ret i64 %res
61
62 ; BLINDINGO2-LABEL: add_arg_plus_64bits
63 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f
64 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0xf46b45a7
65 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x41a7{{[]]}}
66
67 ; BLINDINGOM1-LABEL: add_arg_plus_64bits
68 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f
69 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0xf46b45a7
70 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x41a7{{[]]}}
71
72 ; POOLING-LABEL: add_arg_plus_64bits
73 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0- 9]*}}
74 }
75
76 define i64 @load_arg_plus_64bits(i64* %arg) {
77 entry:
78 %arg.int = ptrtoint i64* %arg to i32
79 %arg.new = add i32 %arg.int, 90000
80 %arg.ptr = inttoptr i32 %arg.new to i64*
81 %arg.load = load i64, i64* %arg.ptr, align 1
82 ret i64 %arg.load
83
84 ; BLINDINGO2-LABEL: load_arg_plus_64bits
85 ; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x1a137{{[]]}}
86 ; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
87
88 ; BLINDINGOM1-LABEL: load_arg_plus_64bits
89 ; BLINDINGOM1: mov e{{[a-z]*}},0x1a137
90 ; BLINDINGOM1-NEXT: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
91
92 ; POOLING-LABEL: load_arg_plus_64bits
93 ; POOLING: mov e{{[a-z]x}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0- 9]*}}
94 }
95
96 define internal i32 @add_const_8bits(i32 %a) {
97 entry:
98 %a_8 = trunc i32 %a to i8
99 %add = add i8 %a_8, 123
100 %ret = zext i8 %add to i32
101 ret i32 %ret
102
103 ; BLINDINGO2-LABEL: add_const_8bits
104 ; BLINDINGO2: mov e{{[a-z]*}},0x4222
105 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
106
107 ; BLINDINGOM1-LABEL: add_const_8bits
108 ; BLINDINGOM1: mov e{{[a-z]*}},0x4222
109 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
110
111 ; POOLING-LABEL: add_const_8bits
112 ; POOLING: mov {{[a-z]l}},BYTE PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i8${{[0-9]* }}
113 }
114
115 define internal i32 @add_const_16bits(i32 %a) {
116 entry:
117 %a_16 = trunc i32 %a to i16
118 %add = add i16 %a_16, 32766
119 %ret = zext i16 %add to i32
120 ret i32 %ret
121
122 ; BLINDINGO2-LABEL: add_const_16bits
123 ; BLINDINGO2: mov e{{[a-z]*}},0xc1a5
124 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
125
126 ; BLINDINGOM1-LABEL: add_const_16bits
127 ; BLINDINGOM1: mov e{{[a-z]*}},0xc1a5
128 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x41a7{{[]]}}
129
130 ; POOLING-LABEL: add_const_16bits
131 ; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16${{[0-9] *}}
132
133 }
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698