diff options
author | Tom Stellard <[email protected]> | 2012-07-30 15:23:21 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-07-30 21:10:13 +0000 |
commit | 27ae41c83dafcec09e870b3cf08b060064dbb122 (patch) | |
tree | 9d7a306cc193d09fa3e9cec719aa69e63c9357cd /src/gallium/drivers/radeon/AMDGPUISelLowering.h | |
parent | c96490e3b5ea0e369837dbb8067cf3d6b0d6b767 (diff) |
radeon/llvm: Merge AMDILTargetLowering class into AMDGPUTargetLowering
Diffstat (limited to 'src/gallium/drivers/radeon/AMDGPUISelLowering.h')
-rw-r--r-- | src/gallium/drivers/radeon/AMDGPUISelLowering.h | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeon/AMDGPUISelLowering.h b/src/gallium/drivers/radeon/AMDGPUISelLowering.h index 3052247f102..c0945cd8dec 100644 --- a/src/gallium/drivers/radeon/AMDGPUISelLowering.h +++ b/src/gallium/drivers/radeon/AMDGPUISelLowering.h @@ -15,11 +15,13 @@ #ifndef AMDGPUISELLOWERING_H #define AMDGPUISELLOWERING_H -#include "AMDILISelLowering.h" +#include "llvm/Target/TargetLowering.h" namespace llvm { -class AMDGPUTargetLowering : public AMDILTargetLowering +class MachineRegisterInfo; + +class AMDGPUTargetLowering : public TargetLowering { private: SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const; @@ -60,6 +62,44 @@ public: SDValue LowerIntrinsicLRP(SDValue Op, SelectionDAG &DAG) const; virtual const char* getTargetNodeName(unsigned Opcode) const; +// Functions defined in AMDILISelLowering.cpp +public: + + /// computeMaskedBitsForTargetNode - Determine which of the bits specified + /// in Mask are known to be either zero or one and return them in the + /// KnownZero/KnownOne bitsets. + virtual void computeMaskedBitsForTargetNode(const SDValue Op, + APInt &KnownZero, + APInt &KnownOne, + const SelectionDAG &DAG, + unsigned Depth = 0) const; + + virtual bool getTgtMemIntrinsic(IntrinsicInfo &Info, + const CallInst &I, unsigned Intrinsic) const; + + /// isFPImmLegal - We want to mark f32/f64 floating point values as legal. + bool isFPImmLegal(const APFloat &Imm, EVT VT) const; + + /// ShouldShrinkFPConstant - We don't want to shrink f64/f32 constants. + bool ShouldShrinkFPConstant(EVT VT) const; + +private: + void InitAMDILLowering(); + SDValue LowerSREM(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSREM8(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSREM16(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSREM32(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSREM64(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSDIV(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSDIV24(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSDIV32(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSDIV64(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const; + EVT genIntType(uint32_t size = 32, uint32_t numEle = 1) const; + SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const; }; namespace AMDGPUISD @@ -67,7 +107,17 @@ namespace AMDGPUISD enum { - AMDGPU_FIRST = AMDILISD::LAST_ISD_NUMBER, + // AMDIL ISD Opcodes + FIRST_NUMBER = ISD::BUILTIN_OP_END, + CMOVLOG, // 32bit FP Conditional move logical instruction + MAD, // 32bit Fused Multiply Add instruction + VBUILD, // scalar to vector mov instruction + CALL, // Function call based on a single integer + UMUL, // 32bit unsigned multiplication + DIV_INF, // Divide with infinity returned on zero divisor + RET_FLAG, + BRANCH_COND, + // End AMDIL ISD Opcodes BITALIGN, FRACT, FMAX, |