977 Commits

Author SHA1 Message Date
Carl Love
49987d5c4a This commit is a fix for "Bug 330622 - Add test to regression suite for POWER
instruction: dcbzl" submitted by Anmol P. Paralkar <paralkar@freescale.com>

The patch adds the following files:

 none/tests/ppc64/data-cache-instructions.vgtest
 none/tests/ppc64/data-cache-instructions.c
 none/tests/ppc64/data-cache-instructions.stdout.exp
 none/tests/ppc64/data-cache-instructions.stderr.exp
 none/tests/ppc32/data-cache-instructions.stdout.exp
 none/tests/ppc32/data-cache-instructions.c
 none/tests/ppc32/data-cache-instructions.vgtest
 none/tests/ppc32/data-cache-instructions.stderr.exp
 tests/power_insn_available.c


The following files are modified:

 none/tests/ppc32/Makefile.am
 none/tests/ppc64/Makefile.am
 tests/Makefile.am





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13791
2014-02-08 02:19:12 +00:00
Petar Jovanovic
1461dae691 mips64: Add tests that cover Cavium-specific load indexed instructions
Tests for lhux, lwux, and lbx for Cavium Octeon II.

Patch by Zahid Anwar, with changes.

Related to Bugzilla issue 326444.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13786
2014-01-31 12:49:22 +00:00
Carl Love
c2714c0d18 This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw
instructions.

The patch also adds ppc32 and ppc64 test cases for the instructions.

The patch is a fix for bugzilla 329956 "valgrind crashes when lmw/stmw instructions are used on ppc64".

The VEX code commit is 2802




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13780
2014-01-24 16:44:08 +00:00
Julian Seward
4c57e7d4d9 Add test cases for AArch64 integer instructions (not wired up).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13771
2014-01-12 13:12:11 +00:00
Mark Wielaard
bbf509b446 Add testcase for bug 328100 XABORT not implemented (VEX r2800).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13754
2013-12-10 09:31:18 +00:00
Dejan Jevtic
c8fdf5eb67 mips32: Fix typo.
Fix some typo error and some errors in tests that was discovered while running Valgrind on MIPS/Android.
In some cases initial FCSR value wasn't being set properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13746
2013-12-05 14:05:25 +00:00
Dejan Jevtic
b4adb1bc50 mips32/64: Test case for VEX r2799.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13713
2013-11-14 15:45:26 +00:00
Christian Borntraeger
dd808ba8b0 add testcase for the rotate and (insert/or/and/xor) family of
instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13711
2013-11-08 09:45:12 +00:00
Tom Hughes
9887050b08 Clear direction flag after tests on amd64. BZ#326983.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13709
2013-11-01 10:46:28 +00:00
Petar Jovanovic
e58b7c43e4 mips64: add missing headers to EXTRA_DIST
make dist will not copy header files if they are not explicitly listed
in EXTRA_DIST. This change adds missing header files from none/test/mips64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13701
2013-10-27 16:10:26 +00:00
Dejan Jevtic
8eec882079 mips32: Change the tests values so that the result is
the same on all mips32 platforms. Add extra cases in 
vbit-test for mips32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13687
2013-10-23 14:07:15 +00:00
Dejan Jevtic
007794399e mips32: Delete unused empty files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13685
2013-10-23 13:08:10 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Julian Seward
682b7211e6 arm-linux only: make unwinding by stack scanning (a nasty hack)
be controllable from the command line.  Fixes (kind of) #289578.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13657
2013-10-18 13:21:26 +00:00
Julian Seward
ab319a7e24 Followup to r13652 (make the translation cache size be command-line
controllable): reduce MAX_N_SECTORS to 24, speed up Sector
initialisation, wording tweaks.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13655
2013-10-18 11:18:45 +00:00
Julian Seward
f967a860bd Add test cases for PCMPxSTRx cases 0x30 and 0x40. Pertains to #320998.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13654
2013-10-18 10:46:52 +00:00
Carl Love
30565b278a This commit adds testing support for the following instructions:
vaddcuq, vadduqm, vaddecuq, vaddeuqm,
  vsubcuq, vsubuqm, vsubecuq, vsubeuqm,
  vbpermq and vgbbd.

The completes adding the Power ISA 2.07 support.

Bugzilla 325816

