1 //===-- MipsISelLowering.h - Mips DAG Lowering Interface --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Bruno Cardoso Lopes and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the interfaces that Mips uses to lower LLVM code into a
13 //===----------------------------------------------------------------------===//
15 #ifndef MipsISELLOWERING_H
16 #define MipsISELLOWERING_H
18 #include "llvm/CodeGen/SelectionDAG.h"
19 #include "llvm/Target/TargetLowering.h"
21 #include "MipsSubtarget.h"
26 // Start the numbering from where ISD NodeType finishes.
27 FIRST_NUMBER = ISD::BUILTIN_OP_END+Mips::INSTRUCTION_LIST_END,
29 // Jump and link (call)
32 // Get the Higher 16 bits from a 32-bit immediate
33 // No relation with Mips Hi register
36 // Get the Lower 16 bits from a 32-bit immediate
37 // No relation with Mips Lo register
43 // Need to support addition with a input flag
48 //===--------------------------------------------------------------------===//
49 // TargetLowering Implementation
50 //===--------------------------------------------------------------------===//
51 class MipsTargetLowering : public TargetLowering
53 // FrameIndex for return slot.
56 // const MipsSubtarget &MipsSubTarget;
59 explicit MipsTargetLowering(MipsTargetMachine &TM);
61 /// LowerOperation - Provide custom lowering hooks for some operations.
62 virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
64 /// getTargetNodeName - This method returns the name of a target specific
66 virtual const char *getTargetNodeName(unsigned Opcode) const;
69 // Lower Operand helpers
70 SDOperand LowerCCCArguments(SDOperand Op, SelectionDAG &DAG);
71 SDOperand LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC);
72 SDNode *LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode*TheCall,
73 unsigned CallingConv, SelectionDAG &DAG);
74 SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG);
76 // Lower Operand specifics
77 SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG);
78 SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG);
79 SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
80 SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
81 SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
84 ConstraintType getConstraintType(const std::string &Constraint) const;
86 std::pair<unsigned, const TargetRegisterClass*>
87 getRegForInlineAsmConstraint(const std::string &Constraint,
88 MVT::ValueType VT) const;
91 getRegClassForInlineAsmConstraint(const std::string &Constraint,
92 MVT::ValueType VT) const;
96 #endif // MipsISELLOWERING_H