From: Petar Jovanovic Date: Thu, 4 Sep 2014 01:07:08 +0000 (+0000) Subject: mips64: add tests for Cavium BBIT0 and BBIT1 X-Git-Tag: svn/VALGRIND_3_10_0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11e6f57b70390b88506d09eac78b04760bf72bec;p=thirdparty%2Fvalgrind.git mips64: add tests for Cavium BBIT0 and BBIT1 Follow up to VEX r2942 in which support for Cavium BBIT0/1 instructions has been added. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14449 --- diff --git a/none/tests/mips64/Makefile.am b/none/tests/mips64/Makefile.am index 9175cbab40..2876030afe 100644 --- a/none/tests/mips64/Makefile.am +++ b/none/tests/mips64/Makefile.am @@ -10,6 +10,8 @@ EXTRA_DIST = \ branch_and_jump_instructions.stdout.exp \ branch_and_jump_instructions.stderr.exp branch_and_jump_instructions.vgtest \ branches.stdout.exp branches.stderr.exp branches.vgtest \ + cvm_bbit.stdout.exp cvm_bbit.stdout.exp-non-octeon \ + cvm_bbit.stderr.exp cvm_bbit.vgtest \ cvm_ins.stdout.exp cvm_ins.stdout.exp-non-octeon \ cvm_ins.stderr.exp cvm_ins.vgtest \ cvm_lx_ins.stdout.exp-LE cvm_lx_ins.stdout.exp-BE \ @@ -63,6 +65,7 @@ check_PROGRAMS = \ arithmetic_instruction \ branch_and_jump_instructions \ branches \ + cvm_bbit \ cvm_ins \ cvm_lx_ins \ cvm_atomic \ @@ -93,6 +96,7 @@ AM_CCASFLAGS += @FLAG_M64@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@ +cvm_bbit_CFLAGS = $(AM_CFLAGS) -g -O0 @FLAG_OCTEON@ cvm_ins_CFLAGS = $(AM_CFLAGS) -g -O0 @FLAG_OCTEON@ cvm_lx_ins_CFLAGS = $(AM_CFLAGS) -g -O0 @FLAG_OCTEON2@ cvm_atomic_CFLAGS = $(AM_CFLAGS) -g -O0 @FLAG_OCTEON2@ diff --git a/none/tests/mips64/cvm_bbit.c b/none/tests/mips64/cvm_bbit.c new file mode 100644 index 0000000000..3281886b7a --- /dev/null +++ b/none/tests/mips64/cvm_bbit.c @@ -0,0 +1,38 @@ +#include + +int main() +{ +#if (_MIPS_ARCH_OCTEON) + int t1 = 0; + int t2 = 0; + __asm__ volatile( + ".set noreorder" "\n\t" + "move $t0, $zero" "\n\t" + "label2:" "\n\t" + "addiu $t0, $t0, 1" "\n\t" + "bbit0 $t0, 0x3, label2" "\n\t" + "nop" "\n\t" + "move %0, $t0" "\n\t" + ".set reorder" "\n\t" + : "=r" (t1) + : + : "t0"); + __asm__ volatile( + ".set noreorder" "\n\t" + "li $t0, 0xff" "\n\t" + "label1:" "\n\t" + "addiu $t0, $t0, -1" "\n\t" + "bbit1 $t0, 0x3, label1" "\n\t" + "nop" "\n\t" + "move %0, $t0" "\n\t" + ".set reorder" "\n\t" + : "=r" (t2) + : + : "t0"); + + printf("TEST bbit0: %s\n", t1 == 0x08 ? "PASS" : "FAIL"); + printf("TEST bbit1: %s\n", t2 == 0xF7 ? "PASS" : "FAIL"); + +#endif + return 0; +} diff --git a/none/tests/mips64/cvm_bbit.stderr.exp b/none/tests/mips64/cvm_bbit.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/mips64/cvm_bbit.stdout.exp b/none/tests/mips64/cvm_bbit.stdout.exp new file mode 100644 index 0000000000..71e197107a --- /dev/null +++ b/none/tests/mips64/cvm_bbit.stdout.exp @@ -0,0 +1,2 @@ +TEST bbit0: PASS +TEST bbit1: PASS diff --git a/none/tests/mips64/cvm_bbit.stdout.exp-non-octeon b/none/tests/mips64/cvm_bbit.stdout.exp-non-octeon new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/mips64/cvm_bbit.vgtest b/none/tests/mips64/cvm_bbit.vgtest new file mode 100644 index 0000000000..00c0b96bb9 --- /dev/null +++ b/none/tests/mips64/cvm_bbit.vgtest @@ -0,0 +1,3 @@ +prog: cvm_bbit +prereq: ../../../tests/mips_features cavium-octeon +vgopts: -q