summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-12-06 06:18:55 +0000
committerNate Begeman <natebegeman@mac.com>2005-12-06 06:18:55 +0000
commit41b1cdc771664a062590482c1bf8b067d932c8cc (patch)
tree829aafbafbc9c3c28cd700ac8a90ba4c5c9a3fbc /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentfea33f7e6457cb73d51bdb620e58f08c26bc3d99 (diff)
downloadbcm5719-llvm-41b1cdc771664a062590482c1bf8b067d932c8cc.tar.gz
bcm5719-llvm-41b1cdc771664a062590482c1bf8b067d932c8cc.zip
Teach the SelectionDAG ISel how to turn ConstantPacked values into
constant nodes with vector types. Also teach the asm printer how to print ConstantPacked constant pool entries. This allows us to generate altivec code such as the following, which adds a vector constantto a packed float. LCPI1_0: <4 x float> < float 0.0e+0, float 0.0e+0, float 0.0e+0, float 1.0e+0 > .space 4 .space 4 .space 4 .long 1065353216 ; float 1 .text .align 4 .globl _foo _foo: lis r2, ha16(LCPI1_0) la r2, lo16(LCPI1_0)(r2) li r4, 0 lvx v0, r4, r2 lvx v1, r4, r3 vaddfp v0, v1, v0 stvx v0, r4, r3 blr For the llvm code: void %foo(<4 x float> * %a) { entry: %tmp1 = load <4 x float> * %a; %tmp2 = add <4 x float> %tmp1, < float 0.0, float 0.0, float 0.0, float 1.0 > store <4 x float> %tmp2, <4 x float> *%a ret void } llvm-svn: 24616
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 0605352f9fc..f9ea84f3010 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -501,8 +501,6 @@ SDOperand SelectionDAG::getConstantFP(double Val, MVT::ValueType VT) {
return SDOperand(N, 0);
}
-
-
SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV,
MVT::ValueType VT, int offset) {
SDNode *&N = GlobalValues[std::make_pair(GV, offset)];
@@ -1837,6 +1835,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::Constant: return "Constant";
case ISD::TargetConstant: return "TargetConstant";
case ISD::ConstantFP: return "ConstantFP";
+ case ISD::ConstantVec: return "ConstantVec";
case ISD::GlobalAddress: return "GlobalAddress";
case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
case ISD::FrameIndex: return "FrameIndex";
OpenPOWER on IntegriCloud