blob: b8b876c51b79e75b54a3f1a91d743f0422e308b1 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- IA64ISelLowering.h - IA64 DAG Lowering Interface --------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the interfaces that IA64 uses to lower LLVM code into a
11// selection DAG.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TARGET_IA64_IA64ISELLOWERING_H
16#define LLVM_TARGET_IA64_IA64ISELLOWERING_H
17
18#include "llvm/Target/TargetLowering.h"
19#include "llvm/CodeGen/SelectionDAG.h"
20#include "IA64.h"
21
22namespace llvm {
23 namespace IA64ISD {
24 enum NodeType {
25 // Start the numbering where the builting ops and target ops leave off.
Dan Gohman868636e2008-09-23 18:42:32 +000026 FIRST_NUMBER = ISD::BUILTIN_OP_END,
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027
28 /// GETFD - the getf.d instruction takes a floating point operand and
29 /// returns its 64-bit memory representation as an i64
30 GETFD,
31
32 // TODO: explain this hack
33 BRCALL,
34
35 // RET_FLAG - Return with a flag operand
36 RET_FLAG
37 };
38 }
39
40 class IA64TargetLowering : public TargetLowering {
41 int VarArgsFrameIndex; // FrameIndex for start of varargs area.
42 //int ReturnAddrIndex; // FrameIndex for return slot.
43 unsigned GP, SP, RP; // FIXME - clean this mess up
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044 public:
Dan Gohman3a78bbf2007-08-02 21:21:54 +000045 explicit IA64TargetLowering(TargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046
47 unsigned VirtGPR; // this is public so it can be accessed in the selector
48 // for ISD::RET. add an accessor instead? FIXME
Dan Gohmanf17a25c2007-07-18 16:29:46 +000049 const char *getTargetNodeName(unsigned Opcode) const;
Scott Michel978b96f2008-03-10 23:49:09 +000050
51 /// getSetCCResultType: return ISD::SETCC's result type.
Dan Gohman8181bd12008-07-27 21:46:04 +000052 virtual MVT getSetCCResultType(const SDValue &) const;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000053
54 /// LowerArguments - This hook must be implemented to indicate how we should
55 /// lower the arguments for the specified function, into the specified DAG.
Dan Gohmane0208142008-06-30 20:31:15 +000056 virtual void LowerArguments(Function &F, SelectionDAG &DAG,
Dan Gohman8181bd12008-07-27 21:46:04 +000057 SmallVectorImpl<SDValue> &ArgValues);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058
59 /// LowerCallTo - This hook lowers an abstract call to a function into an
60 /// actual call.
Dan Gohman8181bd12008-07-27 21:46:04 +000061 virtual std::pair<SDValue, SDValue>
62 LowerCallTo(SDValue Chain, const Type *RetTy,
Dale Johannesen67cc9b62008-09-26 19:31:26 +000063 bool RetSExt, bool RetZExt, bool isVarArg, bool isInreg,
Duncan Sandsead972e2008-02-14 17:28:50 +000064 unsigned CC, bool isTailCall,
Dan Gohman8181bd12008-07-27 21:46:04 +000065 SDValue Callee, ArgListTy &Args, SelectionDAG &DAG);
Duncan Sandsead972e2008-02-14 17:28:50 +000066
Dan Gohmanf17a25c2007-07-18 16:29:46 +000067 /// LowerOperation - for custom lowering specific ops
68 /// (currently, only "ret void")
Dan Gohman8181bd12008-07-27 21:46:04 +000069 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000070
Dan Gohmanf17a25c2007-07-18 16:29:46 +000071 };
72}
73
74#endif // LLVM_TARGET_IA64_IA64ISELLOWERING_H