OLD | NEW |
1 ; This tests each of the supported NaCl atomic instructions for every | 1 ; This tests each of the supported NaCl atomic instructions for every |
2 ; size allowed. | 2 ; size allowed. |
3 | 3 |
4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
5 ; RUN: | FileCheck %s | 5 ; RUN: | FileCheck %s |
6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
7 ; RUN: | FileCheck --check-prefix=O2 %s | 7 ; RUN: | FileCheck --check-prefix=O2 %s |
8 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 8 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
9 ; RUN: | FileCheck %s | 9 ; RUN: | FileCheck %s |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ; CHECK: movq x{{.*}},QWORD | 88 ; CHECK: movq x{{.*}},QWORD |
89 ; CHECK: movq QWORD {{.*}},x{{.*}} | 89 ; CHECK: movq QWORD {{.*}},x{{.*}} |
90 | 90 |
91 define i32 @test_atomic_load_32_with_arith(i32 %iptr) { | 91 define i32 @test_atomic_load_32_with_arith(i32 %iptr) { |
92 entry: | 92 entry: |
93 br label %next | 93 br label %next |
94 | 94 |
95 next: | 95 next: |
96 %ptr = inttoptr i32 %iptr to i32* | 96 %ptr = inttoptr i32 %iptr to i32* |
97 %r = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 6) | 97 %r = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 6) |
98 %r2 = add i32 %r, 32 | 98 %r2 = sub i32 32, %r |
99 ret i32 %r2 | 99 ret i32 %r2 |
100 } | 100 } |
101 ; CHECK-LABEL: test_atomic_load_32_with_arith | 101 ; CHECK-LABEL: test_atomic_load_32_with_arith |
102 ; CHECK: mov {{.*}},DWORD | 102 ; CHECK: mov {{.*}},DWORD |
103 ; The next instruction may be a separate load or folded into an add. | 103 ; The next instruction may be a separate load or folded into an add. |
104 ; | 104 ; |
105 ; In O2 mode, we know that the load and add are going to be fused. | 105 ; In O2 mode, we know that the load and sub are going to be fused. |
106 ; O2-LABEL: test_atomic_load_32_with_arith | 106 ; O2-LABEL: test_atomic_load_32_with_arith |
107 ; O2: mov {{.*}},DWORD | 107 ; O2: mov {{.*}},DWORD |
108 ; O2: add {{.*}},DWORD | 108 ; O2: sub {{.*}},DWORD |
109 | 109 |
110 define i32 @test_atomic_load_32_ignored(i32 %iptr) { | 110 define i32 @test_atomic_load_32_ignored(i32 %iptr) { |
111 entry: | 111 entry: |
112 %ptr = inttoptr i32 %iptr to i32* | 112 %ptr = inttoptr i32 %iptr to i32* |
113 %ignored = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 6) | 113 %ignored = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 6) |
114 ret i32 0 | 114 ret i32 0 |
115 } | 115 } |
116 ; CHECK-LABEL: test_atomic_load_32_ignored | 116 ; CHECK-LABEL: test_atomic_load_32_ignored |
117 ; CHECK: mov {{.*}},DWORD | 117 ; CHECK: mov {{.*}},DWORD |
118 ; CHECK: mov {{.*}},DWORD | 118 ; CHECK: mov {{.*}},DWORD |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 br i1 %cmp, label %done, label %body | 1002 br i1 %cmp, label %done, label %body |
1003 done: | 1003 done: |
1004 ret void | 1004 ret void |
1005 } | 1005 } |
1006 ; O2-LABEL: test_cmpxchg8b_regalloc | 1006 ; O2-LABEL: test_cmpxchg8b_regalloc |
1007 ;;; eax and some other register will be used in the cmpxchg instruction. | 1007 ;;; eax and some other register will be used in the cmpxchg instruction. |
1008 ; O2: lock cmpxchg8b QWORD PTR | 1008 ; O2: lock cmpxchg8b QWORD PTR |
1009 ;;; Make sure eax/ecx/edx/ebx aren't used again, e.g. as the induction variable. | 1009 ;;; Make sure eax/ecx/edx/ebx aren't used again, e.g. as the induction variable. |
1010 ; O2-NOT: {{eax|ecx|edx|ebx}} | 1010 ; O2-NOT: {{eax|ecx|edx|ebx}} |
1011 ; O2: pop ebx | 1011 ; O2: pop ebx |
OLD | NEW |