[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Apr 16 23:07:57 PDT 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.156 -> 1.157
---
Log message:

Learn how to make odd splatted constants in range [17,29].  This implements
PowerPC/vec_constants.ll:test_29.


---
Diffs of the changes:  (+7 -0)

 PPCISelLowering.cpp |    7 +++++++
 1 files changed, 7 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.156 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.157
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.156	Mon Apr 17 01:00:21 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Mon Apr 17 01:07:44 2006
@@ -1105,6 +1105,13 @@
       Op = BuildSplatI(SextVal >> 1, SplatSize, Op.getValueType(), DAG);
       return DAG.getNode(ISD::ADD, Op.getValueType(), Op, Op);
     }
+    // Otherwise, in range [17,29]:  (vsplti 15) + (vsplti C).
+    if (SextVal >= 0 && SextVal <= 29) {
+      SDOperand LHS = BuildSplatI(15, SplatSize, Op.getValueType(), DAG);
+      SDOperand RHS = BuildSplatI(SextVal-15, SplatSize, Op.getValueType(),DAG);
+      return DAG.getNode(ISD::ADD, Op.getValueType(), LHS, RHS);
+      
+    }
 
     
     // If this is 0x8000_0000 x 4, turn into vspltisw + vslw.  If it is 






More information about the llvm-commits mailing list