Optimize VL_WORDS_I/VL_BYTES_I (#8095)

This commit is contained in:
Geza Lore 2026-08-13 19:44:04 +01:00 committed by GitHub
parent 098f375e9d
commit 1397d5d01e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -470,6 +470,7 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read()
// Integer size macros
#define VL_BYTESIZE 8 ///< Bits in a CData / byte
#define VL_BYTESIZE_LOG2 3 ///< log2(VL_BYTESIZE)
#define VL_SHORTSIZE 16 ///< Bits in a SData / short
#define VL_IDATASIZE 32 ///< Bits in an IData / word
#define VL_QUADSIZE 64 ///< Bits in a QData / quadword
@ -482,9 +483,9 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read()
#endif
/// Return number of bytes argument-number of bits needs (1 bit=1 byte)
#define VL_BYTES_I(nbits) (((nbits) + (VL_BYTESIZE - 1)) / VL_BYTESIZE)
#define VL_BYTES_I(nbits) (((nbits) + (VL_BYTESIZE - 1)) >> VL_BYTESIZE_LOG2)
/// Return Words/EDatas in argument-number of bits needs (1 bit=1 word)
#define VL_WORDS_I(nbits) (((nbits) + (VL_EDATASIZE - 1)) / VL_EDATASIZE)
#define VL_WORDS_I(nbits) (((nbits) + (VL_EDATASIZE - 1)) >> VL_EDATASIZE_LOG2)
// Number of Words/EDatas a quad requires
#define VL_WQ_WORDS_E VL_WORDS_I(VL_QUADSIZE)