Commit Graph

97 Commits

Author SHA1 Message Date
Mark Wielaard
39f0abfc92 Add vbit-test-sec.vgtest and vbit-test-sec.stderr.exp to EXTRA_DIST. 2018-12-23 23:42:27 +01:00
Mark Wielaard
49ca1853fc Also test memcheck/tests/vbit-test on any secondary arch.
If we are building a secondary arch then also build and run the
memcheck vbit-test for that architecture.
2018-12-23 22:20:44 +01:00
Julian Seward
dda0d80f3d amd64 pipeline: improve performance of cvtdq2ps and cvtps2dq (128 and 256 bit versions) ..
.. by giving them their own vector IROps rather than doing each lane individually.
2018-12-22 16:11:39 +01:00
Julian Seward
b078fabb56 amd64 pipeline: generate much better code for pshufb mm/xmm/ymm. n-i-bz.
pshufb mm/xmm/ymm rearranges byte lanes in vector registers.  It's fairly
widely used, but we generated terrible code for it.  With this patch, we just
generate, at the back end, pshufb plus a bit of masking, which is a great
improvement.
2018-12-22 07:23:00 +01:00
Julian Seward
e221eca26b Add Memcheck support for IROps added in 42719898.
memcheck/mc_translate.c:

Add mkRight{32,64} as right-travelling analogues to mkLeft{32,64}.

doCmpORD: for the cases of a signed comparison against zero, compute
definedness of the 3 result bits (lt,gt,eq) separately, and, for the lt and eq
bits, do it exactly accurately.

expensiveCountTrailingZeroes: no functional change.  Re-analyse/verify and add
comments.

expensiveCountLeadingZeroes: add.  Very similar to
expensiveCountTrailingZeroes.

Add some comments to mark unary ops which are self-shadowing.

Route Iop_Ctz{,Nat}{32,64} through expensiveCountTrailingZeroes.
Route Iop_Clz{,Nat}{32,64} through expensiveCountLeadingZeroes.

Add instrumentation for Iop_PopCount{32,64} and Iop_Reverse8sIn32_x1.

memcheck/tests/vbit-test/irops.c

Add dummy new entries for all new IROps, just enough to make it compile and
run.
2018-11-20 11:28:42 +01:00
Andreas Arnez
1cc1d564f4 s390x: Vector integer and string instruction support
This adds z/Architecture vector integer and string instruction support.

The main author of this patch is Vadim Barkov <vbrkov@gmail.com>.  Some
fixes were provided by Andreas Arnez <arnez@linux.ibm.com>.
2018-09-26 19:30:56 +02:00
Petar Jovanovic
2671481a5f add Iops Iop_Rotx32 and Iop_Rotx64
Part of MIPS32/64 Revision 6 changes.

Contributed by:
  Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.

Related BZ issue - #387410.
2018-02-01 18:09:56 +01:00
Petar Jovanovic
817011f8f7 mips: add support for Iop_Shr16 and Iop_Sar16
This should fix memcheck/tests/vbit-test/vbit-test on mips32/64 platforms.
2018-01-31 17:27:13 +01:00
Mark Wielaard
ea1c229392 Remove all extra -std=c99 flags from Makefiles.
Configure now makes sure we build everything in c99 mode already.
No need to have extra special cases in the Makefiles.
2018-01-19 13:52:29 +01:00
Julian Seward
f1a49eeb42 Bug 385408 - s390x: z13 vector "support" instructions not implemented. Patch from Vadim Barkov (vbrkov@gmail.com).
(from bug 385408 comment 0):
Valgrind currently lacks support for the z/Architecture vector "support"
instructions introduced with z13.  These are documented in the
z/Architecture Principles of Operation, Eleventh Edition (March, 2015),
chapter 21: "Vector Overview and Support Instructions".
2018-01-11 18:20:27 +01:00
Julian Seward
0f18cfc986 Fix memcheck/tests/vbit-test (the vbit test program) to track changes in bug 387664.
Bug 387664 changes the default settings for accurate definedness checking
for {Add,Sub}{32,64} and {CmpEQ,CmpNE}{8,16,32,64}.  This fix updates the
vbit tester (memcheck/tests/vbit-test) to test the accurate versions of
these, and thereby fixes a regression caused by
e847cb5429 as committed for bug 387664.
2018-01-03 11:55:44 +01:00
Petar Jovanovic
91373819a3 mips: new Iops added to support MSA
New Iops are defined:
  Iop_Scale2_32Fx4, Iop_Scale2_64Fx2,
  Iop_Log2_32Fx4, Iop_Log2_64Fx2,
  Iop_F32x4_2toQ16x8, Iop_F64x2_2toQ32x4,
  Iop_PackOddLanes8x16, Iop_PackEvenLanes8x16,
  Iop_PackOddLanes16x8, Iop_PackEvenLanes16x8,
  Iop_PackOddLanes32x4, Iop_PackEvenLanes32x4.

