1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/CodeGen/AMDGPU/llvm.amdgcn.fdiv.fast.ll
Matt Arsenault 75622c9e16 AMDGPU: Change fdiv lowering based on !fpmath metadata
If 2.5 ulp is acceptable, denormals are not required, and
isn't a reciprocal which will already be handled, replace
with a faster fdiv.

Simplify the lowering tests by using per function
subtarget features.

llvm-svn: 276051
2016-07-19 23:16:53 +00:00

19 lines
583 B
LLVM

; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck %s
declare float @llvm.amdgcn.fdiv.fast(float, float) #0
; CHECK-LABEL: {{^}}test_fdiv_fast:
; CHECK: v_cndmask_b32_e32 v{{[0-9]+}}, 1.0, v{{[0-9]+}}, vcc
; CHECK: v_mul_f32_e32
; CHECK: v_rcp_f32_e32
; CHECK: v_mul_f32_e32
; CHECK: v_mul_f32_e32
define void @test_fdiv_fast(float addrspace(1)* %out, float %a, float %b) #1 {
%fdiv = call float @llvm.amdgcn.fdiv.fast(float %a, float %b)
store float %fdiv, float addrspace(1)* %out
ret void
}
attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }