Skip to content

Commit 6abd667

Browse files
committed
opal: remove 32-bit platforms from atomics
These platforms are losing support with each passing day and it is time to let them go. They will continue to work with a C11 compiler but Open MPI will no longer maintain ASM for these platforms. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
1 parent 8f19f0f commit 6abd667

File tree

15 files changed

+92
-791
lines changed

15 files changed

+92
-791
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,13 @@ base as of this writing (April 2020):
201201

202202
* Open MPI requires a C99-capable compiler to build.
203203

204-
* On platforms other than x86-64, ARM, and PPC, Open MPI requires a
205-
compiler that either supports C11 atomics or the GCC `__atomic`
206-
atomics (e.g., GCC >= v4.7.2).
204+
* On platforms other than x86-64, AArch64 (64-bit ARM), and PPC64,
205+
Open MPI requires a compiler that either supports C11 atomics or
206+
the GCC `__atomic` atomics (e.g., GCC >= v4.7.2).
207+
208+
* 32-bit platforms are only supported with a recent compiler that
209+
supports C11 atomics. This includes gcc 4.9.x+ (gcc 6.x or newer
210+
recommened), icc 16, clang 3.1+, etc.
207211

208212
* Mixing compilers from different vendors when building Open MPI
209213
(e.g., using the C/C++ compiler from one vendor and the Fortran

config/opal_config_asm.m4

Lines changed: 22 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -880,53 +880,6 @@ AC_DEFUN([OPAL_CHECK_POWERPC_REG],[
880880
[Whether r notation is used for ppc registers])
881881
])dnl
882882

