asm: remove support for Sparc v9
This commit removes the specialized support for Sparc v9 as the architecture is unsupported. The architecture will continue to work without CMA and using the GCC built-in atomic support. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Этот коммит содержится в:
родитель
038dcad8b5
Коммит
d2dd27b008
@ -926,29 +926,6 @@ AC_DEFUN([OPAL_CHECK_POWERPC_64BIT],[
|
||||
])dnl
|
||||
|
||||
|
||||
dnl #################################################################
|
||||
dnl
|
||||
dnl OPAL_CHECK_SPARCV8PLUS
|
||||
dnl
|
||||
dnl #################################################################
|
||||
AC_DEFUN([OPAL_CHECK_SPARCV8PLUS],[
|
||||
AC_MSG_CHECKING([if have Sparc v8+/v9 support])
|
||||
sparc_result=0
|
||||
OPAL_TRY_ASSEMBLE([$opal_cv_asm_text
|
||||
casa [%o0] 0x80, %o1, %o2],
|
||||
[sparc_result=1],
|
||||
[sparc_result=0])
|
||||
if test "$sparc_result" = "1" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$1],,:,[$1])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
ifelse([$2],,:,[$2])
|
||||
fi
|
||||
|
||||
unset sparc_result
|
||||
])dnl
|
||||
|
||||
dnl #################################################################
|
||||
dnl
|
||||
dnl OPAL_CHECK_CMPXCHG16B
|
||||
@ -1214,34 +1191,6 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
|
||||
fi
|
||||
OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)'
|
||||
;;
|
||||
sparc*-*)
|
||||
# SPARC v9 (and above) are the only ones with 64bit support
|
||||
# if compiling 32 bit, see if we are v9 (aka v8plus) or
|
||||
# earlier (casa is v8+/v9).
|
||||
if test "$ac_cv_sizeof_long" = "4" ; then
|
||||
have_v8plus=0
|
||||
OPAL_CHECK_SPARCV8PLUS([have_v8plus=1])
|
||||
if test "$have_v8plus" = "0" ; then
|
||||
OPAL_ASM_SUPPORT_64BIT=0
|
||||
opal_cv_asm_arch="SPARC"
|
||||
AC_MSG_WARN([Sparc v8 target is not supported in this release of Open MPI.])
|
||||
AC_MSG_WARN([You must specify the target architecture v8plus to compile])
|
||||
AC_MSG_WARN([Open MPI in 32 bit mode on Sparc processors (see the README).])
|
||||
AC_MSG_ERROR([Can not continue.])
|
||||
else
|
||||
OPAL_ASM_SUPPORT_64BIT=1
|
||||
opal_cv_asm_arch="SPARCV9_32"
|
||||
fi
|
||||
|
||||
elif test "$ac_cv_sizeof_long" = "8" ; then
|
||||
OPAL_ASM_SUPPORT_64BIT=1
|
||||
opal_cv_asm_arch="SPARCV9_64"
|
||||
else
|
||||
AC_MSG_ERROR([Could not determine Sparc word size: $ac_cv_sizeof_long])
|
||||
fi
|
||||
OPAL_GCC_INLINE_ASSIGN='"mov 0,%0" : "=&r"(ret)'
|
||||
;;
|
||||
|
||||
*)
|
||||
if test $opal_cv_have___atomic = "yes" ; then
|
||||
opal_cv_asm_builtin="BUILTIN_GCC"
|
||||
|
@ -38,5 +38,4 @@ include opal/sys/arm/Makefile.am
|
||||
include opal/sys/arm64/Makefile.am
|
||||
include opal/sys/ia32/Makefile.am
|
||||
include opal/sys/powerpc/Makefile.am
|
||||
include opal/sys/sparcv9/Makefile.am
|
||||
include opal/sys/gcc_builtin/Makefile.am
|
||||
|
@ -36,9 +36,6 @@
|
||||
#define OPAL_X86_64 0030
|
||||
#define OPAL_POWERPC32 0050
|
||||
#define OPAL_POWERPC64 0051
|
||||
#define OPAL_SPARC 0060
|
||||
#define OPAL_SPARCV9_32 0061
|
||||
#define OPAL_SPARCV9_64 0062
|
||||
#define OPAL_ARM 0100
|
||||
#define OPAL_ARM64 0101
|
||||
#define OPAL_BUILTIN_GCC 0202
|
||||
|
@ -180,12 +180,6 @@ enum {
|
||||
#include "opal/sys/powerpc/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64
|
||||
#include "opal/sys/powerpc/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_SPARC
|
||||
#include "opal/sys/sparc/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_32
|
||||
#include "opal/sys/sparcv9/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64
|
||||
#include "opal/sys/sparcv9/atomic.h"
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN
|
||||
|
@ -1,23 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# This makefile.am does not stand on its own - it is included from opal/include/Makefile.am
|
||||
|
||||
headers += \
|
||||
opal/sys/sparcv9/atomic.h \
|
||||
opal/sys/sparcv9/timer.h
|
@ -1,202 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserverd.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2017-2018 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OPAL_SYS_ARCH_ATOMIC_H
|
||||
#define OPAL_SYS_ARCH_ATOMIC_H 1
|
||||
|
||||
/*
|
||||
* On sparc v9, use casa and casxa (compare and swap) instructions.
|
||||
*/
|
||||
|
||||
#define ASI_P "0x80"
|
||||
|
||||
#define MEMBAR(type) __asm__ __volatile__ ("membar " type : : : "memory")
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Define constants for Sparc v9 (Ultra Sparc)
|
||||
*
|
||||
*********************************************************************/
|
||||
#define OPAL_HAVE_ATOMIC_MEM_BARRIER 1
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_32 1
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_64 1
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Memory Barriers
|
||||
*
|
||||
*********************************************************************/
|
||||
#if OPAL_GCC_INLINE_ASSEMBLY
|
||||
|
||||
static inline void opal_atomic_mb(void)
|
||||
{
|
||||
MEMBAR("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad");
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_atomic_rmb(void)
|
||||
{
|
||||
MEMBAR("#LoadLoad");
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_atomic_wmb(void)
|
||||
{
|
||||
MEMBAR("#StoreStore");
|
||||
}
|
||||
|
||||
static inline void opal_atomic_isync(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endif /* OPAL_GCC_INLINE_ASSEMBLY */
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Atomic math operations
|
||||
*
|
||||
*********************************************************************/
|
||||
#if OPAL_GCC_INLINE_ASSEMBLY
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_32 (opal_atomic_int32_t *addr, int32_t *oldval, int32_t newval)
|
||||
{
|
||||
/* casa [reg(rs1)] %asi, reg(rs2), reg(rd)
|
||||
*
|
||||
* if (*(reg(rs1)) == reg(rs2) )
|
||||
* swap reg(rd), *(reg(rs1))
|
||||
* else
|
||||
* reg(rd) = *(reg(rs1))
|
||||
*/
|
||||
|
||||
int32_t prev = newval;
|
||||
bool ret;
|
||||
|
||||
__asm__ __volatile__("casa [%1] " ASI_P ", %2, %0"
|
||||
: "+r" (prev)
|
||||
: "r" (addr), "r" (*oldval));
|
||||
ret = (prev == *oldval);
|
||||
*oldval = prev;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_acq_32 (opal_atomic_int32_t *addr, int32_t *oldval, int32_t newval)
|
||||
{
|
||||
bool rc;
|
||||
|
||||
rc = opal_atomic_compare_exchange_strong_32 (addr, oldval, newval);
|
||||
opal_atomic_rmb();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_rel_32 (opal_atomic_int32_t *addr, int32_t *oldval, int32_t newval)
|
||||
{
|
||||
opal_atomic_wmb();
|
||||
return opal_atomic_compare_exchange_strong_32 (addr, oldval, newval);
|
||||
}
|
||||
|
||||
|
||||
#if OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_64 (opal_atomic_int64_t *addr, int64_t *oldval, int64_t newval)
|
||||
{
|
||||
/* casa [reg(rs1)] %asi, reg(rs2), reg(rd)
|
||||
*
|
||||
* if (*(reg(rs1)) == reg(rs1) )
|
||||
* swap reg(rd), *(reg(rs1))
|
||||
* else
|
||||
* reg(rd) = *(reg(rs1))
|
||||
*/
|
||||
int64_t prev = newval;
|
||||
bool ret;
|
||||
|
||||
__asm__ __volatile__("casxa [%1] " ASI_P ", %2, %0"
|
||||
: "+r" (prev)
|
||||
: "r" (addr), "r" (*oldval));
|
||||
ret = (prev == *oldval);
|
||||
*oldval = prev;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64 */
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_64 (opal_atomic_int64_t *addr, int64_t *oldval, int64_t newval)
|
||||
{
|
||||
/* casa [reg(rs1)] %asi, reg(rs2), reg(rd)
|
||||
*
|
||||
* if (*(reg(rs1)) == reg(rs1) )
|
||||
* swap reg(rd), *(reg(rs1))
|
||||
* else
|
||||
* reg(rd) = *(reg(rs1))
|
||||
*
|
||||
*/
|
||||
int64_t prev = newval;
|
||||
bool ret;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"ldx %0, %%g1 \n\t" /* g1 = ret */
|
||||
"ldx %2, %%g2 \n\t" /* g2 = oldval */
|
||||
"casxa [%1] " ASI_P ", %%g2, %%g1 \n\t"
|
||||
"stx %%g1, %0 \n"
|
||||
: "+m"(prev)
|
||||
: "r"(addr), "m"(*oldval)
|
||||
: "%g1", "%g2"
|
||||
);
|
||||
|
||||
ret = (prev == *oldval);
|
||||
*oldval = prev;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64 */
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_acq_64 (opal_atomic_int64_t *addr, int64_t *oldval, int64_t newval)
|
||||
{
|
||||
bool rc;
|
||||
|
||||
rc = opal_atomic_compare_exchange_strong_64 (addr, oldval, newval);
|
||||
opal_atomic_rmb();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static inline bool opal_atomic_compare_exchange_strong_rel_64 (opal_atomic_int64_t *addr, int64_t *oldval, int64_t newval)
|
||||
{
|
||||
opal_atomic_wmb();
|
||||
return opal_atomic_compare_exchange_strong_64 (addr, oldval, newval);
|
||||
}
|
||||
|
||||
#endif /* OPAL_GCC_INLINE_ASSEMBLY */
|
||||
|
||||
|
||||
#endif /* ! OPAL_SYS_ARCH_ATOMIC_H */
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OPAL_SYS_ARCH_TIMER_H
|
||||
#define OPAL_SYS_ARCH_TIMER_H 1
|
||||
|
||||
typedef uint64_t opal_timer_t;
|
||||
|
||||
#if OPAL_GCC_INLINE_ASSEMBLY
|
||||
|
||||
|
||||
#if OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64
|
||||
|
||||
static inline opal_timer_t
|
||||
opal_sys_timer_get_cycles(void)
|
||||
{
|
||||
opal_timer_t ret;
|
||||
|
||||
__asm__ __volatile__("rd %%tick, %0" : "=r"(ret));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* OPAL_SPARCV9_32 */
|
||||
|
||||
static inline opal_timer_t
|
||||
opal_sys_timer_get_cycles(void)
|
||||
{
|
||||
opal_timer_t ret;
|
||||
int a, b;
|
||||
|
||||
__asm__ __volatile__("rd %%tick, %0 \n"
|
||||
"srlx %0, 32, %1 " :
|
||||
"=r"(a), "=r"(b)
|
||||
);
|
||||
|
||||
ret = (0x00000000FFFFFFFF & a) | (((opal_timer_t) b) << 32);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
|
||||
|
||||
#else
|
||||
|
||||
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
|
||||
|
||||
#endif /* OPAL_GCC_INLINE_ASSEMBLY */
|
||||
|
||||
#endif /* ! OPAL_SYS_ARCH_TIMER_H */
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
CFILE=/tmp/opal_atomic_$$.c
|
||||
|
||||
trap "/bin/rm -f $CFILE; exit 0" 0 1 2 15
|
||||
|
||||
echo Updating atomic.s from atomic.h using gcc
|
||||
|
||||
cat > $CFILE<<EOF
|
||||
#include "../architecture.h"
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#define static
|
||||
#define inline
|
||||
#define OPAL_GCC_INLINE_ASSEMBLY 1
|
||||
#include "atomic.h"
|
||||
EOF
|
||||
|
||||
gcc -m64 -O3 -DOPAL_ASSEMBLY_ARCH=OPAL_SPARCV9_64 -I. -S $CFILE -o atomic64.s
|
||||
gcc -mv8plus -DOPAL_ASSEMBLY_ARCH=OPAL_SPARCV9_32 -O3 -I. -S $CFILE -o atomic32.s
|
@ -84,10 +84,6 @@ BEGIN_C_DECLS
|
||||
#include "opal/sys/powerpc/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64
|
||||
#include "opal/sys/powerpc/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_32
|
||||
#include "opal/sys/sparcv9/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64
|
||||
#include "opal/sys/sparcv9/timer.h"
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user