mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	Add an isNegative method to determine if the APInt's value is negative.
This is much less expensive than a test against zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -352,6 +352,13 @@ public: | |||||||
|     return !slt(RHS); |     return !slt(RHS); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /// This just tests the high bit of this APInt to determine if it is negative. | ||||||
|  |   /// @returns true if this APInt is negative, false otherwise | ||||||
|  |   /// @brief Determine sign of this APInt. | ||||||
|  |   bool isNegative() { | ||||||
|  |     return (*this)[BitWidth - 1]; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /// Arithmetic right-shift this APInt by shiftAmt. |   /// Arithmetic right-shift this APInt by shiftAmt. | ||||||
|   /// @brief Arithmetic right-shift function. |   /// @brief Arithmetic right-shift function. | ||||||
|   APInt ashr(uint32_t shiftAmt) const; |   APInt ashr(uint32_t shiftAmt) const; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user