1
1

A number of changes for improved Alpha support:

* Use $31 instead of mnemonic zero for the gcc inline
    assembly test, as the GNU assembler doesn't like
    zero, but both Tru64 and GNU assembler should be fine
    with $31
  * Disable Linux timer component on Alpha.  The CPU timer
    rolls over every 10 seconds or less, so it's kinda
    worthless for our needs.
  * Fix some escaping issues when local functions are
    denoted with a $
  * Remove C++ comments from the Alpha assembly.
  * Add base assembly code for the non-inlined functions
    on Alpha

This commit was SVN r11764.
Этот коммит содержится в:
Brian Barrett 2006-09-23 03:23:57 +00:00
родитель a4f1018afd
Коммит ad48aa82e9
7 изменённых файлов: 248 добавлений и 24 удалений

Просмотреть файл

@ -848,10 +848,10 @@ AC_DEFUN([OMPI_CONFIG_ASM],[
OMPI_GCC_INLINE_ASSIGN='"mov %0=r0\n;;\n" : "=&r"(ret)'
;;
alpha-*|alphaev[4-8]-*|alphaev56-*|alphaev6[78]-*)
alpha-*|alphaev[[4-8]]-*|alphaev56-*|alphaev6[[78]]-*)
ompi_cv_asm_arch="ALPHA"
OMPI_ASM_SUPPORT_64BIT=1
OMPI_GCC_INLINE_ASSIGN='"bis zero,zero,%0" : "=&r"(ret)'
OMPI_GCC_INLINE_ASSIGN='"bis [$]31,[$]31,%0" : "=&r"(ret)'
;;
mips-*|mips64-*)
@ -1018,7 +1018,7 @@ if test "$ompi_cv_asm_arch" != "WINDOWS" ; then
AC_MSG_CHECKING([whether possible to generate assembly file])
mkdir -p opal/asm/generated
ompi_cv_asm_file="atomic-local.s"
ompi_try="$PERL \"$top_ompi_srcdir/opal/asm/generate-asm.pl\" \"$ompi_cv_asm_arch\" \"$ompi_cv_asm_format\" \"$top_ompi_srcdir/opal/asm/base\" \"$top_ompi_builddir/opal/asm/generated/$ompi_cv_asm_file\" >conftest.out 2>&1"
ompi_try='$PERL $top_ompi_srcdir/opal/asm/generate-asm.pl $ompi_cv_asm_arch $ompi_cv_asm_format $top_ompi_srcdir/opal/asm/base $top_ompi_builddir/opal/asm/generated/$ompi_cv_asm_file >conftest.out 2>&1'
if AC_TRY_EVAL(ompi_try) ; then
# save the warnings
cat conftest.out >&AC_FD_CC

Просмотреть файл

@ -27,6 +27,14 @@
# Assembly Format field:
# config_file-text-global-label_suffix-gsym-lsym-type-size-align_log-ppc_r_reg-64_bit-gnu_stack
######################################################################
#
# Alpha
#
######################################################################
ALPHA default-.text-.globl-:--$-@-1-1-1-1-1 alpha-linux
######################################################################
#

210
opal/asm/base/ALPHA.asm Обычный файл
Просмотреть файл

@ -0,0 +1,210 @@
.set noreorder
.set volatile
.set noat
.set nomacro
.text
.align 2
.align 4
.globl opal_atomic_mb
.ent opal_atomic_mb
$opal_atomic_mb..ng:
opal_atomic_mb:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
mb
.set nomacro
ret $31,($26),1
.end opal_atomic_mb
.align 2
.align 4
.globl opal_atomic_rmb
.ent opal_atomic_rmb
$opal_atomic_rmb..ng:
opal_atomic_rmb:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
mb
.set nomacro
ret $31,($26),1
.end opal_atomic_rmb
.align 2
.align 4
.globl opal_atomic_wmb
.ent opal_atomic_wmb
$opal_atomic_wmb..ng:
opal_atomic_wmb:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
wmb
.set nomacro
ret $31,($26),1
.end opal_atomic_wmb
.align 2
.align 4
.globl opal_atomic_cmpset_32
.ent opal_atomic_cmpset_32
$opal_atomic_cmpset_32..ng:
opal_atomic_cmpset_32:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
1: ldl_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stl_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
ret $31,($26),1
.end opal_atomic_cmpset_32
.align 2
.align 4
.globl opal_atomic_cmpset_acq_32
.ent opal_atomic_cmpset_acq_32
$opal_atomic_cmpset_acq_32..ng:
opal_atomic_cmpset_acq_32:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
1: ldl_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stl_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
.set macro
mb
.set nomacro
ret $31,($26),1
.end opal_atomic_cmpset_acq_32
.align 2
.align 4
.globl opal_atomic_cmpset_rel_32
.ent opal_atomic_cmpset_rel_32
$opal_atomic_cmpset_rel_32..ng:
opal_atomic_cmpset_rel_32:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
wmb
1: ldl_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stl_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
ret $31,($26),1
.end opal_atomic_cmpset_rel_32
.align 2
.align 4
.globl opal_atomic_cmpset_64
.ent opal_atomic_cmpset_64
$opal_atomic_cmpset_64..ng:
opal_atomic_cmpset_64:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
1: ldq_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stq_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
ret $31,($26),1
.end opal_atomic_cmpset_64
.align 2
.align 4
.globl opal_atomic_cmpset_acq_64
.ent opal_atomic_cmpset_acq_64
$opal_atomic_cmpset_acq_64..ng:
opal_atomic_cmpset_acq_64:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
1: ldq_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stq_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
.set macro
mb
.set nomacro
ret $31,($26),1
.end opal_atomic_cmpset_acq_64
.align 2
.align 4
.globl opal_atomic_cmpset_rel_64
.ent opal_atomic_cmpset_rel_64
$opal_atomic_cmpset_rel_64..ng:
opal_atomic_cmpset_rel_64:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
wmb
1: ldq_l $0, 0($16)
cmpeq $0, $17, $0
beq $0, 2f
mov $18, $0
stq_c $0, 0($16)
beq $0, 3f
2:
3: br 1b
.set nomacro
addl $31,$0,$0
ret $31,($26),1
.end opal_atomic_cmpset_rel_64
.align 2
.align 4
.globl opal_sys_timer_get_cycles
.ent opal_sys_timer_get_cycles
$opal_sys_timer_get_cycles..ng:
opal_sys_timer_get_cycles:
.eflag 48
.frame $30,0,$26,0
.prologue 0
.set macro
rpcc $0
.set nomacro
addl $31,$0,$0
ret $31,($26),1
.end opal_sys_timer_get_cycles
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)"

