valgrind isa 3.1 foundation

header files and other common parts associated with the initial isa v3.1
support
This commit is contained in:
Carl Love 2020-09-21 15:56:22 -05:00
parent 459d52ec1f
commit 2a88a98f5b
11 changed files with 2410 additions and 4 deletions

View File

@ -1455,7 +1455,9 @@ AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00])
AC_HWCAP_CONTAINS_FLAG([arch_3_01],[HWCAP_HAS_ISA_3_1])
AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
AC_HWCAP_CONTAINS_FLAG([mma],[HWCAP_HAS_MMA])
# ISA Levels
AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
@ -1624,7 +1626,7 @@ AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
-a x$ac_compiler_sees_htm_builtins = xyes \
-a x$HWCAP_HAS_HTM = xyes )
# isa 3.0 checking
# isa 3.0 checking. (actually 3.0 or newer)
AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@ -1638,9 +1640,27 @@ ac_asm_have_isa_3_00=no
AC_MSG_RESULT([no])
])
# isa 3.01 checking
AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
]], [[
__asm__ __volatile__("brh 1,2 ");
]])], [
ac_asm_have_isa_3_1=yes
AC_MSG_RESULT([yes])
], [
ac_asm_have_isa_3_1=no
AC_MSG_RESULT([no])
])
AM_CONDITIONAL(HAS_ISA_3_00, [test x$ac_asm_have_isa_3_00 = xyes \
-a x$HWCAP_HAS_ISA_3_00 = xyes])
AM_CONDITIONAL(HAS_ISA_3_1, [test x$ac_asm_have_isa_3_1 = xyes \
-a x$HWCAP_HAS_ISA_3_1 = xyes])
# Check for pthread_create@GLIBC2.0
AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])

View File

@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.tool-tests.am
dist_noinst_SCRIPTS = filter_stderr
noinst_HEADERS = ppc64_helpers.h
noinst_HEADERS = ppc64_helpers.h isa_3_1_helpers.h
EXTRA_DIST = \
jm-int.stderr.exp jm-int.stdout.exp jm-int.vgtest jm-int.stdout.exp-LE \
@ -51,6 +51,11 @@ EXTRA_DIST = \
test_isa_3_0_other.stdout.exp-LE test_isa_3_0_other.vgtest \
subnormal_test.stderr.exp subnormal_test.stdout.exp \
subnormal_test.vgtest
# test_isa_3_1_RT.vgtest test_isa_3_1_RT.stderr.exp test_isa_3_1_RT.stdout.exp
# test_isa_3_1_XT.vgtest test_isa_3_1_XT.stderr.exp test_isa_3_1_XT.stdout.exp
# test_isa_3_1_VRT.vgtest test_isa_3_1_VRT.stderr.exp test_isa_3_1_VRT.stdout.exp
# test_isa_3_1_Misc.vgtest test_isa_3_1_Misc.stderr.exp test_isa_3_1_Misc.stdout.exp
# test_isa_3_1_AT.vgtest test_isa_3_1_AT.stderr.exp test_isa_3_1_AT.stdout.exp
check_PROGRAMS = \
allexec \
@ -63,7 +68,8 @@ check_PROGRAMS = \
test_tm test_touch_tm ldst_multiple data-cache-instructions \
power6_mf_gpr std_reg_imm \
twi_tdi tw_td power6_bcmp
# test_isa_3_1_RT test_isa_3_1_XT
# test_isa_3_1_Misc test_isa_3_1_VRT test_isa_3_1_AT
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
@ -71,6 +77,12 @@ AM_CCASFLAGS += @FLAG_M64@
allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
#test_isa_3_1_XT_SOURCES = test_isa_3_1_XT.c test_isa_3_1_common.c
#test_isa_3_1_RT_SOURCES = test_isa_3_1_RT.c test_isa_3_1_common.c
#test_isa_3_1_VRT_SOURCES = test_isa_3_1_VRT.c test_isa_3_1_common.c
#test_isa_3_1_AT_SOURCES = test_isa_3_1_AT.c test_isa_3_1_common.c
#test_isa_3_1_Misc_SOURCES = test_isa_3_1_Misc.c test_isa_3_1_common.c
if HAS_ALTIVEC
BUILD_FLAG_ALTIVEC = -maltivec
ALTIVEC_FLAG = -DHAS_ALTIVEC
@ -128,6 +140,14 @@ BUILD_FLAGS_ISA_3_00 =
ISA_3_00_FLAG =
endif
if HAS_ISA_3_1
BUILD_FLAGS_ISA_3_1 = -mcpu=power10
ISA_3_1_FLAG = -DHAS_ISA_3_1
else
BUILD_FLAGS_ISA_3_1 =
ISA_3_1_FLAG =
endif
test_isa_2_06_part1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(VSX_FLAG) \
@FLAG_M64@ $(ALTIVEC_FLAG) $(BUILD_FLAG_VSX)
@ -161,6 +181,9 @@ test_touch_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG)
test_isa_3_0_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(HTM_FLAG) $(ISA_3_00_FLAG) \
@FLAG_M64@ $(BUILD_FLAGS_ISA_3_00)
test_isa_3_1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(ISA_3_1_FLAG) \
@FLAG_M64@ $(BUILD_FLAGS_ISA_3_1)
subnormal_test_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(VSX_FLAG) $(ISA_2_06_FLAG) \
@FLAG_M64@ $(ALTIVEC_FLAG) $(BUILD_FLAG_VSX) $(BUILD_FLAGS_ISA_2_06)

