[llvm] 3b83590 - [NFC] [Support] Fix unconsistent comment with codes for ExtendSigned

Chuanqi Xu via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 22:59:11 PDT 2021


Author: Chuanqi Xu
Date: 2021-03-24T13:58:54+08:00
New Revision: 3b83590cb25bd88d13289eac55ba98a372215105

URL: https://github.com/llvm/llvm-project/commit/3b83590cb25bd88d13289eac55ba98a372215105
DIFF: https://github.com/llvm/llvm-project/commit/3b83590cb25bd88d13289eac55ba98a372215105.diff

LOG: [NFC] [Support] Fix unconsistent comment with codes for ExtendSigned

Added: 
    

Modified: 
    llvm/include/llvm/Support/MathExtras.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index ec9b5008792e1..640b3a11ce6c2 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -766,7 +766,7 @@ template <unsigned B> constexpr inline int32_t SignExtend32(uint32_t X) {
 }
 
 /// Sign-extend the number in the bottom B bits of X to a 32-bit integer.
-/// Requires 0 < B < 32.
+/// Requires 0 < B <= 32.
 inline int32_t SignExtend32(uint32_t X, unsigned B) {
   assert(B > 0 && "Bit width can't be 0.");
   assert(B <= 32 && "Bit width out of range.");
@@ -774,7 +774,7 @@ inline int32_t SignExtend32(uint32_t X, unsigned B) {
 }
 
 /// Sign-extend the number in the bottom B bits of X to a 64-bit integer.
-/// Requires 0 < B < 64.
+/// Requires 0 < B <= 64.
 template <unsigned B> constexpr inline int64_t SignExtend64(uint64_t x) {
   static_assert(B > 0, "Bit width can't be 0.");
   static_assert(B <= 64, "Bit width out of range.");
@@ -782,7 +782,7 @@ template <unsigned B> constexpr inline int64_t SignExtend64(uint64_t x) {
 }
 
 /// Sign-extend the number in the bottom B bits of X to a 64-bit integer.
-/// Requires 0 < B < 64.
+/// Requires 0 < B <= 64.
 inline int64_t SignExtend64(uint64_t X, unsigned B) {
   assert(B > 0 && "Bit width can't be 0.");
   assert(B <= 64 && "Bit width out of range.");


        


More information about the llvm-commits mailing list