radeonsi: Fix sampler views for depth textures.
[mesa.git] / src / gallium / drivers / radeon / R600ISelLowering.h
1 //===-- R600ISelLowering.h - R600 DAG Lowering Interface -*- C++ -*--------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // R600 DAG Lowering interface definition
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef R600ISELLOWERING_H
15 #define R600ISELLOWERING_H
16
17 #include "AMDGPUISelLowering.h"
18
19 namespace llvm {
20
21 class R600InstrInfo;
22
23 class R600TargetLowering : public AMDGPUTargetLowering
24 {
25 public:
26 R600TargetLowering(TargetMachine &TM);
27 virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI,
28 MachineBasicBlock * BB) const;
29 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
30 virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
31 void ReplaceNodeResults(SDNode * N,
32 SmallVectorImpl<SDValue> &Results,
33 SelectionDAG &DAG) const;
34 virtual SDValue LowerFormalArguments(
35 SDValue Chain,
36 CallingConv::ID CallConv,
37 bool isVarArg,
38 const SmallVectorImpl<ISD::InputArg> &Ins,
39 DebugLoc DL, SelectionDAG &DAG,
40 SmallVectorImpl<SDValue> &InVals) const;
41 private:
42 const R600InstrInfo * TII;
43
44 /// lowerImplicitParameter - Each OpenCL kernel has nine implicit parameters
45 /// that are stored in the first nine dwords of a Vertex Buffer. These
46 /// implicit parameters are lowered to load instructions which retreive the
47 /// values from the Vertex Buffer.
48 SDValue LowerImplicitParameter(SelectionDAG &DAG, EVT VT,
49 DebugLoc DL, unsigned DwordOffset) const;
50
51 void lowerImplicitParameter(MachineInstr *MI, MachineBasicBlock &BB,
52 MachineRegisterInfo & MRI, unsigned dword_offset) const;
53
54 SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
55
56 /// LowerROTL - Lower ROTL opcode to BITALIGN
57 SDValue LowerROTL(SDValue Op, SelectionDAG &DAG) const;
58
59 SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
60 SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
61 SDValue LowerInputFace(SDNode *Op, SelectionDAG &DAG) const;
62 SDValue LowerFPTOUINT(SDValue Op, SelectionDAG &DAG) const;
63
64 bool isZero(SDValue Op) const;
65 };
66
67 } // End namespace llvm;
68
69 #endif // R600ISELLOWERING_H