Juergen Ributzka | 272b570 | 2014-06-11 23:11:02 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 | FileCheck %s --check-prefix=SSE2 |
Mehdi Amini | 945a660 | 2015-02-27 18:32:11 +0000 | [diff] [blame] | 2 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=SSE2 |
Juergen Ributzka | 272b570 | 2014-06-11 23:11:02 +0000 | [diff] [blame] | 3 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx | FileCheck %s --check-prefix=AVX |
Mehdi Amini | 945a660 | 2015-02-27 18:32:11 +0000 | [diff] [blame] | 4 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=AVX |
Juergen Ributzka | 272b570 | 2014-06-11 23:11:02 +0000 | [diff] [blame] | 5 | |
| 6 | define float @test_sqrt_f32(float %a) { |
| 7 | ; SSE2-LABEL: test_sqrt_f32 |
| 8 | ; SSE2: sqrtss %xmm0, %xmm0 |
| 9 | ; AVX-LABEL: test_sqrt_f32 |
| 10 | ; AVX: vsqrtss %xmm0, %xmm0 |
| 11 | %res = call float @llvm.sqrt.f32(float %a) |
| 12 | ret float %res |
| 13 | } |
| 14 | declare float @llvm.sqrt.f32(float) nounwind readnone |
| 15 | |
| 16 | define double @test_sqrt_f64(double %a) { |
| 17 | ; SSE2-LABEL: test_sqrt_f64 |
| 18 | ; SSE2: sqrtsd %xmm0, %xmm0 |
| 19 | ; AVX-LABEL: test_sqrt_f64 |
| 20 | ; AVX: vsqrtsd %xmm0, %xmm0 |
| 21 | %res = call double @llvm.sqrt.f64(double %a) |
| 22 | ret double %res |
| 23 | } |
| 24 | declare double @llvm.sqrt.f64(double) nounwind readnone |
| 25 | |
| 26 | |