[Mesa-dev] [PATCH] radeon/llvm: support for vectorised select

Vincent Lejeune vljn at ovi.com
Tue Sep 11 13:34:18 PDT 2012


Conflicts:
	src/gallium/drivers/radeon/R600ISelLowering.cpp
---
 src/gallium/drivers/radeon/R600ISelLowering.cpp | 13 +++++++++++++
 src/gallium/drivers/radeon/R600ISelLowering.h   |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp
index 5642ee8..599a758 100644
--- a/src/gallium/drivers/radeon/R600ISelLowering.cpp
+++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp
@@ -48,10 +48,23 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) :
 
   setOperationAction(ISD::SETCC, MVT::i32, Custom);
   setOperationAction(ISD::SETCC, MVT::f32, Custom);
+  setOperationAction(ISD::SETCC, MVT::v4i32, Expand);
   setOperationAction(ISD::FP_TO_UINT, MVT::i1, Custom);
+  
+  setOperationAction(ISD::SELECT, MVT::v4f32, Expand);
+  setOperationAction(ISD::SELECT, MVT::v4i32, Expand);
+  
+  setOperationAction(ISD::VSELECT, MVT::v4f32, Expand);
+  setOperationAction(ISD::VSELECT, MVT::v4i32, Expand);
   setSchedulingPreference(Sched::VLIW);
 }
 
+EVT R600TargetLowering::getSetCCResultType(EVT VT) const
+{
+   if (!VT.isVector()) return MVT::i32;
+   return VT.changeVectorElementTypeToInteger();
+}
+
 MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter(
     MachineInstr * MI, MachineBasicBlock * BB) const
 {
diff --git a/src/gallium/drivers/radeon/R600ISelLowering.h b/src/gallium/drivers/radeon/R600ISelLowering.h
index 49ea272..b090946 100644
--- a/src/gallium/drivers/radeon/R600ISelLowering.h
+++ b/src/gallium/drivers/radeon/R600ISelLowering.h
@@ -30,6 +30,8 @@ public:
   void ReplaceNodeResults(SDNode * N,
       SmallVectorImpl<SDValue> &Results,
       SelectionDAG &DAG) const;
+  
+  EVT getSetCCResultType(EVT VT) const;
 private:
   const R600InstrInfo * TII;
 
-- 
1.7.11.4



More information about the mesa-dev mailing list