On Fri, 27 Sep 2024 07:06:44 GMT, Hamlin Li <m...@openjdk.org> wrote:
>> src/jdk.incubator.vector/linux/native/libsleef/lib/vector_math_rvv.c line 51: >> >>> 49: // the dynamic rounding mode is always RNE. >>> 50: >>> 51: #ifdef DEBUG >> >> Question: Should we check for `NDEBUG` macro (A macro specified by C/C++ >> standard) here instead? I see checks for this macro in the original SLEEF >> code. >> >> >> #ifndef NDEBUG >> #define CHECK_FRM __asm__ __volatile__ ( \ >> " frrm t0 \n\t" \ >> " beqz t0, 2f \n\t" \ >> " csrrw x0, cycle, x0 \n\t" \ >> "2: \n\t" \ >> : : : "memory" ); >> #else >> #define CHECK_FRM >> #endif > > `NDEBUG` is only used in sleefdp.c which is the original sleef code, and we > don't use that file in jdk directly, in java.base module of jdk it uses > `DEBUG` but not use `NDEBUG`. > Based on above information, I think `DEBUG` is better. Sounds good. I suppose this `DEBUG` macro will be defined for debug builds, right? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21083#discussion_r1778212230