pkarashchenko commented on code in PR #7449:
URL: https://github.com/apache/incubator-nuttx/pull/7449#discussion_r1007362994


##########
include/nuttx/lib/math32.h:
##########
@@ -29,6 +29,35 @@
 
 #include <stdint.h>
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Returns one plus the index of the most significant 1-bit of n,
+ * or if n is zero, returns zero.
+ */
+
+#if UINTPTR_MAX > UINT32_MAX
+#define FLS(n) ((n) & 0xffffffff00000000ull ? 32 + \
+                FLS32((size_t)(n) >> 32) : FLS32(n))
+#else
+#define FLS(n) FLS32(n)

Review Comment:
   ```suggestion
   #  define FLS(n) FLS32(n)
   ```



##########
include/nuttx/lib/math32.h:
##########
@@ -29,6 +29,35 @@
 
 #include <stdint.h>
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Returns one plus the index of the most significant 1-bit of n,
+ * or if n is zero, returns zero.
+ */
+
+#if UINTPTR_MAX > UINT32_MAX
+#define FLS(n) ((n) & 0xffffffff00000000ull ? 32 + \

Review Comment:
   yeah, but many places will need such update. `ull` should work for RV64 as 
well



##########
include/nuttx/lib/math32.h:
##########
@@ -29,6 +29,35 @@
 
 #include <stdint.h>
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Returns one plus the index of the most significant 1-bit of n,
+ * or if n is zero, returns zero.
+ */
+
+#if UINTPTR_MAX > UINT32_MAX
+#define FLS(n) ((n) & 0xffffffff00000000ull ? 32 + \

Review Comment:
   ```suggestion
   #  define FLS(n) ((n) & 0xffffffff00000000ull ? 32 + \
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to