brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 6fcf466 Raw
104 lines · plain
1; Test that floating-point instructions that set cc are *not* used to2; eliminate *strict* compares for load complement, load negative and load3; positive4;5; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s6; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s7 8; Load complement (sign-bit flipped).9; Test f3210define float @f1(float %a, float %b, float %f) #0 {11; CHECK-LABEL: f1:12; CHECK: ltebr13; CHECK-NEXT: ber %r1414  %neg = fneg float %f15  %cond = call i1 @llvm.experimental.constrained.fcmp.f32(16                                               float %neg, float 0.0,17                                               metadata !"oeq",18                                               metadata !"fpexcept.strict") #019  %res = select i1 %cond, float %a, float %b20  ret float %res21}22 23; Test f6424define double @f2(double %a, double %b, double %f) #0 {25; CHECK-LABEL: f2:26; CHECK: ltdbr27; CHECK-NEXT: ber %r1428  %neg = fneg double %f29  %cond = call i1 @llvm.experimental.constrained.fcmp.f64(30                                               double %neg, double 0.0,31                                               metadata !"oeq",32                                               metadata !"fpexcept.strict") #033  %res = select i1 %cond, double %a, double %b34  ret double %res35}36 37; Negation of floating-point absolute.38; Test f3239declare float @llvm.fabs.f32(float %f)40define float @f3(float %a, float %b, float %f) #0 {41; CHECK-LABEL: f3:42; CHECK: ltebr43; CHECK-NEXT: ber %r1444  %abs = call float @llvm.fabs.f32(float %f) #045  %neg = fneg float %abs46  %cond = call i1 @llvm.experimental.constrained.fcmp.f32(47                                               float %neg, float 0.0,48                                               metadata !"oeq",49                                               metadata !"fpexcept.strict") #050  %res = select i1 %cond, float %a, float %b51  ret float %res52}53 54; Test f6455declare double @llvm.fabs.f64(double %f)56define double @f4(double %a, double %b, double %f) #0 {57; CHECK-LABEL: f4:58; CHECK: ltdbr59; CHECK-NEXT: ber %r1460  %abs = call double @llvm.fabs.f64(double %f) #061  %neg = fneg double %abs62  %cond = call i1 @llvm.experimental.constrained.fcmp.f64(63                                               double %neg, double 0.0,64                                               metadata !"oeq",65                                               metadata !"fpexcept.strict") #066  %res = select i1 %cond, double %a, double %b67  ret double %res68}69 70; Absolute floating-point value.71; Test f3272define float @f5(float %a, float %b, float %f) #0 {73; CHECK-LABEL: f5:74; CHECK: ltebr75; CHECK-NEXT: ber %r1476  %abs = call float @llvm.fabs.f32(float %f) #077  %cond = call i1 @llvm.experimental.constrained.fcmp.f32(78                                               float %abs, float 0.0,79                                               metadata !"oeq",80                                               metadata !"fpexcept.strict") #081  %res = select i1 %cond, float %a, float %b82  ret float %res83}84 85; Test f6486define double @f6(double %a, double %b, double %f) #0 {87; CHECK-LABEL: f6:88; CHECK: ltdbr89; CHECK-NEXT: ber %r1490  %abs = call double @llvm.fabs.f64(double %f) #091  %cond = call i1 @llvm.experimental.constrained.fcmp.f64(92                                               double %abs, double 0.0,93                                               metadata !"oeq",94                                               metadata !"fpexcept.strict") #095  %res = select i1 %cond, double %a, double %b96  ret double %res97}98 99attributes #0 = { strictfp }100 101declare i1 @llvm.experimental.constrained.fcmp.f32(float, float, metadata, metadata)102declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)103 104