Contributed by:
  Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.

Related BZ issue - #382563.
2017-10-27 16:27:24 +02:00
Petar Jovanovic
a1e5547a44 mips: remove incorrect implementation of several Iops
Remove incorrect implementation of
  Iop_DivModU64to32
  Iop_DivModS64to32
  Iop_DivModU128to64
  Iop_DivModS128to64
2017-08-22 16:05:00 +02:00
Petar Jovanovic
5f3cc6c828 mips: reimplement handling of div, divu and ddivu
Previous implementation misused some opcodes, and a side effect was
dead code emission.
To reimplement handling of these instructions, three new IoPs have been
introduced:

      Iop_DivModU64to64, // :: I64,I64 -> I128
                         // of which lo half is div and hi half is mod
      Iop_DivModS32to32, // :: I32,I32 -> I64
                         // of which lo half is div and hi half is mod
      Iop_DivModU32to32, // :: I32,I32 -> I64
                         // of which lo half is div and hi half is mod

Patch by Aleksandra Karadzic and Tamara Vlahovic.
2017-08-22 15:53:15 +02:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Julian Seward
8840b0bb8d Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and
Iop_MinNumF32, as introduced in vex r3293.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16202
2017-01-13 18:02:38 +00:00
Carl Love
ffb3146248 Fix for missing ISA changes in HW cap stuff needs updating patch
A couple things got missed in the previous HW cap stuff needs updating patch
that cause the vbit tester to fail.  The fixes are based on the patch
submitted by Mark Weilaard.

The changes were missed in Valgrind commit 16034

bugzilla 370265

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16037
2016-10-11 17:01:42 +00:00
Mark Wielaard
2f1ec093bc Allow building vbit_test when srdir != builddir.
Link against libvex-<arch>-<os>.a in top_builddir.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15940
2016-08-26 13:10:14 +00:00
Carl Love
d2450cd776 Power PC test suite for ISA 3.0, part 5 of 5
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15938
2016-08-15 21:54:04 +00:00
Carl Love
b52e8b1c78 Power PC Fix V bit error in 128-bit BCD add and subtract instructions
The original code was using the bcdadd / bcdsub instruction on the operand
shadow bits to calculate the shadow bits for the result.  This introduced
non-zero bits shadow bits in the result.   The shadow bits for these
instructions should be set to all valid or all invalid.  If one of the
argument shadow bits was one, then all of the shadow bits of the result should
be one.  Otherwise the result shadow bits should be zero.

This patch fixes the above bug in memcheck/mc_translate.c

Fixing the above bug broke the v-bit test.  The issue is the v-bit tester 
assumes the shadow bits for the operands of a given Iop can be set to one
for testing purposes.  The implementation of the bcdadd and bcdsub was passing
a constant value for the variable ps.  The ps value is an argument to the
instruction that specifies how to set the sign code of the result.  The
implementation of the instructions was changed to issue the instruction with
ps=0.  Then the result of the instruction is updated in the VEX code if ps=1.
This changed also results in cleaning up the vbit test code.  

This patch also fixes the issues with the v-bit test program.

Valgrind commit 3218

Bugzilla 360035


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15871
2016-04-26 19:53:56 +00:00
Petar Jovanovic
6b95752621 mips: add missing "memory" to the clobber list
Add "memory" to the clobber arguments of VALGRIND_DO_CLIENT_REQUEST_EXPR.

This fixes memcheck/tests/vbit-test/vbit-test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15740
2015-11-27 14:51:33 +00:00
Carl Love
0201caa575 This is a fix to Bug 354797 which added the vbit test support for the
Power 8 instructions.

The patch for bug 354797 moved the declaration for rc outside of the
architecture #ifdef.  This results in an message about rc being unused
on architectures other then s390 and powerpc.  This commit eliminates
the issue by:

powerpc: move rc declaration into #ifdef for powerpc.
      Remove tab, put in missing break.

s390: remove rc declaration from inside case statement.  Put rc declaration
      before the switch statement but within the #ifdef for s390 so it will
      be declared for use in both case clauses.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15738
2015-11-25 17:48:25 +00:00
Carl Love
79c80505d3 Add ISA 2.07 vbit test support
The ISA 2.07 support adds new Iops as well as support for some existing
Iops.  None of these Iops have been enabled in the vbit tester.  This commit
adds the needed support to the files in memcheck/tests/vbit-test.   
These changes add support for additional immediate operands and additional
undefined bit checking functions.

There are additional changes to files VEX/priv/ir_inject.c and VEX/pub/libvex.h
that are in VEX commit 3202

