Custom lower all BUILD_VECTOR's so that we can compile vec_splat_u8(8) into
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9FrameInfo.h
index 788730ad0efc2bc1aaeb31298528ee1d2c2d4692..eab72cc0e38e56fd7b2e1d12c7f6603727b6a761 100644 (file)
@@ -1,15 +1,13 @@
 //===-- SparcV9FrameInfo.h - Define TargetFrameInfo for SparcV9 -*- C++ -*-===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // Interface to stack frame layout info for the UltraSPARC.
-// Starting offsets for each area of the stack frame are aligned at
-// a multiple of getStackFrameSizeAlignment().
 //
 //----------------------------------------------------------------------------
 
@@ -27,15 +25,6 @@ class SparcV9FrameInfo: public TargetFrameInfo {
 public:
   SparcV9FrameInfo(const TargetMachine &TM)
     : TargetFrameInfo(StackGrowsDown, StackFrameSizeAlignment, 0), target(TM) {}
-  
-public:
-  // These methods provide constant parameters of the frame layout.
-  // 
-  int  getStackFrameSizeAlignment() const { return StackFrameSizeAlignment;}
-  int  getMinStackFrameSize()       const { return MinStackFrameSize; }
-  int  getNumFixedOutgoingArgs()    const { return NumFixedOutgoingArgs; }
-  int  getSizeOfEachArgOnStack()    const { return SizeOfEachArgOnStack; }
-  bool argsOnStackHaveFixedSize()   const { return true; }
 
   // This method adjusts a stack offset to meet alignment rules of target.
   // The fixed OFFSET (0x7ff) must be subtracted and the result aligned.
@@ -47,71 +36,27 @@ public:
   // These methods compute offsets using the frame contents for a
   // particular function.  The frame contents are obtained from the
   // MachineCodeInfoForMethod object for the given function.
-  // 
-  int getFirstIncomingArgOffset(MachineFunction& mcInfo, bool& growUp) const {
-    growUp = true;                         // arguments area grows upwards
-    return FirstIncomingArgOffsetFromFP;
-  }
-  int getFirstOutgoingArgOffset(MachineFunction& mcInfo, bool& growUp) const {
-    growUp = true;                         // arguments area grows upwards
-    return FirstOutgoingArgOffsetFromSP;
-  }
-  int getFirstOptionalOutgoingArgOffset(MachineFunction& mcInfo,
-                                        bool& growUp) const {
-    growUp = true;                         // arguments area grows upwards
-    return FirstOptionalOutgoingArgOffsetFromSP;
+  //
+  int getFirstAutomaticVarOffset(MachineFunction& mcInfo, bool& growUp) const {
+    growUp = false;
+    return StaticAreaOffsetFromFP;
   }
-  
-  int getFirstAutomaticVarOffset(MachineFunction& mcInfo, bool& growUp) const;
   int getRegSpillAreaOffset(MachineFunction& mcInfo, bool& growUp) const;
   int getTmpAreaOffset(MachineFunction& mcInfo, bool& growUp) const;
   int getDynamicAreaOffset(MachineFunction& mcInfo, bool& growUp) const;
 
-  //
-  // These methods specify the base register used for each stack area
-  // (generally FP or SP)
-  // 
-  virtual int getIncomingArgBaseRegNum() const {
-    return (int) target.getRegInfo()->getFramePointer();
-  }
-  virtual int getOutgoingArgBaseRegNum() const {
-    return (int) target.getRegInfo()->getStackPointer();
-  }
-  virtual int getOptionalOutgoingArgBaseRegNum() const {
-    return (int) target.getRegInfo()->getStackPointer();
-  }
-  virtual int getAutomaticVarBaseRegNum() const {
-    return (int) target.getRegInfo()->getFramePointer();
-  }
-  virtual int getRegSpillAreaBaseRegNum() const {
-    return (int) target.getRegInfo()->getFramePointer();
-  }
-  virtual int getDynamicAreaBaseRegNum() const {
-    return (int) target.getRegInfo()->getStackPointer();
-  }
-
-  virtual int getIncomingArgOffset(MachineFunction& mcInfo, 
+  virtual int getIncomingArgOffset(MachineFunction& mcInfo,
                                    unsigned argNum) const {
-    assert(argsOnStackHaveFixedSize()); 
-  
-    unsigned relativeOffset = argNum * getSizeOfEachArgOnStack();
-    bool growUp;                          // do args grow up or down
-    int firstArg = getFirstIncomingArgOffset(mcInfo, growUp);
-    return growUp ? firstArg + relativeOffset : firstArg - relativeOffset; 
+    unsigned relativeOffset = argNum * SizeOfEachArgOnStack;
+    int firstArg = FirstIncomingArgOffsetFromFP;
+    return firstArg + relativeOffset;
   }
 
   virtual int getOutgoingArgOffset(MachineFunction& mcInfo,
-                                  unsigned argNum) const {
-    assert(argsOnStackHaveFixedSize()); 
-    //assert(((int) argNum - this->getNumFixedOutgoingArgs())
-    //     <= (int) mcInfo.getInfo()->getMaxOptionalNumArgs());
-    
-    unsigned relativeOffset = argNum * getSizeOfEachArgOnStack();
-    bool growUp;                          // do args grow up or down
-    int firstArg = getFirstOutgoingArgOffset(mcInfo, growUp);
-    return growUp ? firstArg + relativeOffset : firstArg - relativeOffset; 
+                                   unsigned argNum) const {
+    return FirstOutgoingArgOffsetFromSP + argNum * SizeOfEachArgOnStack;
   }
-  
+
   /*----------------------------------------------------------------------
     This diagram shows the stack frame layout used by llc on SparcV9 V9.
     Note that only the location of automatic variables, spill area,
@@ -127,7 +72,7 @@ public:
         during a call to another function, so it is never needed when
         the current function is active.  This is why space can be allocated
         dynamically by incrementing %sp any time within the function.
-    
+
     STACK FRAME LAYOUT:
 
        ...
@@ -159,7 +104,6 @@ public:
   static const int OFFSET                                  = (int) 0x7ff;
   static const int StackFrameSizeAlignment                 =  16;
   static const int MinStackFrameSize                       = 176;
-  static const int NumFixedOutgoingArgs                    =   6;
   static const int SizeOfEachArgOnStack                    =   8;
   static const int FirstIncomingArgOffsetFromFP            = 128 + OFFSET;
   static const int FirstOptionalIncomingArgOffsetFromFP    = 176 + OFFSET;