View File

@ -0,0 +1,112 @@
/* isa_3_1_helpers.h */
#include "isa_3_1_register_defines.h"
extern unsigned long a_iters,b_iters,c_iters, m_iters;
extern unsigned long vrai,vrbi,vrci,vrmi;
extern unsigned long a_inc, b_inc, c_inc, m_inc;
extern unsigned long a_limit,b_limit,c_limit;
extern vector unsigned long long vrt, vra, vrb, vrc;
extern vector unsigned long long vrm;
extern vector unsigned long long vec_xa;
extern vector unsigned long long vec_xb;
extern vector unsigned long long vec_xc;
extern vector unsigned long long vec_xs;
extern vector unsigned long long vec_xt;
extern unsigned long long dcmx;
extern unsigned long current_cr;
extern unsigned long current_fpscr;
typedef void (*test_func_t) (void);
struct test_list_t {
test_func_t func;
const char *name;
const char *form;
unsigned long mask; /* holds SP or DP indicators. */
};
typedef struct test_list_t test_list_t;
extern struct test_list_t current_test;
typedef void (*test_group_t) (const char *name, test_func_t func,
unsigned int unused, char * cur_form);
/* Misc options for debug. */
/* setup_only indicates to do all of the register initializations,
but skip the instruction test. */
extern unsigned long setup_only;
extern int verbose;
extern unsigned long prefix_override;
extern unsigned long vrm_override;
extern unsigned long mc_override;
extern unsigned long enable_setjmp;
extern unsigned long dump_tables;
extern void debug_show_form(const char *, char *);
extern void debug_show_current_iteration();
extern void debug_dump_buffer();
extern void identify_form_components(const char *, const char *);
extern void dump_vsxargs();
extern void generic_prologue();
extern void build_args_table();
extern void build_vsx_table();
extern void print_register_header();
extern void print_register_footer();
extern void debug_show_iter_ranges();
extern void print_result_buffer();
extern void dump_float_vsx_tables();
extern void build_float_vsx_tables();
extern void initialize_target_registers();
extern void initialize_source_registers();
extern void set_up_iterators();
extern void initialize_buffer(int);
extern int verbose;
#define debug_printf(X) if (verbose>0) printf(X);
#define debug_show_labels (verbose>0)
#define debug_show_iters (verbose>1)
#define debug_show_raw_values (verbose>2)
#define debug_show_all_regs (verbose>5)
#define debug_show_tables (verbose>6)
#define CHECK_OVERRIDES { \
if (vrm_override && vrmi > 0) continue; \
if (prefix_override && strncmp("p", instruction_name, 1) == 0) { \
if (verbose) printf("Skipping prefix insn test %s\n",instruction_name); \
continue; \
} \
}
/* CR helpers. */
#define ALLCR "cr0","cr1","cr2","cr3","cr4","cr5","cr6","cr7"
#define SET_CR(_arg) \
__asm__ __volatile__ ("mtcr %0" : : "b"(_arg) : ALLCR );
#define SET_CR0_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x80,%0 " : : "b" (_arg):"cr0");
#define SET_CR1_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x40,%0 " : : "b" (_arg):"cr1");
#define SET_CR2_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x20,%0 " : : "b" (_arg):"cr2");
#define SET_CR3_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x10,%0 " : : "b" (_arg):"cr3");
#define SET_CR4_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x08,%0 " : : "r" (_arg):"cr4");
#define SET_CR5_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x04,%0 " : : "r" (_arg):"cr5");
#define SET_CR6_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x02,%0 " : : "r" (_arg):"cr6");
#define SET_CR7_FIELD(_arg) __asm__ __volatile__ ("mtocrf 0x01,%0 " : : "r" (_arg):"cr7");
#define SET_XER(_arg) __asm__ __volatile__ ("mtxer %0" : : "b"(_arg) : "xer" );
#define GET_CR(_lval) __asm__ __volatile__ ("mfcr %0" : "=b"(_lval) )
#define GET_XER(_lval) __asm__ __volatile__ ("mfxer %0" : "=b"(_lval) )
#define SET_CR_ZERO SET_CR(0)
/* ************** */
/* FPSCR helpers. */
#define SET_FPSCR_ZERO \
do { \
double _d = 0.0; \
__asm__ __volatile__ ("mtfsf 0xFF, %0" : : "f"(_d) ); \
} while (0);
#define GET_FPSCR(_arg) \
__asm__ __volatile__ ("mffs %0" : "=f"(_arg) );

