Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | ; GLOBAL-NEXT: blr | ||||
%mul = fmul fast float %x, 42.0 | %mul = fmul fast float %x, 42.0 | ||||
%fma = call fast float @llvm.fma.f32(float %x, float 7.0, float %mul) | %fma = call fast float @llvm.fma.f32(float %x, float 7.0, float %mul) | ||||
ret float %fma | ret float %fma | ||||
} | } | ||||
; Reduced precision for sqrt is allowed - should use estimate and NR iterations. | ; Reduced precision for sqrt is allowed - should use estimate and NR iterations. | ||||
; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn:' | ; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn:' | ||||
; FMFDEBUG: fsqrt afn {{t[0-9]+}} | ; FMFDEBUG: fmul afn {{t[0-9]+}} | ||||
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' | ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' | ||||
; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn:' | ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn:' | ||||
; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} | ; GLOBALDEBUG: fmul afn {{t[0-9]+}} | ||||
; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' | ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' | ||||
define float @sqrt_afn(float %x) { | define float @sqrt_afn(float %x) { | ||||
; FMF-LABEL: sqrt_afn: | ; FMF-LABEL: sqrt_afn: | ||||
; FMF: # %bb.0: | ; FMF: # %bb.0: | ||||
; FMF-NEXT: xssqrtsp 1, 1 | ; FMF-NEXT: xxlxor 0, 0, 0 | ||||
; FMF-NEXT: fcmpu 0, 1, 0 | |||||
; FMF-NEXT: beq 0, .LBB10_2 | |||||
; FMF-NEXT: # %bb.1: | |||||
; FMF-NEXT: addis 3, 2, .LCPI10_0@toc@ha | |||||
; FMF-NEXT: xsrsqrtesp 3, 1 | |||||
; FMF-NEXT: addi 3, 3, .LCPI10_0@toc@l | |||||
; FMF-NEXT: lfsx 0, 0, 3 | |||||
; FMF-NEXT: xsmulsp 2, 1, 0 | |||||
; FMF-NEXT: xsmulsp 4, 3, 3 | |||||
; FMF-NEXT: xssubsp 2, 2, 1 | |||||
; FMF-NEXT: xsmulsp 2, 2, 4 | |||||
; FMF-NEXT: xssubsp 0, 0, 2 | |||||
; FMF-NEXT: xsmulsp 0, 3, 0 | |||||
; FMF-NEXT: xsmulsp 0, 0, 1 | |||||
; FMF-NEXT: .LBB10_2: | |||||
; FMF-NEXT: fmr 1, 0 | |||||
; FMF-NEXT: blr | ; FMF-NEXT: blr | ||||
; | ; | ||||
; GLOBAL-LABEL: sqrt_afn: | ; GLOBAL-LABEL: sqrt_afn: | ||||
; GLOBAL: # %bb.0: | ; GLOBAL: # %bb.0: | ||||
; GLOBAL-NEXT: xxlxor 0, 0, 0 | ; GLOBAL-NEXT: xxlxor 0, 0, 0 | ||||
; GLOBAL-NEXT: fcmpu 0, 1, 0 | ; GLOBAL-NEXT: fcmpu 0, 1, 0 | ||||
; GLOBAL-NEXT: beq 0, .LBB10_2 | ; GLOBAL-NEXT: beq 0, .LBB10_2 | ||||
; GLOBAL-NEXT: # %bb.1: | ; GLOBAL-NEXT: # %bb.1: | ||||
; GLOBAL-NEXT: xsrsqrtesp 2, 1 | ; GLOBAL-NEXT: xsrsqrtesp 2, 1 | ||||
Show All 12 Lines | |||||
; GLOBAL-NEXT: blr | ; GLOBAL-NEXT: blr | ||||
%rt = call afn float @llvm.sqrt.f32(float %x) | %rt = call afn float @llvm.sqrt.f32(float %x) | ||||
ret float %rt | ret float %rt | ||||
} | } | ||||
; The call is now fully 'fast'. This implies that approximation is allowed. | ; The call is now fully 'fast'. This implies that approximation is allowed. | ||||
; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast:' | ; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast:' | ||||
; FMFDEBUG: fsqrt nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}} | ; FMFDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}} | ||||
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' | ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' | ||||
; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast:' | ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast:' | ||||
; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} | ; GLOBALDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}} | ||||
; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' | ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' | ||||
define float @sqrt_fast(float %x) { | define float @sqrt_fast(float %x) { | ||||
; FMF-LABEL: sqrt_fast: | ; FMF-LABEL: sqrt_fast: | ||||
; FMF: # %bb.0: | ; FMF: # %bb.0: | ||||
; FMF-NEXT: xssqrtsp 1, 1 | ; FMF-NEXT: xxlxor 0, 0, 0 | ||||
; FMF-NEXT: fcmpu 0, 1, 0 | |||||
; FMF-NEXT: beq 0, .LBB11_2 | |||||
; FMF-NEXT: # %bb.1: | |||||
; FMF-NEXT: xsrsqrtesp 2, 1 | |||||
; FMF-NEXT: addis 3, 2, .LCPI11_0@toc@ha | |||||
; FMF-NEXT: fneg 0, 1 | |||||
; FMF-NEXT: fmr 4, 1 | |||||
; FMF-NEXT: addi 3, 3, .LCPI11_0@toc@l | |||||
; FMF-NEXT: lfsx 3, 0, 3 | |||||
; FMF-NEXT: xsmaddasp 4, 0, 3 | |||||
; FMF-NEXT: xsmulsp 0, 2, 2 | |||||
; FMF-NEXT: xsmaddasp 3, 4, 0 | |||||
; FMF-NEXT: xsmulsp 0, 2, 3 | |||||
; FMF-NEXT: xsmulsp 0, 0, 1 | |||||
; FMF-NEXT: .LBB11_2: | |||||
; FMF-NEXT: fmr 1, 0 | |||||
; FMF-NEXT: blr | ; FMF-NEXT: blr | ||||
; | ; | ||||
; GLOBAL-LABEL: sqrt_fast: | ; GLOBAL-LABEL: sqrt_fast: | ||||
; GLOBAL: # %bb.0: | ; GLOBAL: # %bb.0: | ||||
; GLOBAL-NEXT: xxlxor 0, 0, 0 | ; GLOBAL-NEXT: xxlxor 0, 0, 0 | ||||
; GLOBAL-NEXT: fcmpu 0, 1, 0 | ; GLOBAL-NEXT: fcmpu 0, 1, 0 | ||||
; GLOBAL-NEXT: beq 0, .LBB11_2 | ; GLOBAL-NEXT: beq 0, .LBB11_2 | ||||
; GLOBAL-NEXT: # %bb.1: | ; GLOBAL-NEXT: # %bb.1: | ||||
; GLOBAL-NEXT: xsrsqrtesp 2, 1 | ; GLOBAL-NEXT: xsrsqrtesp 2, 1 | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |