blob: be7c6e8673998b7e8c612367e3d131f21ab95b74 [file] [log] [blame]
Juergen Ributzka272b5702014-06-11 23:11:02 +00001; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 | FileCheck %s --check-prefix=SSE2
2; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=SSE2
3; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx | FileCheck %s --check-prefix=AVX
4; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=AVX
5
6define 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}
14declare float @llvm.sqrt.f32(float) nounwind readnone
15
16define 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}
24declare double @llvm.sqrt.f64(double) nounwind readnone
25
26