3
3
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
4
4
* reserved.
5
5
* Copyright (c) 2020-2021 Google, LLC. All rights reserved.
6
- * Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
6
+ * Copyright (c) 2021-2022 Cisco Systems, Inc. All rights reserved
7
7
* $COPYRIGHT$
8
8
*
9
9
* Additional copyrights may follow
@@ -990,15 +990,16 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
990
990
switch (hdr -> type ) {
991
991
case MCA_BTL_BASE_AM_ATOMIC :
992
992
if (4 == hdr -> data .atomic .size ) {
993
- uint32_t tmp = (uint32_t ) atomic_response ;
994
- mca_btl_base_am_atomic_32 (& tmp , (opal_atomic_int32_t * ) ( uintptr_t ) hdr -> target_address ,
993
+ int32_t tmp = (int32_t ) atomic_response ;
994
+ mca_btl_base_am_atomic_32 (& tmp , (opal_atomic_int32_t * ) hdr -> target_address ,
995
995
hdr -> data .atomic .op );
996
996
atomic_response = tmp ;
997
- }
998
- if ( 8 == hdr -> data . atomic . size ) {
999
- mca_btl_base_am_atomic_64 (& atomic_response ,
1000
- (opal_atomic_int64_t * ) ( uintptr_t ) hdr -> target_address ,
997
+ } else if ( 8 == hdr -> data . atomic . size ) {
998
+ int64_t tmp = ( int64_t ) atomic_response ;
999
+ mca_btl_base_am_atomic_64 (& tmp ,
1000
+ (opal_atomic_int64_t * ) hdr -> target_address ,
1001
1001
hdr -> data .atomic .op );
1002
+ atomic_response = tmp ;
1002
1003
}
1003
1004
break ;
1004
1005
case MCA_BTL_BASE_AM_CAS :
@@ -1007,8 +1008,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
1007
1008
opal_atomic_compare_exchange_strong_32 ((opal_atomic_int32_t * ) hdr -> target_address ,
1008
1009
& tmp , (int32_t ) hdr -> data .atomic .operand [1 ]);
1009
1010
atomic_response = tmp ;
1010
- }
1011
- if (8 == hdr -> data .atomic .size ) {
1011
+ } else if (8 == hdr -> data .atomic .size ) {
1012
1012
opal_atomic_compare_exchange_strong_64 ((opal_atomic_int64_t * ) hdr -> target_address ,
1013
1013
& atomic_response , hdr -> data .atomic .operand [1 ]);
1014
1014
}
0 commit comments