1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -O3 -mtriple=x86_64-gnu-linux < %s | FileCheck %s 3 4define x86_fp80 @constrained_fpext_f32_as_fp80(float %mem) #0 { 5; CHECK-LABEL: constrained_fpext_f32_as_fp80: 6; CHECK: # %bb.0: # %entry 7; CHECK-NEXT: movss %xmm0, -{{[0-9]+}}(%rsp) 8; CHECK-NEXT: flds -{{[0-9]+}}(%rsp) 9; CHECK-NEXT: wait 10; CHECK-NEXT: retq 11entry: 12 %ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f32( 13 float %mem, 14 metadata !"fpexcept.strict") #0 15 ret x86_fp80 %ext 16} 17 18define float @constrained_fptrunc_f80_to_f32(x86_fp80 %reg) #0 { 19; CHECK-LABEL: constrained_fptrunc_f80_to_f32: 20; CHECK: # %bb.0: 21; CHECK-NEXT: fldt {{[0-9]+}}(%rsp) 22; CHECK-NEXT: fstps -{{[0-9]+}}(%rsp) 23; CHECK-NEXT: wait 24; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 25; CHECK-NEXT: retq 26 %trunc = call float @llvm.experimental.constrained.fptrunc.f32.f80( 27 x86_fp80 %reg, 28 metadata !"round.dynamic", 29 metadata !"fpexcept.strict") #0 30 ret float %trunc 31} 32 33define x86_fp80 @constrained_fpext_f64_to_f80(double %mem) #0 { 34; CHECK-LABEL: constrained_fpext_f64_to_f80: 35; CHECK: # %bb.0: # %entry 36; CHECK-NEXT: movsd %xmm0, -{{[0-9]+}}(%rsp) 37; CHECK-NEXT: fldl -{{[0-9]+}}(%rsp) 38; CHECK-NEXT: wait 39; CHECK-NEXT: retq 40entry: 41 %ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f64( 42 double %mem, 43 metadata !"fpexcept.strict") #0 44 ret x86_fp80 %ext 45} 46 47define double @constrained_fptrunc_f80_to_f64(x86_fp80 %reg) #0 { 48; CHECK-LABEL: constrained_fptrunc_f80_to_f64: 49; CHECK: # %bb.0: 50; CHECK-NEXT: fldt {{[0-9]+}}(%rsp) 51; CHECK-NEXT: fstpl -{{[0-9]+}}(%rsp) 52; CHECK-NEXT: wait 53; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero 54; CHECK-NEXT: retq 55 %trunc = call double @llvm.experimental.constrained.fptrunc.f64.f80( 56 x86_fp80 %reg, 57 metadata !"round.dynamic", 58 metadata !"fpexcept.strict") #0 59 ret double %trunc 60} 61 62attributes #0 = { strictfp } 63 64declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f32(float, metadata) 65declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f64(double, metadata) 66declare float @llvm.experimental.constrained.fptrunc.f32.f80(x86_fp80, metadata, metadata) 67declare double @llvm.experimental.constrained.fptrunc.f64.f80(x86_fp80, metadata, metadata) 68