[llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jan 15 17:40:12 PST 2006



Changes in directory llvm/lib/Target/SparcV8:

SparcV8ISelDAGToDAG.cpp updated: 1.54 -> 1.55
---
Log message:

Silly Sparc is big endian.  If we have to load args out of incoming stack slots
that are smaller than an int, make sure to adjust the frame pointer to take
this into consideration.


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

 SparcV8ISelDAGToDAG.cpp |    4 ++++
 1 files changed, 4 insertions(+)


Index: llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
diff -u llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.54 llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.55
--- llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.54	Sun Jan 15 16:22:01 2006
+++ llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp	Sun Jan 15 19:40:00 2006
@@ -241,6 +241,10 @@
           unsigned LoadOp =
             I->getType()->isSigned() ? ISD::SEXTLOAD : ISD::ZEXTLOAD;
 
+          // Sparc is big endian, so add an offset based on the ObjectVT.
+          unsigned Offset = 4-std::max(1U, MVT::getSizeInBits(ObjectVT)/8);
+          FIPtr = DAG.getNode(ISD::ADD, MVT::i32, FIPtr,
+                              DAG.getConstant(Offset, MVT::i32));
           Load = DAG.getExtLoad(LoadOp, MVT::i32, Root, FIPtr,
                                 DAG.getSrcValue(0), ObjectVT);
           Load = DAG.getNode(ISD::TRUNCATE, ObjectVT, Load);






More information about the llvm-commits mailing list