883-
884-
dnl #################################################################
885-
dnl
886-
dnl OPAL_CHECK_POWERPC_64BIT
887-
dnl
888-
dnl On some powerpc chips (the PPC970 or G5), the OS usually runs in
889-
dnl 32 bit mode, even though the hardware can do 64bit things. If
890-
dnl the compiler will let us, emit code for 64bit test and set type
891-
dnl operations (on a long long).
892-
dnl
893-
dnl #################################################################
894-
AC_DEFUN([OPAL_CHECK_POWERPC_64BIT],[
895-
if test "$ac_cv_sizeof_long" != "4" ; then
896-
# this function should only be called in the 32 bit case
897-
AC_MSG_ERROR([CHECK_POWERPC_64BIT called on 64 bit platform. Internal error.])
898-
fi
899-
AC_MSG_CHECKING([for 64-bit PowerPC assembly support])
900-
case $host in
901-
*-darwin*)
902-
ppc64_result=0
903-
if test "$opal_cv_asm_powerpc_r_reg" = "1" ; then
904-
ldarx_asm=" ldarx r1,r1,r1";
905-
else
906-
ldarx_asm=" ldarx 1,1,1";
907-
fi
908-
OPAL_TRY_ASSEMBLE([$opal_cv_asm_text
909-
$ldarx_asm],
910-
[ppc64_result=1],
911-
[ppc64_result=0])
912-
;;
913-
*)
914-
ppc64_result=0
915-
;;
916-
esac
917-
918-
if test "$ppc64_result" = "1" ; then
919-
AC_MSG_RESULT([yes])
920-
ifelse([$1],,:,[$1])
921-
else
922-
AC_MSG_RESULT([no])
923-
ifelse([$2],,:,[$2])
924-
fi
925-
926-
unset ppc64_result ldarx_asm
927-
])dnl
928-
929-
930883
dnl #################################################################
931884
dnl
932885
dnl OPAL_CHECK_CMPXCHG16B
@@ -1108,7 +1061,7 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
11081061
AC_MSG_ERROR([Cannot continue])
11091062
elif test "$enable_builtin_atomics" = "yes" ; then
11101063
if test $opal_cv_have___atomic = "yes" ; then
1111-
opal_cv_asm_builtin="BUILTIN_GCC"
1064+
opal_cv_asm_builtin="BUILTIN_GCC"
11121065
else
11131066
AC_MSG_WARN([GCC built-in atomics requested but not found.])
11141067
AC_MSG_ERROR([Cannot continue])
@@ -1129,63 +1082,43 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
11291082
# find our architecture for purposes of assembly stuff
11301083
opal_cv_asm_arch="UNSUPPORTED"
11311084
OPAL_GCC_INLINE_ASSIGN=""
1132-
if test "$opal_cv_have___atomic_64" ; then
1133-
OPAL_ASM_SUPPORT_64BIT=1
1134-
else
1135-
OPAL_ASM_SUPPORT_64BIT=0
1136-
fi
11371085
11381086
case "${host}" in
1139-
x86_64-*x32)
1140-
opal_cv_asm_arch="X86_64"
1141-
OPAL_ASM_SUPPORT_64BIT=1
1142-
OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)'
1143-
;;
1144-
i?86-*|x86_64*|amd64*)
1087+
x86_64-*x32|i?86-*|x86_64*|amd64*)
11451088
if test "$ac_cv_sizeof_long" = "4" ; then
1146-
opal_cv_asm_arch="IA32"
1147-
else
1148-
opal_cv_asm_arch="X86_64"
1149-
fi
1150-
OPAL_ASM_SUPPORT_64BIT=1
1089+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1090+
AC_MSG_ERROR([IA32 atomics are no longer supported. Use a C11 compiler])
1091+
fi
1092+
opal_cv_asm_arch="IA32"
1093+
else
1094+
opal_cv_asm_arch="X86_64"
1095+
OPAL_CHECK_CMPXCHG16B
1096+
fi
11511097
OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)'
1152-
OPAL_CHECK_CMPXCHG16B
11531098
;;
11541099
11551100
aarch64*)
11561101
opal_cv_asm_arch="ARM64"
1157-
OPAL_ASM_SUPPORT_64BIT=1
1158-
OPAL_ASM_ARM_VERSION=8
11591102
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
11601103
;;
11611104
1162-
armv7*|arm-*-linux-gnueabihf)
1163-
opal_cv_asm_arch="ARM"
1164-
OPAL_ASM_SUPPORT_64BIT=1
1165-
OPAL_ASM_ARM_VERSION=7
1166-
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
1167-
;;
1105+
armv7*|arm-*-linux-gnueabihf|armv6*)
1106+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1107+
AC_MSG_ERROR([32-bit ARM atomics are no longer supported. Use a C11 compiler])
1108+
fi
11681109
1169-
armv6*)
11701110
opal_cv_asm_arch="ARM"
1171-
OPAL_ASM_SUPPORT_64BIT=0
1172-
OPAL_ASM_ARM_VERSION=6
1173-
CCASFLAGS="$CCASFLAGS -march=armv7-a"
11741111
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
11751112
;;
11761113
11771114
powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*)
11781115
OPAL_CHECK_POWERPC_REG
11791116
if test "$ac_cv_sizeof_long" = "4" ; then
1180-
opal_cv_asm_arch="POWERPC32"
1181-
1182-
# Note that on some platforms (Apple G5), even if we are
1183-
# compiling in 32 bit mode (and therefore should assume
1184-
# sizeof(long) == 4), we can use the 64 bit test and set
1185-
# operations.
1186-
OPAL_CHECK_POWERPC_64BIT(OPAL_ASM_SUPPORT_64BIT=1)
1187-
elif test "$ac_cv_sizeof_long" = "8" ; then
1188-
OPAL_ASM_SUPPORT_64BIT=1
1117+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1118+
AC_MSG_ERROR([PowerPC 32-bit atomics are no longer supported. Use a C11 compiler])
1119+
fi
1120+
opal_cv_asm_arch="POWERPC32"
1121+
elif test "$ac_cv_sizeof_long" = "8" ; then
11891122
opal_cv_asm_arch="POWERPC64"
11901123
else
11911124
AC_MSG_ERROR([Could not determine PowerPC word size: $ac_cv_sizeof_long])
@@ -1213,20 +1146,10 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12131146
;;
12141147
esac
12151148
1216-
if ! test -z "$OPAL_ASM_ARM_VERSION" ; then
1217-
AC_DEFINE_UNQUOTED([OPAL_ASM_ARM_VERSION], [$OPAL_ASM_ARM_VERSION],
1218-
[What ARM assembly version to use])
1219-
fi
1220-
12211149
if test "$opal_cv_asm_builtin" = "BUILTIN_GCC" ; then
12221150
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
12231151
[Whether C compiler supports GCC style inline assembly])
12241152
else
1225-
AC_DEFINE_UNQUOTED([OPAL_ASM_SUPPORT_64BIT],
1226-
[$OPAL_ASM_SUPPORT_64BIT],
1227-
[Whether we can do 64bit assembly operations or not. Should not be used outside of the assembly header files])
1228-
AC_SUBST([OPAL_ASM_SUPPORT_64BIT])
1229-
12301153
opal_cv_asm_inline_supported="no"
12311154
# now that we know our architecture, try to inline assemble
12321155
OPAL_CHECK_INLINE_C_GCC([$OPAL_GCC_INLINE_ASSIGN])
@@ -1239,12 +1162,12 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12391162
asm_format="${asm_format}-${opal_cv_asm_lsym}"
12401163
asm_format="${asm_format}-${opal_cv_asm_type}-${opal_asm_size}"
12411164
asm_format="${asm_format}-${opal_asm_align_log_result}"
1242-
if test "$opal_cv_asm_arch" = "POWERPC32" || test "$opal_cv_asm_arch" = "POWERPC64" ; then
1165+
if test "$opal_cv_asm_arch" = "POWERPC64" ; then
12431166
asm_format="${asm_format}-${opal_cv_asm_powerpc_r_reg}"
12441167
else
12451168
asm_format="${asm_format}-1"
12461169
fi
1247-
asm_format="${asm_format}-${OPAL_ASM_SUPPORT_64BIT}"
1170+
asm_format="${asm_format}-1"
12481171
opal_cv_asm_format="${asm_format}-${opal_cv_asm_gnu_stack}"
12491172
# For the Makefile, need to escape the $ as $$. Don't display
12501173
# this version, but make sure the Makefile gives the right thing
@@ -1256,7 +1179,7 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12561179
AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_FORMAT], ["$OPAL_ASSEMBLY_FORMAT"],
12571180
[Format of assembly file])
12581181
AC_SUBST([OPAL_ASSEMBLY_FORMAT])
1259-
fi # if opal_cv_asm_builtin = BUILTIN_GCC
1182+
fi # if opal_cv_asm_builtin = BUILTIN_GCC
12601183
12611184
result="OPAL_$opal_cv_asm_arch"
12621185
OPAL_ASSEMBLY_ARCH="$opal_cv_asm_arch"

opal/include/opal/sys/Makefile.am

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# reserved.
1616
# Copyright (c) 2017 Research Organization for Information Science
1717
# and Technology (RIST). All rights reserved.
18-
# Copyright (c) 2020 Google, LLC. All rights reserved.
18+
# Copyright (c) 2020-2021 Google, LLC. All rights reserved.
1919
# $COPYRIGHT$
2020
#
2121
# Additional copyrights may follow
@@ -34,8 +34,6 @@ headers += \
3434
opal/sys/cma.h
3535

3636
include opal/sys/x86_64/Makefile.am
37-
include opal/sys/arm/Makefile.am
3837
include opal/sys/arm64/Makefile.am
39-
include opal/sys/ia32/Makefile.am
4038
include opal/sys/powerpc/Makefile.am
4139
include opal/sys/gcc_builtin/Makefile.am

opal/include/opal/sys/arm/Makefile.am

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)