[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Evan Cheng
evan.cheng at apple.com
Thu Jan 11 18:11:02 PST 2007
Changes in directory llvm/include/llvm/Target:
TargetLowering.h updated: 1.97 -> 1.98
---
Log message:
Store default libgcc routine names and allow them to be redefined by target.
---
Diffs of the changes: (+108 -1)
TargetLowering.h | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 108 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.97 llvm/include/llvm/Target/TargetLowering.h:1.98
--- llvm/include/llvm/Target/TargetLowering.h:1.97 Thu Jan 11 12:21:28 2007
+++ llvm/include/llvm/Target/TargetLowering.h Thu Jan 11 20:10:46 2007
@@ -38,6 +38,93 @@
class MachineBasicBlock;
class MachineInstr;
+namespace RTLIB {
+ /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
+ /// the backend can emit.
+ ///
+ enum Libcall {
+ // Integer
+ SHL_I32,
+ SHL_I64,
+ SRL_I32,
+ SRL_I64,
+ SRA_I32,
+ SRA_I64,
+ MUL_I32,
+ MUL_I64,
+ SDIV_I32,
+ SDIV_I64,
+ UDIV_I32,
+ UDIV_I64,
+ SREM_I32,
+ SREM_I64,
+ UREM_I32,
+ UREM_I64,
+ NEG_I32,
+ NEG_I64,
+
+ // FLOATING POINT
+ ADD_F32,
+ ADD_F64,
+ SUB_F32,
+ SUB_F64,
+ MUL_F32,
+ MUL_F64,
+ DIV_F32,
+ DIV_F64,
+ REM_F32,
+ REM_F64,
+ NEG_F32,
+ NEG_F64,
+ POWI_F32,
+ POWI_F64,
+ SQRT_F32,
+ SQRT_F64,
+ SIN_F32,
+ SIN_F64,
+ COS_F32,
+ COS_F64,
+
+ // CONVERSION
+ FPEXT_F32_F64,
+ FPROUND_F64_F32,
+ FPTOSINT_F32_I32,
+ FPTOSINT_F32_I64,
+ FPTOSINT_F64_I32,
+ FPTOSINT_F64_I64,
+ FPTOUINT_F32_I32,
+ FPTOUINT_F32_I64,
+ FPTOUINT_F64_I32,
+ FPTOUINT_F64_I64,
+ SINTTOFP_I32_F32,
+ SINTTOFP_I32_F64,
+ SINTTOFP_I64_F32,
+ SINTTOFP_I64_F64,
+ UINTTOFP_I32_F32,
+ UINTTOFP_I32_F64,
+ UINTTOFP_I64_F32,
+ UINTTOFP_I64_F64,
+
+ // COMPARISON
+ OEQ_F32,
+ OEQ_F64,
+ UNE_F32,
+ UNE_F64,
+ OGE_F32,
+ OGE_F64,
+ OLT_F32,
+ OLT_F64,
+ OLE_F32,
+ OLE_F64,
+ OGT_F32,
+ OGT_F64,
+ UO_F32,
+ UO_F64,
+
+ UNKNOWN_LIBCALL
+ };
+ }
+
//===----------------------------------------------------------------------===//
/// TargetLowering - This class defines information used to lower LLVM code to
/// legal SelectionDAG operators that the target instruction selector can accept
@@ -857,6 +944,22 @@
std::vector<SDNode*>* Created) const;
+ //===--------------------------------------------------------------------===//
+ // Runtime Library hooks
+ //
+
+ /// setLibcallName - Rename the default libcall routine name for the specified
+ /// libcall.
+ void setLibcallName(RTLIB::Libcall Call, std::string Name) {
+ LibcallRoutineNames[Call] = Name;
+ }
+
+ /// getLibcallName - Get the libcall routine name for the specified libcall.
+ ///
+ const char *getLibcallName(RTLIB::Libcall Call) const {
+ return LibcallRoutineNames[Call].c_str();
+ }
+
protected:
/// addLegalAddressScale - Add a integer (> 1) value which can be used as
/// scale in the target addressing mode. Note: the ordering matters so the
@@ -989,7 +1092,11 @@
/// Targets add entries to this map with AddPromotedToType(..), clients access
/// this with getTypeToPromoteTo(..).
std::map<std::pair<unsigned, MVT::ValueType>, MVT::ValueType> PromoteToType;
-
+
+ /// LibcallRoutineNames - Stores the name each libcall.
+ ///
+ std::string LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL];
+
protected:
/// When lowering %llvm.memset this field specifies the maximum number of
/// store operations that may be substituted for the call to memset. Targets
More information about the llvm-commits
mailing list