summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-07 19:41:18 +0000
committerChris Lattner <sabre@nondot.org>2005-04-07 19:41:18 +0000
commit7b5987d56e194cea0364433a838abc2d6844e047 (patch)
treef647c7065effd40e4a094983e39696149307b158 /include
parent2467392c5931579e2354b9e64e8ecf6cc5192d13 (diff)
downloadllvm-7b5987d56e194cea0364433a838abc2d6844e047.tar.gz
llvm-7b5987d56e194cea0364433a838abc2d6844e047.tar.bz2
llvm-7b5987d56e194cea0364433a838abc2d6844e047.tar.xz
Allow targets which produce setcc results in non-MVT::i1 registers to describe
what the contents of the top bits of these registers are, in the common cases of targets that sign and zero extend the results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 15a5cb9ad5..347fe74839 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -59,6 +59,12 @@ public:
Extend, // Oversized shift pulls in zeros or sign bits.
};
+ enum SetCCResultValue {
+ UndefinedSetCCResult, // SetCC returns a garbage/unknown extend.
+ ZeroOrOneSetCCResult, // SetCC returns a zero extended result.
+ ZeroOrNegativeOneSetCCResult, // SetCC returns a sign extended result.
+ };
+
TargetLowering(TargetMachine &TM);
virtual ~TargetLowering();
@@ -68,9 +74,17 @@ public:
bool isLittleEndian() const { return IsLittleEndian; }
MVT::ValueType getPointerTy() const { return PointerTy; }
MVT::ValueType getShiftAmountTy() const { return ShiftAmountTy; }
- MVT::ValueType getSetCCResultTy() const { return SetCCResultTy; }
OutOfRangeShiftAmount getShiftAmountFlavor() const {return ShiftAmtHandling; }
+ /// getSetCCResultTy - Return the ValueType of the result of setcc operations.
+ ///
+ MVT::ValueType getSetCCResultTy() const { return SetCCResultTy; }
+
+ /// getSetCCResultContents - For targets without boolean registers, this flag
+ /// returns information about the contents of the high-bits in the setcc
+ /// result register.
+ SetCCResultValue getSetCCResultContents() const { return SetCCResultContents;}
+
/// getRegClassFor - Return the register class that should be used for the
/// specified value type. This may only be called on legal types.
TargetRegisterClass *getRegClassFor(MVT::ValueType VT) const {
@@ -183,6 +197,10 @@ protected:
/// of a setcc operation. This defaults to the pointer type.
void setSetCCResultType(MVT::ValueType VT) { SetCCResultTy = VT; }
+ /// setSetCCResultContents - Specify how the target extends the result of a
+ /// setcc operation in a register.
+ void setSetCCResultContents(SetCCResultValue Ty) { SetCCResultContents = Ty; }
+
/// setShiftAmountFlavor - Describe how the target handles out of range shift
/// amounts.
void setShiftAmountFlavor(OutOfRangeShiftAmount OORSA) {
@@ -296,6 +314,10 @@ private:
/// PointerTy.
MVT::ValueType SetCCResultTy;
+ /// SetCCResultContents - Information about the contents of the high-bits in
+ /// the result of a setcc comparison operation.
+ SetCCResultValue SetCCResultContents;
+
/// RegClassForVT - This indicates the default register class to use for
/// each ValueType the target supports natively.
TargetRegisterClass *RegClassForVT[MVT::LAST_VALUETYPE];