VEX commit id 2790


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13653
2013-10-18 01:20:11 +00:00
Philippe Waroquiers
61b8b9617b Allow the user to dimension the translation cache
A previous commit had decreased to 6 (on android) and increased to 16
(other platforms) the nr of sectors in the translation cache.
This patch adds a command line option to let the user specify
the nr of sectors as e.g. 16 sectors might be a lot and cause
an out of memory for some workloads or might be too small for
huge executable or executables using a lot of shared libs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13652
2013-10-18 00:08:20 +00:00
Julian Seward
52b882283e Connect up the xacq_xrel test to the build system. Also, make the
TSX configure test check for that the assembler can deal with 
xacquire and xrelease prefixes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13649
2013-10-16 08:53:07 +00:00
Christian Borntraeger
b550fd8e65 remove old broken testcase for s390
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13647
2013-10-15 19:10:11 +00:00
Carl Love
d143dd1f43 Power 8 support, phase 5
This commit adds the testcases for the following instructions:

  vpmsumb, vpmsumh, vpmsumw, vpmsumd, vpermxor, vcipher, vcipherlast,
  vncipher, vncipherlast, vsbox,
  vclzb, vclzw, vclzh, vclzd,
  vpopcntb, vpopcnth, vpopcntw, vpopcntd,
  vnand, vorc, veqv,
  vshasigmaw, vshasigmad,
  bcdadd, bcdsub

The VEX commit that added the support for the above instructions was 
commit 2789.

The patch is for Bugzilla 325628


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13646
2013-10-15 18:13:21 +00:00
Julian Seward
21e2ef83b2 A minimal test case for the parsing of XACQUIRE and XRELEASE prefixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13645
2013-10-15 11:37:16 +00:00
Dejan Jevtic
1a65c43997 mips64: Prevent testing swc1 and swxc1 with the uninitialized memory values on
big endian platrofms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13634
2013-10-11 06:05:24 +00:00
Carl Love
9a6c4d0a0b Adding the link for none/tests/ppc32/test_touch_tm.c that got missed on
commit 13630.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13633
2013-10-10 15:30:02 +00:00
Dejan Jevtic
eb65531207 mips64: Change the input values for FPU tests.
Change the input values so that the binary values
is representing exactly the same float values.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13632
2013-10-10 09:10:35 +00:00
Carl Love
8044c5ce56 Power PC, add the two privileged Transactional Memory instructions.
The initial Transactional Memory instruction patch did not include the two
privileged (OS) instructions treclaim and trechkpt. VEX commit 2784 added
the support for these two instructions.

This patch adds a touch test to make sure all of the POWER Transactional
memory instrutions are recognized by Valgrind.  All of the the Transactional
Memory instructions, with the exception of tbegin, are treated as NOPs in the
first implementation.  The tbegin instruction causes the transaction to fail
thus no additional Transactional Memory instructions on the successful
transaction path would be executed in a real program.  This test just makes
sure each instruction is actually recognized by Valgrind.

The patch if for Bugzilla 325751.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13630
2013-10-09 17:56:34 +00:00
Florian Krohm
a913e218e0 Followup to r13615. Conditional testcases need a prereq line in the
.vgtest file. This has sucked before and I keep forgetting about it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13617
2013-10-04 15:03:55 +00:00
Florian Krohm
9dd4979fd9 Followup to r13614. Forgot to update the .exp file. Now fixed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13616
2013-10-04 12:00:51 +00:00
Florian Krohm
8435fc4dc3 Add a few feature tests to configure.ac because clang does not
understand the following:
- nested functions
- -gstabs option
- loopnel instruction
- addr32 in asm statements
- 'p' constraint in asm statements

Adapt Makefiles accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13615
2013-10-04 11:35:50 +00:00
Florian Krohm
9170b1642b Remove 4 tests of the pextrw instruction.
Those tests were rejected by clang and according to the
analysis below by Tom Hughes do not add anything new.

Analysis:

I'm not 100% sure that clang is right though - the Intel manual 
clearly describes that argument as "reg" rather than "r32" which 
is why I will have included the 64 bit version in the test. It also says:

  "The upper bits of r32 or r64 is zeroed."

and:

  "If the destination operand is a general-purpose register, the
   default operand size is 64-bits in 64-bit mode."

which basically means that REX.W is implied for this op and there is 
no way to encode a 32 bit version when running in 64 bit mode.

So in principle you could encode it as:

  44 0f c5 ce 00          pextrw $0x0,%mm6,%r9d

or:

  4c 0f c5 ce 00          pextrw $0x0,%mm6,%r9

but in fact gcc assembles both versions to the first form.

Equally you could argue that as REX.W is implied both versions 
should disassemble as %r9.

So I think clang is being overly picky, and if it was only going to 
accept one version I would argue it should be %r9 not %r9d!

In practical terms dropping the second set of tests doesn't lose us anything though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13614
2013-10-04 11:29:26 +00:00
Carl Love
0a3fd151e3 Phase 4 support for IBM Power ISA 2.07
This patch adds testcases for the following instructions added 
in phase 4.  The instructions are for doing various arithmetic,
logic, and load/store VSX operations:

  xscvsxdsp xscvuxdsp xsaddsp xssubsp xsdivsp xsmaddasp xsmaddmsp
  xsmsubasp xsmsubmsp xsnmaddasp xsnmaddmsp xsnmsubasp xsnmsubmsp
  xsmulsp xssqrtsp xsresp xsrsqrtesp xsrsp xxlorc xxlnand xxleqv
  lxsiwzx lxsiwax lxsspx stxsiwx stxsspx

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

