blob: b22c041250fe3bfbe001d6142ac679bb61126997 [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
Mehdi Amini945a6602015-02-27 18:32:11 +00002; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=SSE2
Juergen Ributzka272b5702014-06-11 23:11:02 +00003; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx | FileCheck %s --check-prefix=AVX
Mehdi Amini945a6602015-02-27 18:32:11 +00004; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=AVX
Juergen Ributzka272b5702014-06-11 23:11:02 +00005
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