Skip to content

Commit 2277453

Browse files
committed
opal: fix c11 compare-exchange 128-bit check
There were too many arguments being passed to the compare_exchange_strong macro. This commit removes the extra arguments and restores the functionality. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 489c084 commit 2277453

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

config/opal_config_asm.m4

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ AC_DEFUN([OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_TEST_SOURCE],[[
135135
typedef union {
136136
uint64_t fake@<:@2@:>@;
137137
_Atomic __int128 real;
138+
__int128 real2;
138139
} ompi128;
139140
140141
static void test1(void)
@@ -145,9 +146,8 @@ static void test1(void)
145146
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
146147
ompi128 expected = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }};
147148
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
148-
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real,
149-
desired.real, true,
150-
atomic_relaxed, atomic_relaxed);
149+
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real2,
150+
desired.real);
151151
if ( !(r == false && ptr.real == expected.real)) {
152152
exit(1);
153153
}
@@ -158,9 +158,8 @@ static void test2(void)
158158
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
159159
ompi128 expected = ptr;
160160
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
161-
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real,
162-
desired.real, true,
163-
atomic_relaxed, atomic_relaxed);
161+
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real2,
162+
desired.real);
164163
if (!(r == true && ptr.real == desired.real)) {
165164
exit(2);
166165
}

0 commit comments

Comments
 (0)