2019-06-15 00:28:55 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc -O3 -mtriple=x86_64-gnu-linux < %s | FileCheck %s
|
|
|
|
|
2019-10-05 01:03:46 +08:00
|
|
|
define x86_fp80 @constrained_fpext_f32_as_fp80(float %mem) #0 {
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-LABEL: constrained_fpext_f32_as_fp80:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: movss %xmm0, -{{[0-9]+}}(%rsp)
|
|
|
|
; CHECK-NEXT: flds -{{[0-9]+}}(%rsp)
|
2020-01-16 10:49:59 +08:00
|
|
|
; CHECK-NEXT: wait
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f32(
|
|
|
|
float %mem,
|
2019-10-05 01:03:46 +08:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-06-15 00:28:55 +08:00
|
|
|
ret x86_fp80 %ext
|
|
|
|
}
|
|
|
|
|
2019-10-05 01:03:46 +08:00
|
|
|
define float @constrained_fptrunc_f80_to_f32(x86_fp80 %reg) #0 {
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-LABEL: constrained_fptrunc_f80_to_f32:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: fldt {{[0-9]+}}(%rsp)
|
|
|
|
; CHECK-NEXT: fstps -{{[0-9]+}}(%rsp)
|
2020-01-16 10:49:59 +08:00
|
|
|
; CHECK-NEXT: wait
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%trunc = call float @llvm.experimental.constrained.fptrunc.f32.f80(
|
|
|
|
x86_fp80 %reg,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-05 01:03:46 +08:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-06-15 00:28:55 +08:00
|
|
|
ret float %trunc
|
|
|
|
}
|
|
|
|
|
2019-10-05 01:03:46 +08:00
|
|
|
define x86_fp80 @constrained_fpext_f64_to_f80(double %mem) #0 {
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-LABEL: constrained_fpext_f64_to_f80:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: movsd %xmm0, -{{[0-9]+}}(%rsp)
|
|
|
|
; CHECK-NEXT: fldl -{{[0-9]+}}(%rsp)
|
2020-01-16 10:49:59 +08:00
|
|
|
; CHECK-NEXT: wait
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%ext = call x86_fp80 @llvm.experimental.constrained.fpext.f80.f64(
|
|
|
|
double %mem,
|
2019-10-05 01:03:46 +08:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-06-15 00:28:55 +08:00
|
|
|
ret x86_fp80 %ext
|
|
|
|
}
|
|
|
|
|
2019-10-05 01:03:46 +08:00
|
|
|
define double @constrained_fptrunc_f80_to_f64(x86_fp80 %reg) #0 {
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-LABEL: constrained_fptrunc_f80_to_f64:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: fldt {{[0-9]+}}(%rsp)
|
|
|
|
; CHECK-NEXT: fstpl -{{[0-9]+}}(%rsp)
|
2020-01-16 10:49:59 +08:00
|
|
|
; CHECK-NEXT: wait
|
2019-06-15 00:28:55 +08:00
|
|
|
; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%trunc = call double @llvm.experimental.constrained.fptrunc.f64.f80(
|
|
|
|
x86_fp80 %reg,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-05 01:03:46 +08:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-06-15 00:28:55 +08:00
|
|
|
ret double %trunc
|
|
|
|
}
|
|
|
|
|
2019-10-05 01:03:46 +08:00
|
|
|
attributes #0 = { strictfp }
|
|
|
|
|
2019-06-15 00:28:55 +08:00
|
|
|
declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f32(float, metadata)
|
|
|
|
declare x86_fp80 @llvm.experimental.constrained.fpext.f80.f64(double, metadata)
|
|
|
|
declare float @llvm.experimental.constrained.fptrunc.f32.f80(x86_fp80, metadata, metadata)
|
|
|
|
declare double @llvm.experimental.constrained.fptrunc.f64.f80(x86_fp80, metadata, metadata)
|