[llvm-branch-commits] [llvm-branch] r165970 - in /llvm/branches/R600: lib/Target/AMDGPU/AMDGPUISelLowering.cpp lib/Target/AMDGPU/AMDGPUIntrinsics.td lib/Target/AMDGPU/R600Instructions.td lib/Target/AMDGPU/SIInstructions.td test/CodeGen/R600/floor.ll test/CodeGen/R600/llvm.AMDGPU.floor.ll
Tom Stellard
thomas.stellard at amd.com
Mon Oct 15 13:53:45 PDT 2012
Author: tstellar
Date: Mon Oct 15 15:53:45 2012
New Revision: 165970
URL: http://llvm.org/viewvc/llvm-project?rev=165970&view=rev
Log:
R600: use floor intrinsic instead of llvm.AMDIL.floor
Patch by: Vincent Lejeune
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Added:
llvm/branches/R600/test/CodeGen/R600/floor.ll
- copied, changed from r165969, llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll
Removed:
llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll
Modified:
llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/branches/R600/lib/Target/AMDGPU/AMDGPUIntrinsics.td
llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td
llvm/branches/R600/lib/Target/AMDGPU/SIInstructions.td
Modified: llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp?rev=165970&r1=165969&r2=165970&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Mon Oct 15 15:53:45 2012
@@ -37,6 +37,7 @@
setOperationAction(ISD::FPOW, MVT::f32, Legal);
setOperationAction(ISD::FLOG2, MVT::f32, Legal);
setOperationAction(ISD::FABS, MVT::f32, Legal);
+ setOperationAction(ISD::FFLOOR, MVT::f32, Legal);
setOperationAction(ISD::FRINT, MVT::f32, Legal);
setOperationAction(ISD::UDIV, MVT::i32, Expand);
Modified: llvm/branches/R600/lib/Target/AMDGPU/AMDGPUIntrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/AMDGPUIntrinsics.td?rev=165970&r1=165969&r2=165970&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/AMDGPUIntrinsics.td (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/AMDGPUIntrinsics.td Mon Oct 15 15:53:45 2012
@@ -23,7 +23,6 @@
def int_AMDGPU_cndlt : Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty], [IntrNoMem]>;
def int_AMDGPU_div : Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty], [IntrNoMem]>;
def int_AMDGPU_dp4 : Intrinsic<[llvm_float_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
- def int_AMDGPU_floor : Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
def int_AMDGPU_kill : Intrinsic<[], [llvm_float_ty], []>;
def int_AMDGPU_kilp : Intrinsic<[], [], []>;
def int_AMDGPU_lrp : Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty], [IntrNoMem]>;
Modified: llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td?rev=165970&r1=165969&r2=165970&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/R600Instructions.td Mon Oct 15 15:53:45 2012
@@ -405,7 +405,7 @@
def FLOOR : R600_1OP <
0x14, "FLOOR",
- [(set R600_Reg32:$dst, (int_AMDGPU_floor R600_Reg32:$src))]
+ [(set R600_Reg32:$dst, (ffloor R600_Reg32:$src))]
>;
let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in {
Modified: llvm/branches/R600/lib/Target/AMDGPU/SIInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/SIInstructions.td?rev=165970&r1=165969&r2=165970&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/SIInstructions.td (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/SIInstructions.td Mon Oct 15 15:53:45 2012
@@ -573,7 +573,7 @@
[(set VReg_32:$dst, (frint AllReg_32:$src0))]
>;
defm V_FLOOR_F32 : VOP1_32 <0x00000024, "V_FLOOR_F32",
- [(set VReg_32:$dst, (int_AMDGPU_floor AllReg_32:$src0))]
+ [(set VReg_32:$dst, (ffloor AllReg_32:$src0))]
>;
defm V_EXP_F32 : VOP1_32 <0x00000025, "V_EXP_F32",
[(set VReg_32:$dst, (fexp2 AllReg_32:$src0))]
Copied: llvm/branches/R600/test/CodeGen/R600/floor.ll (from r165969, llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/test/CodeGen/R600/floor.ll?p2=llvm/branches/R600/test/CodeGen/R600/floor.ll&p1=llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll&r1=165969&r2=165970&rev=165970&view=diff
==============================================================================
--- llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll (original)
+++ llvm/branches/R600/test/CodeGen/R600/floor.ll Mon Oct 15 15:53:45 2012
@@ -4,7 +4,7 @@
define void @test() {
%r0 = call float @llvm.R600.load.input(i32 0)
- %r1 = call float @llvm.AMDGPU.floor( float %r0)
+ %r1 = call float @floor(float %r0)
call void @llvm.AMDGPU.store.output(float %r1, i32 0)
ret void
}
@@ -13,4 +13,4 @@
declare void @llvm.AMDGPU.store.output(float, i32)
-declare float @llvm.AMDGPU.floor(float ) readnone
+declare float @floor(float) readonly
Removed: llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll?rev=165969&view=auto
==============================================================================
--- llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll (original)
+++ llvm/branches/R600/test/CodeGen/R600/llvm.AMDGPU.floor.ll (removed)
@@ -1,16 +0,0 @@
-;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
-
-;CHECK: FLOOR T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
-
-define void @test() {
- %r0 = call float @llvm.R600.load.input(i32 0)
- %r1 = call float @llvm.AMDGPU.floor( float %r0)
- call void @llvm.AMDGPU.store.output(float %r1, i32 0)
- ret void
-}
-
-declare float @llvm.R600.load.input(i32) readnone
-
-declare void @llvm.AMDGPU.store.output(float, i32)
-
-declare float @llvm.AMDGPU.floor(float ) readnone
More information about the llvm-branch-commits
mailing list