[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 7 12:41:35 PDT 2005



Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.8 -> 1.9
---
Log message:

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.


---
Diffs of the changes:  (+23 -1)

 TargetLowering.h |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.8 llvm/include/llvm/Target/TargetLowering.h:1.9
--- llvm/include/llvm/Target/TargetLowering.h:1.8	Fri Mar 25 19:30:30 2005
+++ llvm/include/llvm/Target/TargetLowering.h	Thu Apr  7 14:41:18 2005
@@ -59,6 +59,12 @@
     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 @@
   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 @@
   /// 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 @@
   /// 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];






More information about the llvm-commits mailing list