aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetLowering.h
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-08-09 01:04:01 +0000
committerDale Johannesen <dalej@apple.com>2007-08-09 01:04:01 +0000
commit5411a3937f4303f9c3fc50be92f985a4532d95e6 (patch)
tree90394f22a626d92d93f7963d8dbd7e56d1152ba5 /include/llvm/Target/TargetLowering.h
parent48bd15ed72bcf9464989516c078ed9d15030c95e (diff)
downloadexternal_llvm-5411a3937f4303f9c3fc50be92f985a4532d95e6.zip
external_llvm-5411a3937f4303f9c3fc50be92f985a4532d95e6.tar.gz
external_llvm-5411a3937f4303f9c3fc50be92f985a4532d95e6.tar.bz2
long double 9 of N. This finishes up the X86-32 bits
(constants are still not handled). Adds ConvertActions to control fp-to-fp conversions (these are currently defaulted for all other targets, so no changes there). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLowering.h')
-rw-r--r--include/llvm/Target/TargetLowering.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index c22d399..6295939 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -327,6 +327,24 @@ public:
getIndexedStoreAction(IdxMode, VT) == Custom;
}
+ /// getConvertAction - Return how the conversion should be treated:
+ /// either it is legal, needs to be promoted to a larger size, needs to be
+ /// expanded to some other code sequence, or the target has a custom expander
+ /// for it.
+ LegalizeAction
+ getConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT) const {
+ if (MVT::isExtendedVT(ToVT) || MVT::isExtendedVT(FromVT))
+ return Expand;
+ return (LegalizeAction)((ConvertActions[FromVT] >> (2*ToVT)) & 3);
+ }
+
+ /// isConvertLegal - Return true if the specified conversion is legal
+ /// on this target.
+ bool isConvertLegal(MVT::ValueType FromVT, MVT::ValueType ToVT) const {
+ return getConvertAction(FromVT, ToVT) == Legal ||
+ getConvertAction(FromVT, ToVT) == Custom;
+ }
+
/// getTypeToPromoteTo - If the action for this operation is to promote, this
/// method returns the ValueType to promote to.
MVT::ValueType getTypeToPromoteTo(unsigned Op, MVT::ValueType VT) const {
@@ -742,6 +760,16 @@ protected:
IndexedModeActions[1][IdxMode] |= (uint64_t)Action << VT*2;
}
+ /// setConvertAction - Indicate that the specified conversion does or does
+ /// not work with the with specified type and indicate what to do about it.
+ void setConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT,
+ LegalizeAction Action) {
+ assert(FromVT < MVT::LAST_VALUETYPE && ToVT < 32 &&
+ "Table isn't big enough!");
+ ConvertActions[FromVT] &= ~(uint64_t(3UL) << ToVT*2);
+ ConvertActions[FromVT] |= (uint64_t)Action << ToVT*2;
+ }
+
/// AddPromotedToType - If Opc/OrigVT is specified as being promoted, the
/// promotion code defaults to trying a larger integer/fp until it can find
/// one that works. If that default is insufficient, this method can be used
@@ -1081,6 +1109,13 @@ private:
/// deal with the load / store.
uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];
+ /// ConvertActions - For each conversion from source type to destination type,
+ /// keep a LegalizeAction that indicates how instruction selection should
+ /// deal with the conversion.
+ /// Currently, this is used only for floating->floating conversions
+ /// (FP_EXTEND and FP_ROUND).
+ uint64_t ConvertActions[MVT::LAST_VALUETYPE];
+
ValueTypeActionImpl ValueTypeActions;
std::vector<double> LegalFPImmediates;