Skip to content

Commit d5c84ea

Browse files
committed
Force alignment of opal_atomic_int128_t to be 16B
Some architectures will align 128bit integer on 8B but require 16B alignment for 128bit CAS instructions and otherwise fall back to a lock-based atomicity model. By forcing 16bit alignment we can ensure that the variables are properly aligned and the fall-back is not triggered. Thanks to Ulrich Weigand for the analysis and proposed fix in #10988 (comment). Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
1 parent 3b92bb1 commit d5c84ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opal/include/opal_stdatomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typedef _Atomic opal_int128_t opal_atomic_int128_t;
7272

7373
# else
7474

75-
typedef volatile opal_int128_t opal_atomic_int128_t;
75+
typedef volatile opal_int128_t opal_atomic_int128_t __opal_attribute_aligned__(16);
7676

7777
# endif
7878

0 commit comments

Comments
 (0)