Fix part 1 of pr4682. PICADD is a 16-bit instruction even in thumb2 mode.
[llvm/avr.git] / lib / Target / Blackfin / BlackfinISelLowering.h
blob7acbd1a8e58f258163091ba8f1ec25b9955bf423
1 //===- BlackfinISelLowering.h - Blackfin 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 // This file defines the interfaces that Blackfin uses to lower LLVM code into a
11 // selection DAG.
13 //===----------------------------------------------------------------------===//
15 #ifndef BLACKFIN_ISELLOWERING_H
16 #define BLACKFIN_ISELLOWERING_H
18 #include "llvm/Target/TargetLowering.h"
19 #include "Blackfin.h"
21 namespace llvm {
23 namespace BFISD {
24 enum {
25 FIRST_NUMBER = ISD::BUILTIN_OP_END,
26 CALL, // A call instruction.
27 RET_FLAG, // Return with a flag operand.
28 Wrapper // Address wrapper
32 class BlackfinTargetLowering : public TargetLowering {
33 int VarArgsFrameOffset; // Frame offset to start of varargs area.
34 public:
35 BlackfinTargetLowering(TargetMachine &TM);
36 virtual MVT getSetCCResultType(MVT VT) const;
37 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
39 int getVarArgsFrameOffset() const { return VarArgsFrameOffset; }
41 ConstraintType getConstraintType(const std::string &Constraint) const;
42 std::pair<unsigned, const TargetRegisterClass*>
43 getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const;
44 std::vector<unsigned>
45 getRegClassForInlineAsmConstraint(const std::string &Constraint,
46 MVT VT) const;
47 virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
48 const char *getTargetNodeName(unsigned Opcode) const;
49 unsigned getFunctionAlignment(const Function *F) const;
51 private:
52 SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG);
53 SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG);
54 SDValue LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG);
55 SDValue LowerRET(SDValue Op, SelectionDAG &DAG);
56 SDValue LowerCALL(SDValue Op, SelectionDAG &DAG);
57 SDValue LowerADDE(SDValue Op, SelectionDAG &DAG);
59 } // end namespace llvm
61 #endif // BLACKFIN_ISELLOWERING_H