| 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: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \ | 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \ |
| 4 ; RUN: | FileCheck %s | 4 ; RUN: | FileCheck %s |
| 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -sandbox \ | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -sandbox \ |
| 6 ; RUN: | FileCheck %s | 6 ; RUN: | FileCheck %s |
| 7 | 7 |
| 8 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 | 8 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 |
| 9 ; share the same "CHECK" prefix). This separate run helps check that | 9 ; share the same "CHECK" prefix). This separate run helps check that |
| 10 ; some code is optimized out. | 10 ; some code is optimized out. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 ; CHECKO2REM: mov e{{.*}},DWORD PTR gs:0x0 | 53 ; CHECKO2REM: mov e{{.*}},DWORD PTR gs:0x0 |
| 54 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp | 54 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp |
| 55 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp | 55 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp |
| 56 | 56 |
| 57 define i32 @test_nacl_read_tp_more_addressing() { | 57 define i32 @test_nacl_read_tp_more_addressing() { |
| 58 entry: | 58 entry: |
| 59 %ptr = call i8* @llvm.nacl.read.tp() | 59 %ptr = call i8* @llvm.nacl.read.tp() |
| 60 %__1 = ptrtoint i8* %ptr to i32 | 60 %__1 = ptrtoint i8* %ptr to i32 |
| 61 %x = add i32 %__1, %__1 | 61 %x = add i32 %__1, %__1 |
| 62 %__3 = inttoptr i32 %x to i32* | 62 %__3 = inttoptr i32 %x to i32* |
| 63 %v = load i32* %__3, align 1 | 63 %v = load i32, i32* %__3, align 1 |
| 64 %v_add = add i32 %v, 1 | 64 %v_add = add i32 %v, 1 |
| 65 | 65 |
| 66 %ptr2 = call i8* @llvm.nacl.read.tp() | 66 %ptr2 = call i8* @llvm.nacl.read.tp() |
| 67 %__6 = ptrtoint i8* %ptr2 to i32 | 67 %__6 = ptrtoint i8* %ptr2 to i32 |
| 68 %y = add i32 %__6, 4 | 68 %y = add i32 %__6, 4 |
| 69 %__8 = inttoptr i32 %y to i32* | 69 %__8 = inttoptr i32 %y to i32* |
| 70 %v_add2 = add i32 %v, 4 | 70 %v_add2 = add i32 %v, 4 |
| 71 store i32 %v_add2, i32* %__8, align 1 | 71 store i32 %v_add2, i32* %__8, align 1 |
| 72 ret i32 %v | 72 ret i32 %v |
| 73 } | 73 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 ret float %r4 | 219 ret float %r4 |
| 220 } | 220 } |
| 221 ; CHECK-LABEL: test_sqrt_float | 221 ; CHECK-LABEL: test_sqrt_float |
| 222 ; CHECK: sqrtss xmm{{.*}} | 222 ; CHECK: sqrtss xmm{{.*}} |
| 223 ; CHECK: sqrtss xmm{{.*}} | 223 ; CHECK: sqrtss xmm{{.*}} |
| 224 ; CHECK: sqrtss xmm{{.*}},DWORD PTR | 224 ; CHECK: sqrtss xmm{{.*}},DWORD PTR |
| 225 | 225 |
| 226 define float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { | 226 define float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { |
| 227 entry: | 227 entry: |
| 228 %__2 = inttoptr i32 %iptr to float* | 228 %__2 = inttoptr i32 %iptr to float* |
| 229 %y = load float* %__2, align 4 | 229 %y = load float, float* %__2, align 4 |
| 230 %r5 = call float @llvm.sqrt.f32(float %y) | 230 %r5 = call float @llvm.sqrt.f32(float %y) |
| 231 %r6 = fadd float %x, %r5 | 231 %r6 = fadd float %x, %r5 |
| 232 ret float %r6 | 232 ret float %r6 |
| 233 } | 233 } |
| 234 ; CHECK-LABEL: test_sqrt_float_mergeable_load | 234 ; CHECK-LABEL: test_sqrt_float_mergeable_load |
| 235 ; We could fold the load and the sqrt into one operation, but the | 235 ; We could fold the load and the sqrt into one operation, but the |
| 236 ; current folding only handles load + arithmetic op. The sqrt inst | 236 ; current folding only handles load + arithmetic op. The sqrt inst |
| 237 ; is considered an intrinsic call and not an arithmetic op. | 237 ; is considered an intrinsic call and not an arithmetic op. |
| 238 ; CHECK: sqrtss xmm{{.*}} | 238 ; CHECK: sqrtss xmm{{.*}} |
| 239 | 239 |
| 240 define double @test_sqrt_double(double %x, i32 %iptr) { | 240 define double @test_sqrt_double(double %x, i32 %iptr) { |
| 241 entry: | 241 entry: |
| 242 %r = call double @llvm.sqrt.f64(double %x) | 242 %r = call double @llvm.sqrt.f64(double %x) |
| 243 %r2 = call double @llvm.sqrt.f64(double %r) | 243 %r2 = call double @llvm.sqrt.f64(double %r) |
| 244 %r3 = call double @llvm.sqrt.f64(double -0.0) | 244 %r3 = call double @llvm.sqrt.f64(double -0.0) |
| 245 %r4 = fadd double %r2, %r3 | 245 %r4 = fadd double %r2, %r3 |
| 246 ret double %r4 | 246 ret double %r4 |
| 247 } | 247 } |
| 248 ; CHECK-LABEL: test_sqrt_double | 248 ; CHECK-LABEL: test_sqrt_double |
| 249 ; CHECK: sqrtsd xmm{{.*}} | 249 ; CHECK: sqrtsd xmm{{.*}} |
| 250 ; CHECK: sqrtsd xmm{{.*}} | 250 ; CHECK: sqrtsd xmm{{.*}} |
| 251 ; CHECK: sqrtsd xmm{{.*}},QWORD PTR | 251 ; CHECK: sqrtsd xmm{{.*}},QWORD PTR |
| 252 | 252 |
| 253 define double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { | 253 define double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { |
| 254 entry: | 254 entry: |
| 255 %__2 = inttoptr i32 %iptr to double* | 255 %__2 = inttoptr i32 %iptr to double* |
| 256 %y = load double* %__2, align 8 | 256 %y = load double, double* %__2, align 8 |
| 257 %r5 = call double @llvm.sqrt.f64(double %y) | 257 %r5 = call double @llvm.sqrt.f64(double %y) |
| 258 %r6 = fadd double %x, %r5 | 258 %r6 = fadd double %x, %r5 |
| 259 ret double %r6 | 259 ret double %r6 |
| 260 } | 260 } |
| 261 ; CHECK-LABEL: test_sqrt_double_mergeable_load | 261 ; CHECK-LABEL: test_sqrt_double_mergeable_load |
| 262 ; CHECK: sqrtsd xmm{{.*}} | 262 ; CHECK: sqrtsd xmm{{.*}} |
| 263 | 263 |
| 264 define float @test_sqrt_ignored(float %x, double %y) { | 264 define float @test_sqrt_ignored(float %x, double %y) { |
| 265 entry: | 265 entry: |
| 266 %ignored1 = call float @llvm.sqrt.f32(float %x) | 266 %ignored1 = call float @llvm.sqrt.f32(float %x) |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 537 |
| 538 call void @llvm.stackrestore(i8* %sp1) | 538 call void @llvm.stackrestore(i8* %sp1) |
| 539 ret void | 539 ret void |
| 540 } | 540 } |
| 541 ; CHECK-LABEL: test_stacksave_multiple | 541 ; CHECK-LABEL: test_stacksave_multiple |
| 542 ; At least 3 copies of esp, but probably more from having to do the allocas. | 542 ; At least 3 copies of esp, but probably more from having to do the allocas. |
| 543 ; CHECK: mov {{.*}},esp | 543 ; CHECK: mov {{.*}},esp |
| 544 ; CHECK: mov {{.*}},esp | 544 ; CHECK: mov {{.*}},esp |
| 545 ; CHECK: mov {{.*}},esp | 545 ; CHECK: mov {{.*}},esp |
| 546 ; CHECK: mov esp,{{.*}} | 546 ; CHECK: mov esp,{{.*}} |
| OLD | NEW |