76 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 | FileCheck %s --check-prefixes=X64,SSE23; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 -fast-isel | FileCheck %s --check-prefixes=X64,SSE24; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx,+sse2 -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X64,SSE25; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx | FileCheck %s --check-prefixes=X64,AVX6; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx -fast-isel | FileCheck %s --check-prefixes=X64,AVX7; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-avx2,+avx -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=X64,AVX8; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel=0 -fast-isel=0 | FileCheck %s --check-prefixes=X86,SDAG-X869; RUN: llc < %s -mtriple=i686-linux-gnu -fast-isel | FileCheck %s --check-prefixes=X86,FASTISEL-X8610; TODO: The last RUN line will fails GISEL selection and will fallback to DAG selection due to lack of support for loads/stores in i686 mode, support is expected soon enough, for this reason the llvm/test/CodeGen/X86/GlobalISel/sqrt.mir test is added for now because of the lack of support for i686 in GlobalISel.11; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes=X86,GISEL-X8612 13define float @test_sqrt_f32(float %a) {14; SSE2-LABEL: test_sqrt_f32:15; SSE2: ## %bb.0:16; SSE2-NEXT: sqrtss %xmm0, %xmm017; SSE2-NEXT: retq18;19; AVX-LABEL: test_sqrt_f32:20; AVX: ## %bb.0:21; AVX-NEXT: vsqrtss %xmm0, %xmm0, %xmm022; AVX-NEXT: retq23;24; X86-LABEL: test_sqrt_f32:25; X86: # %bb.0:26; X86-NEXT: flds {{[0-9]+}}(%esp)27; X86-NEXT: fsqrt28; X86-NEXT: retl29 %res = call float @llvm.sqrt.f32(float %a)30 ret float %res31}32declare float @llvm.sqrt.f32(float) nounwind readnone33 34define double @test_sqrt_f64(double %a) {35; SSE2-LABEL: test_sqrt_f64:36; SSE2: ## %bb.0:37; SSE2-NEXT: sqrtsd %xmm0, %xmm038; SSE2-NEXT: retq39;40; AVX-LABEL: test_sqrt_f64:41; AVX: ## %bb.0:42; AVX-NEXT: vsqrtsd %xmm0, %xmm0, %xmm043; AVX-NEXT: retq44;45; X86-LABEL: test_sqrt_f64:46; X86: # %bb.0:47; X86-NEXT: fldl {{[0-9]+}}(%esp)48; X86-NEXT: fsqrt49; X86-NEXT: retl50 %res = call double @llvm.sqrt.f64(double %a)51 ret double %res52}53declare double @llvm.sqrt.f64(double) nounwind readnone54 55define x86_fp80 @test_sqrt_f80(x86_fp80 %a) {56; X64-LABEL: test_sqrt_f80:57; X64: ## %bb.0:58; X64-NEXT: fldt {{[0-9]+}}(%rsp)59; X64-NEXT: fsqrt60; X64-NEXT: retq61;62; X86-LABEL: test_sqrt_f80:63; X86: # %bb.0:64; X86-NEXT: fldt {{[0-9]+}}(%esp)65; X86-NEXT: fsqrt66; X86-NEXT: retl67 %res = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %a)68 ret x86_fp80 %res69}70declare x86_fp80 @llvm.sqrt.f80(x86_fp80) nounwind readnone71 72;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:73; FASTISEL-X86: {{.*}}74; GISEL-X86: {{.*}}75; SDAG-X86: {{.*}}76