[Openmp-commits] [openmp] [OpenMP][test]Flip bit-fields in 'struct flags' for big-endian in test cases (PR #79895)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 6 13:54:14 PST 2024


================
@@ -50,12 +50,21 @@ typedef struct kmp_depend_info {
      union {
         kmp_uint8 flag; // flag as an unsigned char
         struct { // flag as a set of 8 bits
-            unsigned in : 1;
-            unsigned out : 1;
-            unsigned mtx : 1;
-            unsigned set : 1;
-            unsigned unused : 3;
-            unsigned all : 1;
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
----------------
jprotze wrote:

This is something that would also need to be addressed in kmp.h. 

Does this versioning have a correctness implication, or is this a performance optimization?
In the latter case, from my perspective, a viable approach would be hardcode the endianess, if the two macros are undefined.

It's your choice to fix it as part of this patch or whether you prefer to fix it in a separate pr:)

https://github.com/llvm/llvm-project/pull/79895


More information about the Openmp-commits mailing list