mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	R600: Add helper functions.
Extract these from some of my other patches, since this is the only thing really making them dependent on each other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -84,6 +84,25 @@ static bool allocateStack(unsigned ValNo, MVT ValVT, MVT LocVT,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "AMDGPUGenCallingConv.inc"
 | 
					#include "AMDGPUGenCallingConv.inc"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Find a larger type to do a load / store of a vector with.
 | 
				
			||||||
 | 
					EVT AMDGPUTargetLowering::getEquivalentMemType(LLVMContext &Ctx, EVT VT) {
 | 
				
			||||||
 | 
					  unsigned StoreSize = VT.getStoreSizeInBits();
 | 
				
			||||||
 | 
					  if (StoreSize <= 32)
 | 
				
			||||||
 | 
					    return EVT::getIntegerVT(Ctx, StoreSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  assert(StoreSize % 32 == 0 && "Store size not a multiple of 32");
 | 
				
			||||||
 | 
					  return EVT::getVectorVT(Ctx, MVT::i32, StoreSize / 32);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Type for a vector that will be loaded to.
 | 
				
			||||||
 | 
					EVT AMDGPUTargetLowering::getEquivalentLoadRegType(LLVMContext &Ctx, EVT VT) {
 | 
				
			||||||
 | 
					  unsigned StoreSize = VT.getStoreSizeInBits();
 | 
				
			||||||
 | 
					  if (StoreSize <= 32)
 | 
				
			||||||
 | 
					    return EVT::getIntegerVT(Ctx, 32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return EVT::getVectorVT(Ctx, MVT::i32, StoreSize / 32);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
 | 
					AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
 | 
				
			||||||
  TargetLowering(TM, new TargetLoweringObjectFileELF()) {
 | 
					  TargetLowering(TM, new TargetLoweringObjectFileELF()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,6 +46,8 @@ private:
 | 
				
			|||||||
  SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
 | 
					  SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
 | 
					  static EVT getEquivalentMemType(LLVMContext &Context, EVT VT);
 | 
				
			||||||
 | 
					  static EVT getEquivalentLoadRegType(LLVMContext &Context, EVT VT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /// \brief Helper function that adds Reg to the LiveIn list of the DAG's
 | 
					  /// \brief Helper function that adds Reg to the LiveIn list of the DAG's
 | 
				
			||||||
  /// MachineFunction.
 | 
					  /// MachineFunction.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user