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

Side by Side Diff: tests_lit/assembler/x86/sandboxing.ll

Issue 1125323004: Subzero: Use cmov to improve lowering for the select instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove a rogue comment Created 5 years, 7 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/assembler_ia32.cpp ('k') | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; Tests basics and corner cases of x86-32 sandboxing, using -Om1 in 1 ; Tests basics and corner cases of x86-32 sandboxing, using -Om1 in
2 ; the hope that the output will remain stable. When packing bundles, 2 ; the hope that the output will remain stable. When packing bundles,
3 ; we try to limit to a few instructions with well known sizes and 3 ; we try to limit to a few instructions with well known sizes and
4 ; minimal use of registers and stack slots in the lowering sequence. 4 ; minimal use of registers and stack slots in the lowering sequence.
5 5
6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
7 ; RUN: -ffunction-sections -sandbox | FileCheck %s 7 ; RUN: -ffunction-sections -sandbox | FileCheck %s
8 8
9 declare void @call_target() 9 declare void @call_target()
10 @global_byte = internal global [1 x i8] zeroinitializer 10 @global_byte = internal global [1 x i8] zeroinitializer
11 @global_short = internal global [2 x i8] zeroinitializer 11 @global_short = internal global [2 x i8] zeroinitializer
12 @global_int = internal global [4 x i8] zeroinitializer
12 13
13 ; A direct call sequence uses the right mask and register-call sequence. 14 ; A direct call sequence uses the right mask and register-call sequence.
14 define void @test_direct_call() { 15 define void @test_direct_call() {
15 entry: 16 entry:
16 call void @call_target() 17 call void @call_target()
17 ret void 18 ret void
18 } 19 }
19 ; CHECK-LABEL: test_direct_call 20 ; CHECK-LABEL: test_direct_call
20 ; CHECK: nop 21 ; CHECK: nop
21 ; CHECK: 1b: {{.*}} call 1c 22 ; CHECK: 1b: {{.*}} call 1c
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ; CHECK-LABEL: nonpacked_bundle 88 ; CHECK-LABEL: nonpacked_bundle
88 ; CHECK: call 89 ; CHECK: call
89 ; CHECK-NEXT: 20: {{.*}} mov WORD PTR 90 ; CHECK-NEXT: 20: {{.*}} mov WORD PTR
90 ; CHECK-NEXT: 29: {{.*}} mov WORD PTR 91 ; CHECK-NEXT: 29: {{.*}} mov WORD PTR
91 ; CHECK-NEXT: 32: {{.*}} mov WORD PTR 92 ; CHECK-NEXT: 32: {{.*}} mov WORD PTR
92 ; CHECK-NEXT: 3b: {{.*}} nop 93 ; CHECK-NEXT: 3b: {{.*}} nop
93 ; CHECK: 40: {{.*}} mov WORD PTR 94 ; CHECK: 40: {{.*}} mov WORD PTR
94 95
95 ; A zero-byte instruction (e.g. local label definition) at a bundle 96 ; A zero-byte instruction (e.g. local label definition) at a bundle
96 ; boundary should not trigger nop padding. 97 ; boundary should not trigger nop padding.
97 define void @label_at_boundary(i32 %arg) { 98 define void @label_at_boundary(i32 %arg, float %farg1, float %farg2) {
98 entry: 99 entry:
99 %cmp = icmp eq i32 %arg, 0 100 %argi8 = trunc i32 %arg to i8
100 call void @call_target() 101 call void @call_target()
101 ; bundle boundary 102 ; bundle boundary
102 %addr_short = bitcast [2 x i8]* @global_short to i16* 103 %addr_short = bitcast [2 x i8]* @global_short to i16*
103 store i16 0, i16* %addr_short, align 1 ; 9-byte instruction 104 %addr_int = bitcast [4 x i8]* @global_int to i32*
104 %blah = select i1 %cmp, i32 3, i32 5 ; 23-byte lowering sequence 105 store i32 0, i32* %addr_int, align 1 ; 10-byte instruction
106 %blah = select i1 true, i8 %argi8, i8 %argi8 ; 22-byte lowering sequence
105 ; label is here 107 ; label is here
106 store i16 0, i16* %addr_short, align 1 ; 9-byte instruction 108 store i16 0, i16* %addr_short, align 1 ; 9-byte instruction
107 ret void 109 ret void
108 } 110 }
109 ; CHECK-LABEL: label_at_boundary 111 ; CHECK-LABEL: label_at_boundary
110 ; CHECK: call 112 ; CHECK: call
111 ; We rely on the hideous 4-instruction 23-byte Om1 lowering sequence for select. 113 ; We rely on a particular 7-instruction 22-byte Om1 lowering sequence
112 ; CHECK-NEXT: 20: {{.*}} mov WORD PTR 114 ; for select.
113 ; CHECK-NEXT: 29: {{.*}} cmp BYTE PTR 115 ; CHECK-NEXT: 20: {{.*}} mov DWORD PTR
114 ; CHECK-NEXT: 2e: {{.*}} mov DWORD PTR 116 ; CHECK-NEXT: 2a: {{.*}} mov {{.*}},0x1
117 ; CHECK-NEXT: 2c: {{.*}} cmp {{.*}},0x0
118 ; CHECK-NEXT: 2e: {{.*}} mov {{.*}},BYTE PTR
119 ; CHECK-NEXT: 32: {{.*}} mov BYTE PTR
115 ; CHECK-NEXT: 36: {{.*}} jne 40 120 ; CHECK-NEXT: 36: {{.*}} jne 40
116 ; CHECK-NEXT: 38: {{.*}} mov DWORD PTR 121 ; CHECK-NEXT: 38: {{.*}} mov {{.*}},BYTE PTR
122 ; CHECK-NEXT: 3c: {{.*}} mov BYTE PTR
117 ; CHECK-NEXT: 40: {{.*}} mov WORD PTR 123 ; CHECK-NEXT: 40: {{.*}} mov WORD PTR
118 124
119 ; Bundle lock without padding. 125 ; Bundle lock without padding.
120 define void @bundle_lock_without_padding() { 126 define void @bundle_lock_without_padding() {
121 entry: 127 entry:
122 %addr_short = bitcast [2 x i8]* @global_short to i16* 128 %addr_short = bitcast [2 x i8]* @global_short to i16*
123 store i16 0, i16* %addr_short, align 1 ; 9-byte instruction 129 store i16 0, i16* %addr_short, align 1 ; 9-byte instruction
124 ret void 130 ret void
125 } 131 }
126 ; CHECK-LABEL: bundle_lock_without_padding 132 ; CHECK-LABEL: bundle_lock_without_padding
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 ret void 250 ret void
245 } 251 }
246 ; CHECK-LABEL: checkpoint_restore_stack_adjustment 252 ; CHECK-LABEL: checkpoint_restore_stack_adjustment
247 ; CHECK: call 253 ; CHECK: call
248 ; CHECK: sub esp,0x10 254 ; CHECK: sub esp,0x10
249 ; The address of %arg should be [esp+0x20], not [esp+0x30]. 255 ; The address of %arg should be [esp+0x20], not [esp+0x30].
250 ; CHECK-NEXT: mov [[REG:.*]],DWORD PTR [esp+0x20] 256 ; CHECK-NEXT: mov [[REG:.*]],DWORD PTR [esp+0x20]
251 ; CHECK-NEXT: mov DWORD PTR [esp],[[REG]] 257 ; CHECK-NEXT: mov DWORD PTR [esp],[[REG]]
252 ; CHECK: call 258 ; CHECK: call
253 ; CHECK: add esp,0x10 259 ; CHECK: add esp,0x10
OLDNEW
« no previous file with comments | « src/assembler_ia32.cpp ('k') | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698