1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/PowerPC/scalar-min-max.ll
Qiu Chaofan 2b68172fec [NFC] [PowerPC] Narrow fast-math flags in tests
A lot of tests under PowerPC are using fast flag, while fast is just
alias of 7 fast-math flags. This change makes test points clearer.

mc-instrlat.ll and sms-iterator.ll keeps unchanged since they are not
testing fast-math behavior. (one for machine combiner crash, one for
machine pipeliner bug)

Reviewed By: steven.zhang, spatel

Differential Revision: https://reviews.llvm.org/D78989
2020-05-13 17:22:45 +08:00

196 lines
6.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names --enable-unsafe-fp-math \
; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \
; RUN: --enable-no-nans-fp-math \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names --enable-unsafe-fp-math \
; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \
; RUN: --enable-no-nans-fp-math \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -verify-machineinstrs \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
; RUN: --check-prefix=NO-FAST-P9
; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -verify-machineinstrs \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
; RUN: --check-prefix=NO-FAST-P8
define dso_local float @testfmax(float %a, float %b) local_unnamed_addr {
; CHECK-LABEL: testfmax:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmaxdp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testfmax:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testfmax:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2
; NO-FAST-P8-NEXT: bgtlr cr0
; NO-FAST-P8-NEXT: # %bb.1: # %entry
; NO-FAST-P8-NEXT: fmr f1, f2
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp ogt float %a, %b
%cond = select i1 %cmp, float %a, float %b
ret float %cond
}
define dso_local double @testdmax(double %a, double %b) local_unnamed_addr {
; CHECK-LABEL: testdmax:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmaxdp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testdmax:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testdmax:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2
; NO-FAST-P8-NEXT: bgtlr cr0
; NO-FAST-P8-NEXT: # %bb.1: # %entry
; NO-FAST-P8-NEXT: fmr f1, f2
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
define dso_local float @testfmin(float %a, float %b) local_unnamed_addr {
; CHECK-LABEL: testfmin:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmindp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testfmin:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testfmin:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2
; NO-FAST-P8-NEXT: bltlr cr0
; NO-FAST-P8-NEXT: # %bb.1: # %entry
; NO-FAST-P8-NEXT: fmr f1, f2
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp olt float %a, %b
%cond = select i1 %cmp, float %a, float %b
ret float %cond
}
define dso_local double @testdmin(double %a, double %b) local_unnamed_addr {
; CHECK-LABEL: testdmin:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmindp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testdmin:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testdmin:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2
; NO-FAST-P8-NEXT: bltlr cr0
; NO-FAST-P8-NEXT: # %bb.1: # %entry
; NO-FAST-P8-NEXT: fmr f1, f2
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
define dso_local float @testfmax_fast(float %a, float %b) local_unnamed_addr {
; CHECK-LABEL: testfmax_fast:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmaxdp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testfmax_fast:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testfmax_fast:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xssubsp f0, f2, f1
; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp nnan ninf ogt float %a, %b
%cond = select i1 %cmp, float %a, float %b
ret float %cond
}
define dso_local double @testdmax_fast(double %a, double %b) local_unnamed_addr {
; CHECK-LABEL: testdmax_fast:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmaxdp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testdmax_fast:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testdmax_fast:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xssubdp f0, f2, f1
; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp nnan ninf ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
define dso_local float @testfmin_fast(float %a, float %b) local_unnamed_addr {
; CHECK-LABEL: testfmin_fast:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmindp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testfmin_fast:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testfmin_fast:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xssubsp f0, f1, f2
; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp nnan ninf olt float %a, %b
%cond = select i1 %cmp, float %a, float %b
ret float %cond
}
define dso_local double @testdmin_fast(double %a, double %b) local_unnamed_addr {
; CHECK-LABEL: testdmin_fast:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xsmindp f1, f1, f2
; CHECK-NEXT: blr
;
; NO-FAST-P9-LABEL: testdmin_fast:
; NO-FAST-P9: # %bb.0: # %entry
; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
; NO-FAST-P9-NEXT: blr
;
; NO-FAST-P8-LABEL: testdmin_fast:
; NO-FAST-P8: # %bb.0: # %entry
; NO-FAST-P8-NEXT: xssubdp f0, f1, f2
; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
; NO-FAST-P8-NEXT: blr
entry:
%cmp = fcmp nnan ninf olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}