1; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse2 | FileCheck %s 2; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse2 | FileCheck %s 3 4define double @t1(float* nocapture %x) nounwind readonly ssp { 5entry: 6; CHECK: 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 15define float @t2(double* nocapture %x) nounwind readonly ssp optsize { 16entry: 17; CHECK: 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 24define float @squirtf(float* %x) nounwind { 25entry: 26; CHECK: 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 34define double @squirt(double* %x) nounwind { 35entry: 36; CHECK: squirt: 37; CHECK: movsd ([[A0]]), %xmm0 38; CHECK: sqrtsd %xmm0, %xmm0 39 %z = load double* %x 40 %t = call double @llvm.sqrt.f64(double %z) 41 ret double %t 42} 43 44define float @squirtf_size(float* %x) nounwind optsize { 45entry: 46; CHECK: squirtf_size: 47; CHECK: sqrtss ([[A0]]), %xmm0 48 %z = load float* %x 49 %t = call float @llvm.sqrt.f32(float %z) 50 ret float %t 51} 52 53define double @squirt_size(double* %x) nounwind optsize { 54entry: 55; CHECK: squirt_size: 56; CHECK: sqrtsd ([[A0]]), %xmm0 57 %z = load double* %x 58 %t = call double @llvm.sqrt.f64(double %z) 59 ret double %t 60} 61 62declare float @llvm.sqrt.f32(float) 63declare double @llvm.sqrt.f64(double) 64