1 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse2 -mcpu=nehalem | FileCheck %s 2 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse2 -mcpu=nehalem | FileCheck %s 3 4 define double @t1(float* nocapture %x) nounwind readonly ssp { 5 entry: 6 ; CHECK-LABEL: t1: 7 ; CHECK: movss ([[A0:%rdi|%rcx]]), %xmm0 8 ; CHECK: cvtss2sd %xmm0, %xmm0 9 10 %0 = load float* %x, align 4 11 %1 = fpext float %0 to double 12 ret double %1 13 } 14 15 define float @t2(double* nocapture %x) nounwind readonly ssp optsize { 16 entry: 17 ; CHECK-LABEL: t2: 18 ; CHECK: cvtsd2ss ([[A0]]), %xmm0 19 %0 = load double* %x, align 8 20 %1 = fptrunc double %0 to float 21 ret float %1 22 } 23 24 define float @squirtf(float* %x) nounwind { 25 entry: 26 ; CHECK-LABEL: squirtf: 27 ; CHECK: movss ([[A0]]), %xmm0 28 ; CHECK: sqrtss %xmm0, %xmm0 29 %z = load float* %x 30 %t = call float @llvm.sqrt.f32(float %z) 31 ret float %t 32 } 33 34 define double @squirt(double* %x) nounwind { 35 entry: 36 ; CHECK-LABEL: squirt: 37 ; CHECK: sqrtsd ([[A0]]), %xmm0 38 %z = load double* %x 39 %t = call double @llvm.sqrt.f64(double %z) 40 ret double %t 41 } 42 43 define float @squirtf_size(float* %x) nounwind optsize { 44 entry: 45 ; CHECK-LABEL: squirtf_size: 46 ; CHECK: sqrtss ([[A0]]), %xmm0 47 %z = load float* %x 48 %t = call float @llvm.sqrt.f32(float %z) 49 ret float %t 50 } 51 52 define double @squirt_size(double* %x) nounwind optsize { 53 entry: 54 ; CHECK-LABEL: squirt_size: 55 ; CHECK: sqrtsd ([[A0]]), %xmm0 56 %z = load double* %x 57 %t = call double @llvm.sqrt.f64(double %z) 58 ret double %t 59 } 60 61 declare float @llvm.sqrt.f32(float) 62 declare double @llvm.sqrt.f64(double) 63