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

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: reformat 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
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=co nstant-blinding \
5 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2
6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
7 ; RUN: -sz-seed=1 -randomize-pool-immediates=co nstant-blinding \
8 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1
9
10 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
11 ; RUN: -sz-seed=1 -randomize-pool-immediates=co nstant-pooling \
12 ; RUN: | FileCheck %s --check-prefix=POOLING
13 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
14 ; RUN: -sz-seed=1 -randomize-pool-immediates=co nstant-pooling \
15 ; RUN: | FileCheck %s --check-prefix=POOLING
16
17
18 define i32 @add_arg_plus_200000(i32 %arg) {
19 entry:
20 %res = add i32 200000, %arg
21 ret i32 %res
22
23 ; BLINDINGO2-LABEL: add_arg_plus_200000
24 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x34ee7
25 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x41a7{{[]]}}
26
27 ; BLINDINGOM1-LABEL: add_arg_plus_200000
28 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x34ee7
29 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x41a7{{[]]}}
30
31 ; POOLING-LABEL: add_arg_plus_200000
32 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9]*[a-f]*}}: R_386_32 .L$i32${{ [0-9]*}}
33 }
34
35 define float @load_arg_plus_200000(float* %arg) {
36 entry:
37 %arg.int = ptrtoint float* %arg to i32
38 %addr.int = add i32 %arg.int, 200000
39 %addr.ptr = inttoptr i32 %addr.int to float*
40 %addr.load = load float, float* %addr.ptr, align 4
41 ret float %addr.load
42 ; BLINDINGO2-LABEL: load_arg_plus_200000
43 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x34ee7{{[]]}}
44
45 ; BLINDINGOM1-LABEL: load_arg_plus_200000
46 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x41a7{{[]]}}
47
48 ; POOLING-LABEL: load_arg_plus_200000
49 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9]*[a-f]*}}: R_386_32 .L$i32${{ [0-9]*}}
50 }
51
52 define i64 @add_arg_plus_64bits(i32 %arg) {
53 entry:
54 %0 = sext i32 %arg to i64
55 %res = add i64 90000000000, %0
56 ret i64 %res
57
58 ; BLINDINGO2-LABEL: add_arg_plus_64bits
59 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f
60 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0xf46b45a7
61 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x41a7{{[]]}}
62
63 ; BLINDINGOM1-LABEL: add_arg_plus_64bits
64 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f
65 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0xf46b45a7
66 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x41a7{{[]]}}
67
68 ; POOLING-LABEL: add_arg_plus_64bits
69 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9]*[a-f]*}}: R_386_32 .L$i32${{ [0-9]*}}
70 }
OLDNEW
« src/IceTargetLoweringX8632.cpp ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698