/* These should be set at build time */
//#define NO_FLOAT
-//#define HAVE_ALTIVEC // CFLAGS += -maltivec
+//#define HAS_ALTIVEC // CFLAGS += -maltivec
//#define IS_PPC405
/**********************************************************************/
register HWord_t r16 __asm__ ("r16");
register HWord_t r17 __asm__ ("r17");
-#include "config.h" // HAVE_ALTIVEC
-#if defined (HAVE_ALTIVEC)
+#include "config.h" // HAS_ALTIVEC
+#if defined (HAS_ALTIVEC)
# include <altivec.h>
#endif
#include <assert.h>
#endif
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void AB_DPRINTF_VEC32x4 ( vector unsigned int v )
{
#if defined (DEBUG_ARGS_BUILD)
#endif /* !defined (NO_FLOAT) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vmhaddshs (void)
{
__asm__ __volatile__ ("vmhaddshs 17, 14, 15, 16");
{ &test_vmsumshm , " vmsumshm", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vperm (void)
{
__asm__ __volatile__ ("vperm 17, 14, 15, 16");
{ &test_vsel , " vsel", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vaddubm (void)
{
__asm__ __volatile__ ("vaddubm 17, 14, 15");
{ &test_vminsw , " vminsw", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vand (void)
{
__asm__ __volatile__ ("vand 17, 14, 15");
{ &test_vsro , " vsro", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vupkhsb (void)
{
__asm__ __volatile__ ("vupkhsb 17, 14");
{ &test_vupklpx , " vupklpx", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vcmpgtub (void)
{
__asm__ __volatile__ ("vcmpgtub 17, 14, 15");
{ &test_vcmpequw , " vcmpequw", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vcmpgtub_ (void)
{
__asm__ __volatile__ ("vcmpgtub. 17, 14, 15");
{ &test_vcmpequw_ , " vcmpequw.", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vsl (void)
{
__asm__ __volatile__ ("vsl 17, 14, 15");
{ &test_lvsr , " lvsr", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_lvebx (void)
{
__asm__ __volatile__ ("lvebx 17,14,15");
{ &test_lvxl , " lvxl", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_stvebx (void)
{
__asm__ __volatile__ ("stvebx 14,15,16");
{ &test_stvxl , " stvxl", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
#if 0
static void test_vmaddfp (void)
{
// { &test_vnmsubfp , " vnmsubfp", }, // TODO: Not yet supported
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vaddfp (void)
{
__asm__ __volatile__ ("vaddfp 17, 14, 15");
{ &test_vminfp , " vminfp", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vrfin (void)
{
__asm__ __volatile__ ("vrfin 17, 14");
// { &test_vexptefp , " vexptefp", }, // TODO: Not yet supported
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vcmpgtfp (void)
{
__asm__ __volatile__ ("vcmpgtfp 17, 14, 15");
{ &test_vcmpbfp , " vcmpbfp", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void test_vcmpgtfp_ (void)
{
__asm__ __volatile__ ("vcmpgtfp. 17, 14, 15");
{ &test_vcmpbfp_ , " vcmpbfp.", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
extern void test_vcfux (void);
ASSEMBLY_FUNC("test_vcfux", "vcfux 17, 14, 0");
{ &test_vctsxs , " vctsxs", },
{ NULL, NULL, },
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
#if defined (IS_PPC405)
static void test_macchw (void)
0x0002050b,
},
#endif /* !defined (NO_FLOAT) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
{
tests_aa_ops_three ,
"PPC altivec integer arith insns with three args",
0x00040103,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_al_ops_three ,
"PPC altivec integer logical insns with three args",
0x00040203,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_aa_ops_two ,
"PPC altivec integer arith insns with two args",
0x00040102,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_al_ops_two ,
"PPC altivec integer logical insns with two args",
0x00040202,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_al_ops_one ,
"PPC altivec integer logical insns with one arg",
0x00040201,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_ac_ops_two ,
"Altivec integer compare insns",
0x00040302,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_acr_ops_two ,
"Altivec integer compare insns with flags update",
0x01040302,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_av_int_ops_spe ,
"Altivec integer special insns",
0x00040207,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_ald_ops_two ,
"Altivec load insns with two register args",
0x00040509,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_ast_ops_three ,
"Altivec store insns with three register args",
0x0004050b,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_afa_ops_three ,
"Altivec floating point arith insns with three args",
0x00050103,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_afa_ops_two ,
"Altivec floating point arith insns with two args",
0x00050102,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_afa_ops_one ,
"Altivec floating point arith insns with one arg",
0x00050101,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_afc_ops_two ,
"Altivec floating point compare insns",
0x00050302,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_afcr_ops_two ,
"Altivec floating point compare insns with flags update",
0x01050302,
},
-#endif /* defined (HAVE_ALTIVEC) */
-#if defined (HAVE_ALTIVEC)
+#endif /* defined (HAS_ALTIVEC) */
+#if defined (HAS_ALTIVEC)
{
tests_av_float_ops_spe,
"Altivec float special insns",
0x00050207,
},
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
#if defined (IS_PPC405)
{
tests_p4m_ops_two ,
static uint16_t *ii16 = NULL;
static int nb_ii16 = 0;
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static vector unsigned int* viargs = NULL;
static int nb_viargs = 0;
static vector float* vfargs = NULL;
nb_ii16 = i;
}
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
static void build_viargs_table (void)
{
#if !defined (ALTIVEC_ARGS_LARGE)
#endif /* !defined (NO_FLOAT) */
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
/* Ref: vector insns to test setting CR, VSCR:
volatile vector unsigned int v1 =
NULL,
};
-#endif /* defined (HAVE_ALTIVEC) */
+#endif /* defined (HAS_ALTIVEC) */
#if defined (IS_PPC405)
continue;
#endif /* defined (IS_PPC405) */
case PPC_ALTIVEC:
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
loop = &altivec_int_loops[nb_args - 1];
break;
#else
continue;
#endif
case PPC_FALTIVEC:
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
loop = &altivec_float_loops[nb_args - 1];
break;
#else
build_iargs_table();
build_fargs_table();
build_ii16_table();
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
if (flags.altivec || flags.faltivec) {
build_viargs_table();
build_vfargs_table();
printf(" num args: \n");
printf(" iargs - %d\n", nb_iargs);
printf(" fargs - %d\n", nb_fargs);
-#if defined (HAVE_ALTIVEC)
+#if defined (HAS_ALTIVEC)
printf(" viargs - %d\n", nb_viargs);
printf(" vfargs - %d\n", nb_vfargs);
#endif