blob: 924691d70c968f6fa8db0c64fd7e3ebe2227812b [file] [log] [blame]
Duraid Madinaf221c262005-10-28 17:46:35 +00001//===-- IA64ISelLowering.h - IA64 DAG Lowering Interface --------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Duraid Madina and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
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.
26 FIRST_NUMBER = ISD::BUILTIN_OP_END+IA64::INSTRUCTION_LIST_END,
27
28 /// FSEL - Traditional three-operand fsel node.
29 ///
30 FSEL,
31
32 /// FCFID - The FCFID instruction, taking an f64 operand and producing
33 /// and f64 value containing the FP representation of the integer that
34 /// was temporarily in the f64 operand.
35 FCFID,
36
37 /// FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64
38 /// operand, producing an f64 value containing the integer representation
39 /// of that FP value.
40 FCTIDZ, FCTIWZ,
Duraid Madinab1d57fb2005-12-22 06:41:39 +000041
42 /// GETFD - the getf.d instruction takes a floating point operand and
43 /// returns its 64-bit memory representation as an i64
44 GETFD
Duraid Madinaf221c262005-10-28 17:46:35 +000045 };
46 }
47
48 class IA64TargetLowering : public TargetLowering {
49 int VarArgsFrameIndex; // FrameIndex for start of varargs area.
50 //int ReturnAddrIndex; // FrameIndex for return slot.
51 unsigned GP, SP, RP; // FIXME - clean this mess up
52
53 public:
54 IA64TargetLowering(TargetMachine &TM);
55
56 unsigned VirtGPR; // this is public so it can be accessed in the selector
57 // for ISD::RET. add an accessor instead? FIXME
58
59 /// LowerOperation - Provide custom lowering hooks for some operations.
60 ///
61// XXX virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
62
63 /// LowerArguments - This hook must be implemented to indicate how we should
64 /// lower the arguments for the specified function, into the specified DAG.
65 virtual std::vector<SDOperand>
66 LowerArguments(Function &F, SelectionDAG &DAG);
67
68 /// LowerCallTo - This hook lowers an abstract call to a function into an
69 /// actual call.
70 virtual std::pair<SDOperand, SDOperand>
71 LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
72 unsigned CC,
73 bool isTailCall, SDOperand Callee, ArgListTy &Args,
74 SelectionDAG &DAG);
75
76 virtual SDOperand LowerVAStart(SDOperand Chain, SDOperand VAListP,
77 Value *VAListV, SelectionDAG &DAG);
78
79 virtual std::pair<SDOperand,SDOperand>
80 LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
81 const Type *ArgTy, SelectionDAG &DAG);
82
83 virtual std::pair<SDOperand, SDOperand>
84 LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
85 SelectionDAG &DAG);
86
87// XXX virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI,
88// XXX MachineBasicBlock *MBB);
89 };
90}
91
92#endif // LLVM_TARGET_IA64_IA64ISELLOWERING_H