[llvm-branch-commits] [llvm-branch] r164536 - in /llvm/branches/R600: lib/Target/AMDGPU/R600ISelLowering.cpp test/CodeGen/R600/fadd.v4f32.ll test/CodeGen/R600/fmul.v4f32.ll
Tom Stellard
thomas.stellard at amd.com
Mon Sep 24 08:54:30 PDT 2012
Author: tstellar
Date: Mon Sep 24 10:52:49 2012
New Revision: 164536
URL: http://llvm.org/viewvc/llvm-project?rev=164536&view=rev
Log:
R600: Expand vector fadd and fmul on R600
Added:
llvm/branches/R600/test/CodeGen/R600/fadd.v4f32.ll
llvm/branches/R600/test/CodeGen/R600/fmul.v4f32.ll
Modified:
llvm/branches/R600/lib/Target/AMDGPU/R600ISelLowering.cpp
Modified: llvm/branches/R600/lib/Target/AMDGPU/R600ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/R600ISelLowering.cpp?rev=164536&r1=164535&r2=164536&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/R600ISelLowering.cpp (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/R600ISelLowering.cpp Mon Sep 24 10:52:49 2012
@@ -34,6 +34,9 @@
addRegisterClass(MVT::i32, &AMDGPU::R600_Reg32RegClass);
computeRegisterProperties();
+ setOperationAction(ISD::FADD, MVT::v4f32, Expand);
+ setOperationAction(ISD::FMUL, MVT::v4f32, Expand);
+
setOperationAction(ISD::BR_CC, MVT::i32, Custom);
setOperationAction(ISD::BR_CC, MVT::f32, Custom);
Added: llvm/branches/R600/test/CodeGen/R600/fadd.v4f32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/test/CodeGen/R600/fadd.v4f32.ll?rev=164536&view=auto
==============================================================================
--- llvm/branches/R600/test/CodeGen/R600/fadd.v4f32.ll (added)
+++ llvm/branches/R600/test/CodeGen/R600/fadd.v4f32.ll Mon Sep 24 10:52:49 2012
@@ -0,0 +1,15 @@
+;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
+
+;CHECK: ADD T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: ADD T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: ADD T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: ADD T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+
+define void @test(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
+ %b_ptr = getelementptr <4 x float> addrspace(1)* %in, i32 1
+ %a = load <4 x float> addrspace(1) * %in
+ %b = load <4 x float> addrspace(1) * %b_ptr
+ %result = fadd <4 x float> %a, %b
+ store <4 x float> %result, <4 x float> addrspace(1)* %out
+ ret void
+}
Added: llvm/branches/R600/test/CodeGen/R600/fmul.v4f32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/test/CodeGen/R600/fmul.v4f32.ll?rev=164536&view=auto
==============================================================================
--- llvm/branches/R600/test/CodeGen/R600/fmul.v4f32.ll (added)
+++ llvm/branches/R600/test/CodeGen/R600/fmul.v4f32.ll Mon Sep 24 10:52:49 2012
@@ -0,0 +1,15 @@
+;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
+
+;CHECK: MUL_IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: MUL_IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: MUL_IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+;CHECK: MUL_IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+
+define void @test(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
+ %b_ptr = getelementptr <4 x float> addrspace(1)* %in, i32 1
+ %a = load <4 x float> addrspace(1) * %in
+ %b = load <4 x float> addrspace(1) * %b_ptr
+ %result = fmul <4 x float> %a, %b
+ store <4 x float> %result, <4 x float> addrspace(1)* %out
+ ret void
+}
More information about the llvm-branch-commits
mailing list