Просмотреть файл

@ -30,7 +30,8 @@ $IS64BIT = 0;
($CONFIG, $TEXT, $GLOBAL, $SUFFIX, $GSYM, $LSYM, $TYPE, $SIZE, $ALIGN_LOG, $DEL_R_REG, $IS64BIT, $GNU_STACK) = (
$asmformat =~ /(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)\-(.*)/);
if (0) {
if (1) {
print "$asmformat\n";
print "CONFIG: $CONFIG\n";
print "TEXT: $TEXT\n";
print "GLOBAL: $GLOBAL\n";

Просмотреть файл

@ -90,15 +90,14 @@ static inline int opal_atomic_cmpset_32( volatile int32_t *addr,
int32_t ret;
__asm __volatile__ (
"1: ldl_l %0, %1 // load oldval value \n\
cmpeq %0, %2, %0 // compare \n\
beq %0, 2f // exit if not equal \n\
mov %3, %0 // value to store \n\
stl_c %0, %1 // attempt to store \n\
beq %0, 3f // if failed, try again \n\
2: // done \n\
3: br 1b // try again \n\
.previous \n"
"1: ldl_l %0, %1 \n\
cmpeq %0, %2, %0 \n\
beq %0, 2f \n\
mov %3, %0 \n\
stl_c %0, %1 \n\
beq %0, 3f \n\
2: \n\
3: br 1b \n"
: "=&r" (ret), "+m" (*addr)
: "r" (oldval), "r" (newval)
: "memory");
@ -135,15 +134,14 @@ static inline int opal_atomic_cmpset_64( volatile int64_t *addr,
int32_t ret;
__asm__ __volatile__ (
"1: ldq_l %0, %1 // load oldval value \n\
cmpeq %0, %2, %0 // compare \n\
beq %0, 2f // exit if not equal \n\
mov %3, %0 // value to store \n\
stq_c %0, %1 // attempt to store \n\
beq %0, 3f // if failed, try again \n\
2: // done \n\
3: br 1b // try again \n\
.previous \n"
"1: ldq_l %0, %1 \n\
cmpeq %0, %2, %0 \n\
beq %0, 2f \n\
mov %3, %0 \n\
stq_c %0, %1 \n\
beq %0, 3f \n\
2: \n\
3: br 1b \n"
: "=&r" (ret), "+m" (*addr)
: "r" (oldval), "r" (newval)
: "memory");

Просмотреть файл

@ -21,7 +21,7 @@ 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
echo Updating asm.s from atomic.h and timer.h using gcc
cat > $CFILE<<EOF
#include <stdlib.h>
@ -31,6 +31,7 @@ cat > $CFILE<<EOF
#define OMPI_GCC_INLINE_ASSEMBLY 1
#define OMPI_WANT_SMP_LOCKS 1
#include "atomic.h"
#include "timer.h"
EOF
gcc -I. -S $CFILE -o atomic.s
gcc -O3 -I. -S $CFILE -o asm.s

Просмотреть файл

@ -45,6 +45,12 @@ AC_DEFUN([MCA_timer_linux_CONFIG],[
[timer_linux_happy="yes"],
[timer_linux_happy="no"])])
case "${host}" in
alpha*)
timer_linux_happy="no"
;;
esac
AS_IF([test "$timer_linux_happy" = "no" -a \
"$timer_linux_should_use" = "1"],
[AC_MSG_ERROR([Linux timer requested but not available. Aborting.])])