mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix more instances of dropped fast math flags when optimizing FADD instructions. All found by inspection (aka grep).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -160,6 +160,22 @@ define float @fold15(float %x, float %y) {
|
||||
; CHECK: ret
|
||||
}
|
||||
|
||||
; (select X+Y, X-Y) => X + (select Y, -Y)
|
||||
define float @fold16(float %x, float %y) {
|
||||
%cmp = fcmp ogt float %x, %y
|
||||
%plus = fadd fast float %x, %y
|
||||
%minus = fsub fast float %x, %y
|
||||
%r = select i1 %cmp, float %plus, float %minus
|
||||
ret float %r
|
||||
; CHECK: fold16
|
||||
; CHECK: fsub fast float
|
||||
; CHECK: select
|
||||
; CHECK: fadd fast float
|
||||
; CHECK: ret
|
||||
}
|
||||
|
||||
|
||||
|
||||
; =========================================================================
|
||||
;
|
||||
; Testing-cases about fmul begin
|
||||
|
@@ -31,6 +31,15 @@ define half @test4(float %a) {
|
||||
ret half %c
|
||||
}
|
||||
|
||||
; CHECK: test4-fast
|
||||
define half @test4-fast(float %a) {
|
||||
; CHECK: fptrunc
|
||||
; CHECK: fsub fast
|
||||
%b = fsub fast float -0.0, %a
|
||||
%c = fptrunc float %b to half
|
||||
ret half %c
|
||||
}
|
||||
|
||||
; CHECK: test5
|
||||
define half @test5(float %a, float %b, float %c) {
|
||||
; CHECK: fcmp ogt
|
||||
|
Reference in New Issue
Block a user