View File

@ -0,0 +1,50 @@
/* register definitions used in tests for isa_3_1. */
/* ACC / Accumulator.
An ACC is associated with a set of four VSR registers.
Each ACC contains four 128-bit rows.
Each row of each ACC is aliased to a specific VSR in the following manner.
ACC[0][0] == VSR[0]; ACC[0][1] == VSR[1]; ACC[0][2] == VSR[2]; ACC[0][3] == VSR[3]
...
ACC[7][0] == VSR[28]; ACC[7][0] == VSR[28]; ACC[7][0] == VSR[28]; ACC[7][0] == VSR[28]
*/
#define ACCNUM 4
register vector long long TEST_ACC0 __asm__ ("vs16");
register vector long long TEST_ACC1 __asm__ ("vs17");
register vector long long TEST_ACC2 __asm__ ("vs18");
register vector long long TEST_ACC3 __asm__ ("vs19");
/* XSp and XTp use the same register pair, defined here as 20 and 21.
{ also XSp,XTp in scripts } */
register vector long long XTp0 __asm__ ("vs20"); // XTp[0];XSp[0];
register vector long long XTp1 __asm__ ("vs21"); // XTp[1];XSp[1];
// xa,xb,xc references are mapped to a specific vector register.
// out of order to allow xap mapped over xa and xc.
register vector long long xa __asm__ ("vs22"); // also xap.
register vector long long xc __asm__ ("vs23"); // also 2nd half of xap.
register vector long long xb __asm__ ("vs24");
register vector long long xt __asm__ ("vs25");
/* frs,frb (variable named frsb) both use the same register pair.
(top half of vs26,vs27) */
register double frsb __asm__ ("fr26");
register double frsbp __asm__ ("fr27");
/* frt,frtp register pair. (top half of vs28,vs29) */
register double frt __asm__ ("vs28");
register double frtp __asm__ ("vs29");
register uint64_t ra __asm__ ("r20");
register uint64_t rb __asm__ ("r21");
register uint64_t rc __asm__ ("r22");
register uint64_t rs __asm__ ("r24"); /* rsp part 1 */
register uint64_t rsp __asm__ ("r25"); /* rsp part 2 */
register uint64_t rt __asm__ ("r26"); /* rtp part 1 */
register uint64_t rtp __asm__ ("r27"); /* rtp part 2 */
extern unsigned long long vsrd;
extern unsigned long get_vsrhd_vs26();
extern unsigned long get_vsrhd_vs27();
extern unsigned long get_vsrhd_vs28();
extern unsigned long get_vsrhd_vs29();

View File

@ -0,0 +1,3 @@
prereq: ../../../tests/check_ppc64_auxv_cap arch_3_1
prereq: ../../../tests/check_ppc64_auxv_cap mma
prog: test_isa_3_1_AT

View File

@ -0,0 +1,2 @@
prereq: ../../../tests/check_ppc64_auxv_cap arch_3_1
prog: test_isa_3_1_Misc

View File

@ -0,0 +1,2 @@
prereq: ../../../tests/check_ppc64_auxv_cap arch_3_1
prog: test_isa_3_1_RT

View File

@ -0,0 +1,2 @@
prereq: ../../../tests/check_ppc64_auxv_cap arch_3_1
prog: test_isa_3_1_VRT

View File

@ -0,0 +1,2 @@
prereq: ../../../tests/check_ppc64_auxv_cap arch_3_1
prog: test_isa_3_1_XT

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,10 @@ P_HWCAP_1=" vsx arch_2_06 power6x dfp pa6t arch_2_05 ic_snoop smt booke"
P_HWCAP_2=" cellbe power5+ power5 power4 notb efpdouble efpsingle spe"
P_HWCAP_3=" ucache 4xxmac mmu fpu altivec ppc601 ppc64 ppc32 "
P_HWCAP2_1=" tar isel ebb dscr htm arch_2_07 arch_3_00 "
# Additional entries as of ... future
P_HWCAP2_2=" arch_3_1 mma "
CAPABILITY_FOUND="no"
for POTENTIAL_CAP in $P_HWCAP_1 $P_HWCAP_2 $P_HWCAP_3 $P_HWCAP2_1 ; do
for POTENTIAL_CAP in $P_HWCAP_1 $P_HWCAP_2 $P_HWCAP_3 $P_HWCAP2_1 $P_HWCAP2_2 ; do
if [ "x$CAPABILITY_WORD" = "x$POTENTIAL_CAP" ]; then
CAPABILITY_FOUND="yes"
break