Bugzilla 354797 was created for this issue.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15720
2015-11-03 17:48:04 +00:00
Florian Krohm
5085e06eb6 Fix a bug passing immediate values to ir_inject.c
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15710
2015-10-17 11:18:50 +00:00
Florian Krohm
1b73579e81 Link the vbit tester against libvex-<arch>-<os>.a
This allows to remove local copies of certain VEX functions.
VEX r3200 enables this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15709
2015-10-16 17:29:54 +00:00
Florian Krohm
d6133786a6 Avoid a possible memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15673
2015-09-22 11:06:42 +00:00
Florian Krohm
a8a0c4bcce Add copyright/license comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15672
2015-09-22 07:21:50 +00:00
Florian Krohm
2b628c20a2 Update TODO list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15671
2015-09-22 07:04:25 +00:00
Florian Krohm
079e74fe78 Break a few overly long lines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15670
2015-09-22 07:03:38 +00:00
Carl Love
7161ebc00f Add Power PC ISA check to the vbit-test
The support for the Valgrind Iops is dependent on the Power processor
support for various instructions.  The instructions supported by a
given Power processor is based on the version of the ISA.  The patch
add a check to the vbit-test to ensure it does not try to test an Iop
that generates an instruction on the host that is not supported.

This patch fixes bugzilla 352765.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15653
2015-09-16 23:33:40 +00:00
Florian Krohm
93504b89c4 Changes related to new IROp Iop_RoundF128toInt. See VEX r3183.
s390: Add testcase for fixbr.
Patch by Andreas Arnez <arnez@linux.vnet.ibm.com>.
Part of fixing BZ #350290.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15629
2015-09-05 20:39:27 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Florian Krohm
096bcbf059 Enable a few more compiler warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15243
2015-05-16 16:17:52 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Julian Seward
2eca28d9d3 Memcheck: add support for recently added IROps:
Iop_F64toF16 
Iop_F32toF16 
Iop_F16toF64 
Iop_F16toF32 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15070
2015-04-06 14:52:28 +00:00
Julian Seward
149f6c980d Un-break the build following vex r3110. Thanks to PetarJ for the fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15052
2015-03-30 19:14:35 +00:00
Florian Krohm
f39011b8b6 Add STATIC_ASSERT and use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15047
2015-03-28 18:36:01 +00:00
Florian Krohm
6dce653240 Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan 
- add __ubsan helpers (by Julian)

This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14995
2015-03-10 16:13:59 +00:00
Florian Krohm
f029054493 Update opcode list following VEX r3092.
Add an assertion to trigger a compile time error in case this
happens again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14961
2015-02-24 17:17:19 +00:00
Florian Krohm
75e739efc0 Revert accidental checkin for Makefile.am
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14914
2015-02-06 20:33:51 +00:00
Florian Krohm
c29515885b Fix undefined behaviours when shifting.
Found by libubsan.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913
2015-02-06 20:32:15 +00:00
Florian Krohm
fe89cb4e4d Fix Makefile.am so it works for builds configured with
--enable-only32bit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14849
2015-01-04 22:55:45 +00:00
Florian Krohm
569012f885 Avoid compiler warnings on s390x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14817
2014-12-17 11:35:10 +00:00
Florian Krohm
f38d96dd61 Add -Wformat -Wformat-security to the list of compile flags.
This was not as straight forward as expected. Specifically, adding the
new flag to CFLAGS in configure.ac did not work and was causing
compiler warnings. For instance, compiling memcheck/tests/execve2.c will
generate a -Wnonnull warning even though the testcase is explicitly
compiled with -Wno-nonnull. The reason is that (a) -Wformat is implied by
-Wnonnull and (b) the list of compiler flags gets assembled in the wrong
order. The culprit appears to be that we modify CFLAGS in configure.ac and
that really is not the right place. Conceptually, configure should determine
tool-chain capabilities and not assemble compiler flags. That should be done
in Makefiles. This patch entangles all this.

So, whatever was added to CFLAGS in configure.ac has now been moved to
Makefile.all.am and Makefile.tool-tests.am. Those are:
-Wno-long-long
-Wwrite-strings
-Wcast-qual
-fno-stack-protector
Note, that this change allows us to simplify Makefile.tool-tests.am which
in the past was disabling some of those flags (e.g. by adding -Wno-cast-qual
again).
In case of the clang compiler, extra command line options are needed. I've
moved those into a separate 'if COMPILER_IS_CLANG' section and not merge
them into baseline flags.

Related to BZ 334727.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14798
2014-12-03 22:53:00 +00:00
Florian Krohm
d71ff248bd Add a missing break as identified by IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14519
2014-09-11 22:27:20 +00:00
Julian Seward
76aa4710d8 Track vex r2939 (renaming and arg-order change for Iop_Extract{64,V128}).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14404
2014-09-01 11:34:32 +00:00
Julian Seward
6a859c491c Track renaming of {reciprocal, reciprocal sqrt}{estimate, step}
primops in vex r2932.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14350
2014-08-24 14:02:22 +00:00
Mark Wielaard
262ce8ca11 Bug 338445 amd64 vbit-test fails with unknown opcodes used by arm64 VEX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14327
2014-08-21 14:44:48 +00:00