* support high-res timers even if we don't have inline assembly
This commit was SVN r6987.
Этот коммит содержится в:
родитель
e4fd117f5f
Коммит
8d4175ad89
@ -154,3 +154,17 @@ START_FUNC(opal_atomic_sub_32)
|
||||
lwz r3,0(r3)
|
||||
blr
|
||||
END_FUNC(opal_atomic_sub_32)
|
||||
|
||||
START_FUNC(opal_sys_timer_get_cycles)
|
||||
LSYM(15)
|
||||
mftbu r0
|
||||
mftb r11
|
||||
mftbu r2
|
||||
cmpw cr7,r2,r0
|
||||
bne+ cr7,REFLSYM(14)
|
||||
li r4,0
|
||||
li r9,0
|
||||
or r3,r2,r9
|
||||
or r4,r4,r11
|
||||
blr
|
||||
END_FUNC(opal_sys_timer_get_cycles)
|
||||
|
@ -142,3 +142,18 @@ START_FUNC(opal_atomic_sub_32)
|
||||
extsw r3,r3
|
||||
blr
|
||||
END_FUNC(opal_atomic_sub_32)
|
||||
|
||||
START_FUNC(opal_sys_timer_get_cycles)
|
||||
LSYM(7)
|
||||
mftbu r2
|
||||
rldicl r2,r2,0,32
|
||||
mftb r0
|
||||
rldicl r9,r0,0,32
|
||||
mftbu r0
|
||||
rldicl r0,r0,0,32
|
||||
cmpw cr7,r0,r2
|
||||
bne cr7,REFLSYM(7)
|
||||
sldi r3,r0,32
|
||||
or r3,r3,r9
|
||||
blr
|
||||
END_FUNC(opal_sys_timer_get_cycles)
|
||||
|
@ -41,7 +41,9 @@ opal_sys_timer_get_cycles(void)
|
||||
|
||||
#else
|
||||
|
||||
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
|
||||
opal_timer_t opal_sys_timer_get_cycles(void);
|
||||
|
||||
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
|
||||
|
||||
#endif /* OMPI_GCC_INLINE_ASSEMBLY */
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
CFILE=/tmp/opal_atomic_$$.c
|
||||
CFILE=/tmp/opal_asm_$$.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>
|
||||
@ -30,8 +30,9 @@ cat > $CFILE<<EOF
|
||||
#define OMPI_WANT_SMP_LOCKS 1
|
||||
#include "../architecture.h"
|
||||
#include "atomic.h"
|
||||
#include "timer.h"
|
||||
EOF
|
||||
|
||||
gcc -O1 -mpowerpc64 -mcpu=970 -DOMPI_ASSEMBLY_ARCH=POWERPC32 -DOMPI_ASM_SUPPORT_64BIT=1 -I. -S $CFILE -o atomic-32-64.s
|
||||
gcc -O1 -DOMPI_ASSEMBLY_ARCH=OMPI_POWERPC32 -DOMPI_ASM_SUPPORT_64BIT=0 -I. -S $CFILE -o atomic-32.s
|
||||
gcc -m64 -O1 -finline-functions -DOMPI_ASSEMBLY_ARCH=OMPI_POWERPC64 -DOMPI_ASM_SUPPORT64BIT=1 -I. -S $CFILE -o atomic-64.s
|
||||
gcc -O1 -mpowerpc64 -mcpu=970 -DOMPI_ASSEMBLY_ARCH=POWERPC32 -DOMPI_ASM_SUPPORT_64BIT=1 -I. -S $CFILE -o asm-32-64.s
|
||||
gcc -O1 -DOMPI_ASSEMBLY_ARCH=OMPI_POWERPC32 -DOMPI_ASM_SUPPORT_64BIT=0 -I. -S $CFILE -o asm-32.s
|
||||
gcc -m64 -O1 -finline-functions -DOMPI_ASSEMBLY_ARCH=OMPI_POWERPC64 -DOMPI_ASM_SUPPORT64BIT=1 -I. -S $CFILE -o asm-64.s
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user