| OLD | NEW |
| 1 ; This tests the NaCl intrinsics not related to atomic operations. | 1 ; This tests the NaCl intrinsics not related to atomic operations. |
| 2 | 2 |
| 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 4 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ | 4 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ |
| 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
| 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
| 7 ; RUN: --target x8632 -i %s --args -Om1 -sandbox \ | 7 ; RUN: --target x8632 -i %s --args -Om1 -sandbox \ |
| 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
| 9 | 9 |
| 10 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 | 10 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 %r = call float @llvm.sqrt.f32(float %x) | 143 %r = call float @llvm.sqrt.f32(float %x) |
| 144 %r2 = call float @llvm.sqrt.f32(float %r) | 144 %r2 = call float @llvm.sqrt.f32(float %r) |
| 145 %r3 = call float @llvm.sqrt.f32(float -0.0) | 145 %r3 = call float @llvm.sqrt.f32(float -0.0) |
| 146 %r4 = fadd float %r2, %r3 | 146 %r4 = fadd float %r2, %r3 |
| 147 ret float %r4 | 147 ret float %r4 |
| 148 } | 148 } |
| 149 ; CHECK-LABEL: test_sqrt_float | 149 ; CHECK-LABEL: test_sqrt_float |
| 150 ; CHECK: sqrtss xmm{{.*}} | 150 ; CHECK: sqrtss xmm{{.*}} |
| 151 ; CHECK: sqrtss xmm{{.*}} | 151 ; CHECK: sqrtss xmm{{.*}} |
| 152 ; CHECK: sqrtss xmm{{.*}},DWORD PTR | 152 ; CHECK: sqrtss xmm{{.*}},DWORD PTR |
| 153 ; ARM32-LABEL: test_sqrt_float |
| 154 ; ARM32: vsqrt.f32 |
| 155 ; ARM32: vsqrt.f32 |
| 156 ; ARM32: vsqrt.f32 |
| 157 ; ARM32: vadd.f32 |
| 153 | 158 |
| 154 define float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { | 159 define float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { |
| 155 entry: | 160 entry: |
| 156 %__2 = inttoptr i32 %iptr to float* | 161 %__2 = inttoptr i32 %iptr to float* |
| 157 %y = load float, float* %__2, align 4 | 162 %y = load float, float* %__2, align 4 |
| 158 %r5 = call float @llvm.sqrt.f32(float %y) | 163 %r5 = call float @llvm.sqrt.f32(float %y) |
| 159 %r6 = fadd float %x, %r5 | 164 %r6 = fadd float %x, %r5 |
| 160 ret float %r6 | 165 ret float %r6 |
| 161 } | 166 } |
| 162 ; CHECK-LABEL: test_sqrt_float_mergeable_load | 167 ; CHECK-LABEL: test_sqrt_float_mergeable_load |
| 163 ; We could fold the load and the sqrt into one operation, but the | 168 ; We could fold the load and the sqrt into one operation, but the |
| 164 ; current folding only handles load + arithmetic op. The sqrt inst | 169 ; current folding only handles load + arithmetic op. The sqrt inst |
| 165 ; is considered an intrinsic call and not an arithmetic op. | 170 ; is considered an intrinsic call and not an arithmetic op. |
| 166 ; CHECK: sqrtss xmm{{.*}} | 171 ; CHECK: sqrtss xmm{{.*}} |
| 172 ; ARM32-LABEL: test_sqrt_float_mergeable_load |
| 173 ; ARM32: vldr s{{.*}} |
| 174 ; ARM32: vsqrt.f32 |
| 167 | 175 |
| 168 define double @test_sqrt_double(double %x, i32 %iptr) { | 176 define double @test_sqrt_double(double %x, i32 %iptr) { |
| 169 entry: | 177 entry: |
| 170 %r = call double @llvm.sqrt.f64(double %x) | 178 %r = call double @llvm.sqrt.f64(double %x) |
| 171 %r2 = call double @llvm.sqrt.f64(double %r) | 179 %r2 = call double @llvm.sqrt.f64(double %r) |
| 172 %r3 = call double @llvm.sqrt.f64(double -0.0) | 180 %r3 = call double @llvm.sqrt.f64(double -0.0) |
| 173 %r4 = fadd double %r2, %r3 | 181 %r4 = fadd double %r2, %r3 |
| 174 ret double %r4 | 182 ret double %r4 |
| 175 } | 183 } |
| 176 ; CHECK-LABEL: test_sqrt_double | 184 ; CHECK-LABEL: test_sqrt_double |
| 177 ; CHECK: sqrtsd xmm{{.*}} | 185 ; CHECK: sqrtsd xmm{{.*}} |
| 178 ; CHECK: sqrtsd xmm{{.*}} | 186 ; CHECK: sqrtsd xmm{{.*}} |
| 179 ; CHECK: sqrtsd xmm{{.*}},QWORD PTR | 187 ; CHECK: sqrtsd xmm{{.*}},QWORD PTR |
| 188 ; ARM32-LABEL: test_sqrt_double |
| 189 ; ARM32: vsqrt.f64 |
| 190 ; ARM32: vsqrt.f64 |
| 191 ; ARM32: vsqrt.f64 |
| 192 ; ARM32: vadd.f64 |
| 180 | 193 |
| 181 define double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { | 194 define double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { |
| 182 entry: | 195 entry: |
| 183 %__2 = inttoptr i32 %iptr to double* | 196 %__2 = inttoptr i32 %iptr to double* |
| 184 %y = load double, double* %__2, align 8 | 197 %y = load double, double* %__2, align 8 |
| 185 %r5 = call double @llvm.sqrt.f64(double %y) | 198 %r5 = call double @llvm.sqrt.f64(double %y) |
| 186 %r6 = fadd double %x, %r5 | 199 %r6 = fadd double %x, %r5 |
| 187 ret double %r6 | 200 ret double %r6 |
| 188 } | 201 } |
| 189 ; CHECK-LABEL: test_sqrt_double_mergeable_load | 202 ; CHECK-LABEL: test_sqrt_double_mergeable_load |
| 190 ; CHECK: sqrtsd xmm{{.*}} | 203 ; CHECK: sqrtsd xmm{{.*}} |
| 204 ; ARM32-LABEL: test_sqrt_double_mergeable_load |
| 205 ; ARM32: vldr d{{.*}} |
| 206 ; ARM32: vsqrt.f64 |
| 191 | 207 |
| 192 define float @test_sqrt_ignored(float %x, double %y) { | 208 define float @test_sqrt_ignored(float %x, double %y) { |
| 193 entry: | 209 entry: |
| 194 %ignored1 = call float @llvm.sqrt.f32(float %x) | 210 %ignored1 = call float @llvm.sqrt.f32(float %x) |
| 195 %ignored2 = call double @llvm.sqrt.f64(double %y) | 211 %ignored2 = call double @llvm.sqrt.f64(double %y) |
| 196 ret float 0.0 | 212 ret float 0.0 |
| 197 } | 213 } |
| 198 ; CHECKO2REM-LABEL: test_sqrt_ignored | 214 ; CHECKO2REM-LABEL: test_sqrt_ignored |
| 199 ; CHECKO2REM-NOT: sqrtss | 215 ; CHECKO2REM-NOT: sqrtss |
| 200 ; CHECKO2REM-NOT: sqrtsd | 216 ; CHECKO2REM-NOT: sqrtsd |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 ; At least 3 copies of esp, but probably more from having to do the allocas. | 538 ; At least 3 copies of esp, but probably more from having to do the allocas. |
| 523 ; CHECK: mov {{.*}},esp | 539 ; CHECK: mov {{.*}},esp |
| 524 ; CHECK: mov {{.*}},esp | 540 ; CHECK: mov {{.*}},esp |
| 525 ; CHECK: mov {{.*}},esp | 541 ; CHECK: mov {{.*}},esp |
| 526 ; CHECK: mov esp,{{.*}} | 542 ; CHECK: mov esp,{{.*}} |
| 527 ; ARM32-LABEL: test_stacksave_multiple | 543 ; ARM32-LABEL: test_stacksave_multiple |
| 528 ; ARM32: mov {{.*}}, sp | 544 ; ARM32: mov {{.*}}, sp |
| 529 ; ARM32: mov {{.*}}, sp | 545 ; ARM32: mov {{.*}}, sp |
| 530 ; ARM32: mov {{.*}}, sp | 546 ; ARM32: mov {{.*}}, sp |
| 531 ; ARM32: mov sp, {{.*}} | 547 ; ARM32: mov sp, {{.*}} |
| OLD | NEW |