VEX commit for the instruction support r2781
Bugzilla 325477


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13611
2013-10-03 21:43:10 +00:00
Florian Krohm
dfb5c06054 Change some inline assembler so it is no longer rejected by clang
as suggested by John Reiser and Greg Parker.
It seems that GCC has a more relaxed attitude about what it accepts
as valid input.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13610
2013-10-03 20:54:52 +00:00
Carl Love
e9b1e99239 The test case for the Transaction Memory instructions failes with older
compilers as the -mhtm flag is not known.  The patch fixes the makefile
issue and addes #defines to the testcase code.

The testcase was added in valgrind commit 13607.

The bugzilla for adding the TM instruction support is 323803

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13608
2013-10-02 17:48:48 +00:00
Carl Love
c6765a43dc IBM POWER PC, Add the Transactional Memory test case
The test case for the transaction memory instructions executes the
failure path when run under valgrind.  This is since the initial
Transaction Memory implemnetation is to simply fail the TBEGIN instruction
forcing the execution flow to take the failure path.  When the
test case is executed on the real hardware, the success path will
be taken.  Only the TBEGIN instruction actually does anything.  All other
transactional memory instructions are NOPs since only failure path is executed
and it assumed to not have any transactional memory instructions on it.

Signed-off-by: Carl Love <cel@us.ibm.com>

VEX commit revision 2780
Bugzilla 323803

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13607
2013-10-02 16:28:57 +00:00
Florian Krohm
9de72049d5 Silence clang warnings for the none and exp-sgcheck tools.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13605
2013-10-02 15:37:03 +00:00
Mark Wielaard
b53af2e1f2 Add opcodes.h to EXTRA_DIST for none/tests/ppc[32|64].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13602
2013-10-02 13:17:56 +00:00
Florian Krohm
578a6e1e9f Eliminate a few GCC 4.8.1 warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13600
2013-10-02 06:56:47 +00:00
Carl Love
d568595cd1 Add tests for the phase 3 ISA 2.07 code patch
This patch adds testcases to an existing testcase
source file to test the new instructions which were
added to VEX support in the phase 3 ISA 2.07 code patch.
The patch also makes a small change to memcheck's
vbit tester code to allow successful execution.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>        

Bugzilla 324894.   Corresponding VEX commit 2779

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13594
2013-10-01 15:50:09 +00:00
Florian Krohm
392c321bb4 Check whether binutils supports TSX instructions.
Guard none/tests/amd64/tm1 accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13587
2013-09-30 16:32:53 +00:00
Julian Seward
9b7f6eeab0 Add test cases for SMMLS, SMLALD, SMLSLD (ARM and Thumb). Pertains to
323036, 323175, 323177.  (vasily.golubev@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13584
2013-09-29 19:49:43 +00:00
Julian Seward
b7081fc1bd Add test cases for LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Pertains to 321891, 323035, 324047.  (vasily.golubev@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13583
2013-09-29 18:25:29 +00:00
Julian Seward
2a8d194303 Add a test program of sorts, for XBEGIN and XTEST.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13579
2013-09-27 15:22:50 +00:00
Dejan Jevtic
ea9cf28a1f mips32: Change the input values for round test.
Change the input values so that the binary value
is representing exactly the same float value.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13576
2013-09-24 07:00:46 +00:00
Carl Love
f7d200127b Add test-cases for Power ISA 2.06 insns: divdo/divdo. and divduo/divduo.
The patch was supplied by Anmol P. Paralkar.

Valgrind Bugzilla 325110


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13574
2013-09-20 17:32:06 +00:00
Carl Love
04d9c5c5c7 Oops, commit 13562 said the patch was done by Amodra. It should have
said the patch was from Paralkar Anmol.

This is the fix for Bugzilla 324765.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13563
2013-09-18 17:45:54 +00:00
Carl Love
960e2c2b3f The patch fixes the assembly of the Power dcbtst and dcbt instructions.
The assembly of these instructions is not alwasy being done correctly as
described in the following email reply.

  Re: Assembling Power instructions: dcbtst/dcbt.

      From: Peter Bergner <bergner at vnet dot ibm dot com>
      To: Paralkar Anmol-B07584 <B07584 at freescale dot com>
      Cc: "amodra at bigpond dot net dot au" <amodra at bigpond dot net dot au>, "binutils at sourceware dot org" <binutils at sourceware dot org>
      Date: Fri, 13 Sep 2013 15:22:35 -0500
      Subject: Re: Assembling Power instructions: dcbtst/dcbt.
      Authentication-results: sourceware.org; auth=none
      References: <DC6D7B34688246489A6578981A5ADEB9302A07 at 039-SN2MPN1-012 dot 039d dot mgd dot msft dot net>

  On Fri, 2013-09-13 at 18:32 +0000, Paralkar Anmol-B07584 wrote:
  > Hello,
  >
  >  Per Power ISA Version 2.07 (May 3, 2013) "4.3.2 Data Cache Instructions",
  >  the assembly language syntax for the dcbtst instruction (pp. 771) is:
  >
  >  dcbtst RA,RB,TH [Category: Server]
  >  dcbtst TH,RA,RB [Category: Embedded]
  >
  >  and it's layout in the object code is:
  >
  >   +------+------+------+------+------------+---+
  >   |  31  |  TH  |  RA  |   RB |  246(0xF6) | / |
  >   |0     |6     |11    |16    |21          |31 |
  >   +------+------+------+------+------------+---+
  >
  >  (Analogously: dcbt pp. 770)
  >
  >  However, GAS (as of version 2.23.52.20130912) decides on the syntax to use based on
  >  processor/architecture dialect (not Power ISA Category), using the Server syntax in
  >  the case of POWER4 and the Embedded syntax for generic PPC or VLE.

  That was a bug fixed here:

      https://sourceware.org/ml/binutils/2012-11/msg00352.html

  >  Consequently (e.g.),
  >
  >  dcbtst 17, 14, 6
  >
  >  in the assembly file gets "misassembled" under -many for a user-space program on Linux:

  When you only specify -many (and not one of -mpower4, -mpower5, etc.),
  the assembler/disassembler will choose a default -m<CPU> value for
  you.  That has changed over time, but is generally one of the newer
  server cpus.  For example, for binutils trunk, the default is now
  -mpower8 and for your 2.23.x binutils, it is -mpower7.
  That should force the assembler and disassembler to assemble
  the instruction using the server operand order you want, but the bug
  above (which is in 2.23) basically resets it to an old cpu, so it
  chooses to use the embedded/old cpu setting.

The patch from Amodra fixes the issue by manually generating the correct
hex value for the instruction rather then leaving it to the assembler to
generate the hex value from the symbolic assembly instruction name.

This is the fix for Bugzilla 324765.  

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13562
2013-09-18 16:06:46 +00:00
Dejan Jevtic
91d5bb2015 mips32/mips64: tests for FCSR.
Change the existing tests to print the value of the FCSR
register after the mips fpu instruction is executed.
Add tests that are testing the value of FCSR register.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13560
2013-09-18 10:08:23 +00:00
Petar Jovanovic
c818bd5ff8 mips64: add tests for MIPS64 Octeon Instructions
Follow up to VEX r2765.

Patch by Zahid Anwar.

Bugzilla issue 322150


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13558
2013-09-18 02:19:45 +00:00
Petar Jovanovic
567ed9419a mips32/mips64: rename mips32_features to mips_features
As this file is now detecting mips64/Cavium boards, we are renaming it to
reflect that. The functional change is that mips_features now can detect
Cavium board and allow Cavium-specific tests to be run.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13551
2013-09-15 22:49:01 +00:00
Carl Love
6f2f615e04 The Power ISA 2.07 document includes a correction to the description for the
behavior of the xscvspdp instruction, indicating that if the source argument
is a SNaN, it is first changed to a QNaN before being converted from
single-precision to double-precision. This updated information about the
xscvspdp instruction exposed a bug in the VEX implementation for that
instruction and also a bug in the testing for all instructions having
special behavior for single-precision SNaN arguments.

The VEX code fix for this issue is r2760.

This patch fixes the test cases for the ISA 2.07.

Testing bug: In several ppc[64] test cases, an array of special
double-precision floating point values is set up, and then all elements of
that array are copied via assignment to a single-precision array ('float'
type). Assignment from a double to a float works fine for all cases, except for
SNaN values. In the case of a SNaN, the source is changed to a QNaN and then
converted to single-precision. So the end result was that our array of floats
did not have an actual SNaN value, and, therefore, any instructions that had
special behavior for a single-precision SNaN input argument was never being
properly tested. This patch makes some functional changes in the following
testcases: 

  none/tests/ppc[32|64]/test_isa_2_06_part2.c
  none/tests/ppc[32|64]/test_isa_2_06_part3.c
  none/tests/ppc[32|64]/test_isa_2_07_part2.c

These changes impacted the associated *.stdout.exp files, so the patch also
updates those files. Additionally, there were several errors in testcase
source comments that misidentified QNaN and SNaN bit patterns which this patch
corrects.
 
See bugzilla 324816.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13544
2013-09-12 17:38:13 +00:00