]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
10 years agoguest_amd64_spechelper:
Julian Seward [Wed, 4 Feb 2015 19:05:13 +0000 (19:05 +0000)] 
guest_amd64_spechelper:
* add spec rules for B and NB after SUBB
* number (in comments) some existing cases.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3082

10 years agodis_VMASKMOV: create per-lane transfer/no-transfer guard expressions
Julian Seward [Tue, 3 Feb 2015 18:01:41 +0000 (18:01 +0000)] 
dis_VMASKMOV: create per-lane transfer/no-transfer guard expressions
that are more Memcheck-friendly.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3081

10 years agoFix hwcaps validity checking for x86.
Florian Krohm [Thu, 29 Jan 2015 15:21:47 +0000 (15:21 +0000)] 
Fix hwcaps validity checking for x86.
Capabilities  x86-mmxext-sse1-sse2-sse3-lzcnt were rejected as invalid.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3080

10 years agoppIRStoreG: print braces around guarded section, so as to be more
Julian Seward [Wed, 28 Jan 2015 12:03:26 +0000 (12:03 +0000)] 
ppIRStoreG: print braces around guarded section, so as to be more
consistent with other guarded-IR printing.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3079

10 years agoImplement AVX-1 conditional vector stores: VMASKMOVP{D,S} xmm/ymm to memory.
Julian Seward [Wed, 28 Jan 2015 11:49:12 +0000 (11:49 +0000)] 
Implement AVX-1 conditional vector stores: VMASKMOVP{D,S} xmm/ymm to memory.
Fixes #335785.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3078

10 years agoUse IR conditional stores (IRStoreG) to implement AVX-2 conditional
Julian Seward [Wed, 28 Jan 2015 10:52:36 +0000 (10:52 +0000)] 
Use IR conditional stores (IRStoreG) to implement AVX-2 conditional
vector stores, VPMASKMOV{D,Q} xmm/ymm to memory.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3077

10 years agoChange AMD64Instr_CMov64 so that the source can only be a register
Julian Seward [Tue, 27 Jan 2015 23:35:58 +0000 (23:35 +0000)] 
Change AMD64Instr_CMov64 so that the source can only be a register
instead of register-or-memory (an AMD64RM).  This avoids duplicating
conditional load functionality introduced in r3075 via
AMD64Instr_CLoad and in practice has no effect on the quality of the
generated code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3076

10 years agoAMD64 front end: translate AVX2 PMASKMOV load instructions (vector
Julian Seward [Tue, 27 Jan 2015 23:17:02 +0000 (23:17 +0000)] 
AMD64 front end: translate AVX2 PMASKMOV load instructions (vector
conditional loads) using IR conditional load statements IRLoadG rather
than the previous rather ingenious hack.

AMD64 back end:
* Add instruction selection etc for 32- and 64-bit conditional loads (IRLoadG)
* Handle dirty helper calls that return a value and that are conditional.  These
  result from Memcheck's instrumentation of IRLoadGs.

No functional change.  This is a cleanup as part of supporting AVX2
PMASKMOV loads and stores by using the existing IR facilities for
conditional loads and stores.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3075

10 years agoAdd ILGop_Ident64 to enum type IRLoadGOp so as to make it
Julian Seward [Tue, 27 Jan 2015 23:09:23 +0000 (23:09 +0000)] 
Add ILGop_Ident64 to enum type IRLoadGOp so as to make it
possible to represent 64 bit conditional loads in IR.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3074

10 years agoFix an assert. Unbreak build on 32-bit platforms.
Florian Krohm [Wed, 21 Jan 2015 10:38:18 +0000 (10:38 +0000)] 
Fix an assert. Unbreak build on 32-bit platforms.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3073

10 years agoAdd an assert to check that we're getting the expected alignment.
Florian Krohm [Tue, 20 Jan 2015 21:37:06 +0000 (21:37 +0000)] 
Add an assert to check that we're getting the expected alignment.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3072

10 years agoThe size of an event check never depends on the endianess
Florian Krohm [Sat, 10 Jan 2015 16:10:58 +0000 (16:10 +0000)] 
The size of an event check never depends on the endianess
of the host. Remove parameter.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3063

10 years agoClean up a few leftovers from the AIX port which no longer exists.
Florian Krohm [Thu, 8 Jan 2015 20:45:42 +0000 (20:45 +0000)] 
Clean up a few leftovers from the AIX port which no longer exists.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3062

10 years agoRemove the definitons of Ptr_to_ULong and ULong_to_Ptr.
Florian Krohm [Wed, 7 Jan 2015 20:14:48 +0000 (20:14 +0000)] 
Remove the definitons of Ptr_to_ULong and ULong_to_Ptr.
A cast to Addr replaces the former and the latter wasn't used.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3061

10 years agoThe following two lines of code always convert the 64-bit pointer to a 32-bit
Carl Love [Tue, 6 Jan 2015 19:47:51 +0000 (19:47 +0000)] 
The following two lines of code always convert the 64-bit pointer to a 32-bit
pointer.

 target = toUInt( Ptr_to_ULong(h_calc_BCDtoDPB ) );

    and

 target = toUInt( Ptr_to_ULong( h_calc_DPBtoBCD ) );

The toUInt() should only be used if we are running in 32-bit mode.  The lines
were changed to only convert the pointer to 32-bit if running in 32-bit mode.

There is no bugzilla for this issue.  It was noticed by Florian Krohm.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3060

10 years agoFix assert
Philippe Waroquiers [Tue, 6 Jan 2015 15:15:07 +0000 (15:15 +0000)] 
Fix assert
   vex: priv/guest_generic_bb_to_IR.c:224 (bb_to_IR): Assertion `vex_control.guest_max_insns < 100' failed.
caused by giving --vex-guest-max-insns=100
100 should be allowed as described by --help-debug:
    --vex-guest-max-insns=<1..100>         [50]

git-svn-id: svn://svn.valgrind.org/vex/trunk@3059

10 years agoFixed missing ULL on constants per compiler warnings:
Carl Love [Mon, 5 Jan 2015 18:34:01 +0000 (18:34 +0000)] 
Fixed missing ULL on constants per compiler warnings:

gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -DVGPV_x86_linux_vanilla=1 -Ipriv  -m32 -mpreferred-stack-boundary=2 -O2 -g -Wall -Wcast-align -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-long-long -Wcast-qual -Wwrite-strings -Wformat -Wformat-security -fno-stack-protector -fno-strict-aliasing -fno-builtin  -fomit-frame-pointer -Wbad-function-cast -Wcast-qual -fstrict-aliasing  -MT priv/libvex_x86_linux_a-guest_ppc_toIR.o -MD -MP -MF priv/.deps/libvex_x86_linux_a-guest_ppc_toIR.Tpo -c -o priv/libvex_x86_linux_a-guest_ppc_toIR.o `test -f 'priv/guest_ppc_toIR.c' || echo './'`priv/guest_ppc_toIR.c
priv/guest_ppc_toIR.c: In function ‘dis_vx_load’:
priv/guest_ppc_toIR.c:15333: warning: integer constant is too large for ‘long’ type
priv/guest_ppc_toIR.c:15334: warning: integer constant is too large for ‘long’ type

git-svn-id: svn://svn.valgrind.org/vex/trunk@3058

10 years agoFix an incorrect truncation of an address value to 32 bits.
Florian Krohm [Mon, 5 Jan 2015 14:24:54 +0000 (14:24 +0000)] 
Fix an incorrect truncation of an address value to 32 bits.
Never heard anyone complain about it, so probably a rare case.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3057

10 years agoChange remaining use of Addr64 in the VEX API to Addr. The reduces
Florian Krohm [Sun, 4 Jan 2015 17:20:19 +0000 (17:20 +0000)] 
Change remaining use of Addr64 in the VEX API to Addr. The reduces
the size of VexGuestExtent to 20 bytes on a 32-bit platform.
Change prototypes of x86g_dirtyhelper_loadF80le and
x86g_dirtyhelper_storeF80le to give the address in the parameter
list type Addr. Likewise for amd64g_dirtyhelper_loadF80le and
amd64g_dirtyhelper_storeF80le.
Update switchback.c - but not tested.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3056

10 years agoChange the IMark statement. The address is now type Addr and the
Florian Krohm [Fri, 2 Jan 2015 17:32:21 +0000 (17:32 +0000)] 
Change the IMark statement. The address is now type Addr and the
length is unsigned.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3055

10 years agoThe length of a disassemnled insn is always positive.
Florian Krohm [Fri, 2 Jan 2015 14:40:59 +0000 (14:40 +0000)] 
The length of a disassemnled insn is always positive.
Make DisResult::len an UInt.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3054

10 years agoGive DisResult::continueAt Addr type.
Florian Krohm [Fri, 2 Jan 2015 13:34:15 +0000 (13:34 +0000)] 
Give DisResult::continueAt Addr type.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3053

10 years agoMake VexTranslateArgs::guest_bytes_addr an Addr value. Fix ripple.
Florian Krohm [Fri, 2 Jan 2015 11:44:12 +0000 (11:44 +0000)] 
Make VexTranslateArgs::guest_bytes_addr an Addr value. Fix ripple.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3052

10 years agoSynch compiler flags with those in valgrind's Makefile.all.am.
Florian Krohm [Thu, 1 Jan 2015 18:38:15 +0000 (18:38 +0000)] 
Synch compiler flags with those in valgrind's Makefile.all.am.
Add -std=gnu99.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3051

10 years agoIt has long been assumed that host and guest architectures
Florian Krohm [Wed, 31 Dec 2014 12:09:38 +0000 (12:09 +0000)] 
It has long been assumed that host and guest architectures
are the same - even though the initial design goal was likely
different allowing a cross-valgrind of sorts. But as Julian
put it:
But it's been 12+ years and I've never once heard any mention of
such a thing.  So perhaps it's time to give up on that one.

Now let's take advantage of this decision and tighten up the VEX
API using Addr instead of Addr64. As a first step move the definition
of Addr into VEX proper and change the chase_into_ok callback
accordingly.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3050

10 years agoAs a library, VEX should not export the offsetof and vg_alignof
Florian Krohm [Mon, 29 Dec 2014 22:18:58 +0000 (22:18 +0000)] 
As a library, VEX should not export the offsetof and vg_alignof
macros. The latter isn't even used by VEX.
Move them to pub_tool_basics.h.
offsetof also goes to VEX's private header main_util.h.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3049

10 years agoAdd a missing header file.
Florian Krohm [Mon, 29 Dec 2014 21:05:37 +0000 (21:05 +0000)] 
Add a missing header file.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3048

10 years agoChange a few prototypes to use SizeT.
Florian Krohm [Mon, 29 Dec 2014 20:22:26 +0000 (20:22 +0000)] 
Change a few prototypes to use SizeT.
Also, offsetof returns a SizeT value.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3047

10 years agoAdd type SizeT (moved here from valgrind's pub_tool_basics.h).
Florian Krohm [Mon, 29 Dec 2014 19:05:37 +0000 (19:05 +0000)] 
Add type SizeT (moved here from valgrind's pub_tool_basics.h).
Enhance vprintf_wrk to print such values (%zu, %zx, %zX).

git-svn-id: svn://svn.valgrind.org/vex/trunk@3046

10 years agoRemove a few dead assignments.
Florian Krohm [Wed, 24 Dec 2014 12:38:52 +0000 (12:38 +0000)] 
Remove a few dead assignments.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3045

10 years agoAudit a buffer.
Florian Krohm [Tue, 23 Dec 2014 11:05:03 +0000 (11:05 +0000)] 
Audit a buffer.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3044

10 years agoFix 197259 Unsupported arch_prtctl PR_SET_GS option
Philippe Waroquiers [Tue, 16 Dec 2014 23:57:51 +0000 (23:57 +0000)] 
Fix 197259  Unsupported arch_prtctl PR_SET_GS option

On amd64, We handle GS similar to FS, i.e. consider it is constant.
Note that FS is not always 0 on linux. It looks rather to be constant
in all threads, and is zero in the main thread.
As values for FS and/or GS differs between platforms (linux or darwin),
FS_CONST and GS_CONST are used.

Note that we cannot easily test that the value of GS or FS is the
expected one, as the value might not be set at the begin of execution
but only set after prctl has been executed.

So, we just hope that effectively GS and FS are constant.
Some trials to set GS to other values that the expected
constant value on linux was causing a SEGV.
So, it looks like this is all effectively protected.

In summary: we were counting somewhat on the luck for FS,
we now similarly count on luch for GS

git-svn-id: svn://svn.valgrind.org/vex/trunk@3043

10 years agoRemove quote.txt and newline.txt as they are no longer needed.
Florian Krohm [Mon, 15 Dec 2014 21:55:16 +0000 (21:55 +0000)] 
Remove quote.txt and newline.txt as they are no longer needed.
Once upon a time those files were used to construct a
header file vex_svnversion.h but that more hassle than it
was worth and eventually it got nuked.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3042

10 years agoTweak a format specifier. Remove a redundant assert.
Florian Krohm [Mon, 15 Dec 2014 21:07:37 +0000 (21:07 +0000)] 
Tweak a format specifier. Remove a redundant assert.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3041

10 years agoMore constification.
Florian Krohm [Mon, 15 Dec 2014 18:58:07 +0000 (18:58 +0000)] 
More constification.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3040

10 years agoRemove some debugging code that was accidentally checked in
Florian Krohm [Wed, 10 Dec 2014 22:11:33 +0000 (22:11 +0000)] 
Remove some debugging code that was accidentally checked in
in r3038

git-svn-id: svn://svn.valgrind.org/vex/trunk@3039

10 years agoToday this is what happens when we encounter hwcaps we cannot handle:
Florian Krohm [Wed, 10 Dec 2014 16:10:24 +0000 (16:10 +0000)] 
Today this is what happens when we encounter hwcaps we cannot handle:

vex: priv/main_main.c:329 (LibVEX_Translate): Assertion
`are_valid_hwcaps(VexArchAMD64, vta->archinfo_host.hwcaps)' failed.

Running with -d offers this much enlightenment:

--7732:1:main     ... arch = AMD64, hwcaps = INVALID

Not a good base for a bug report...

With this change, the user experience will be smoewhat better, e.g.:

VEX: Support for AVX2 requires AVX capabilities
     Found: amd64-cx16-rdtscp-sse3-avx2
Cannot continue. Good-bye

Specifically, the patch decouples showing hwcaps and deciding their validity.
show_hwcaps_<ARCH> reports the hwcaps it finds. It never returns NULL.
check_hwcaps checks the hwcaps for feasibility and does not return in case
VEX cannot deal with them.
The function are_valid_hwcaps no longer exists.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3038

10 years agoNew function vfatal which should be used for user messages
Florian Krohm [Wed, 10 Dec 2014 16:08:09 +0000 (16:08 +0000)] 
New function vfatal which should be used for user messages
to indicate a situation that can legitimately occur but that
we cannot handle today. The function does not return.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3037

10 years agoFix incorrect implementation of AESKEYGENASSIST in the case where
Julian Seward [Tue, 9 Dec 2014 21:01:28 +0000 (21:01 +0000)] 
Fix incorrect implementation of AESKEYGENASSIST in the case where
the two registers are the same.  Fixes #341698.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3036

10 years agoUpdate x86 decoder as per advise from Julian.
Florian Krohm [Tue, 9 Dec 2014 20:09:42 +0000 (20:09 +0000)] 
Update x86 decoder as per advise from Julian.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3035

10 years agoThe long displacement facility is now required. There were a
Florian Krohm [Mon, 8 Dec 2014 14:01:33 +0000 (14:01 +0000)] 
The long displacement facility is now required. There were a
few spots in the code where this was assumed implicitly.
Ugly fixes were possible, but requiring this facility is not
unreasonable as it has been around sind 2003. So let's just
do this.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3034

10 years agoExport s390_host_hwcaps in LibVEX_Translate, so we can use it in
Florian Krohm [Mon, 8 Dec 2014 12:42:26 +0000 (12:42 +0000)] 
Export s390_host_hwcaps in LibVEX_Translate, so we can use it in
are_valid_hwcaps.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3033

10 years agoAdd a few more asserts. Fix a function prototype.
Florian Krohm [Sat, 6 Dec 2014 20:24:08 +0000 (20:24 +0000)] 
Add a few more asserts. Fix a function prototype.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3032

10 years agoDFP insns should cause an emulation failure if the host cannot
Florian Krohm [Sat, 6 Dec 2014 16:34:48 +0000 (16:34 +0000)] 
DFP insns should cause an emulation failure if the host cannot
execute them. Previously, they caused a failing assertion
which was incorrect.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3031

10 years agoEncountering a PFPO insn in a client program while running on a host
Florian Krohm [Fri, 5 Dec 2014 18:55:39 +0000 (18:55 +0000)] 
Encountering a PFPO insn in a client program while running on a host
that does not have that insn now causes an emulation error.
Previously, it caused a failing assertion which was incorrect.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3030

10 years agoFix some verbiage.
Florian Krohm [Fri, 5 Dec 2014 18:28:29 +0000 (18:28 +0000)] 
Fix some verbiage.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3029

10 years agomips64: add support for Cavium BBIT032 and BBIT132
Petar Jovanovic [Wed, 26 Nov 2014 23:47:08 +0000 (23:47 +0000)] 
mips64: add support for Cavium BBIT032 and BBIT132

This patch adds support for two Cavium specific instructions:
- BBIT032 (Branch on Bit Clear Plus 32), and
- BBIT132 (Branch on Bit Set Plus 32).

Missing support reported in BZ #339288.

Patch by Maran Pakkirisamy.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3028

10 years agoImplement FRINTI d_d, s_s.
Julian Seward [Tue, 25 Nov 2014 17:42:52 +0000 (17:42 +0000)] 
Implement FRINTI d_d, s_s.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3026

10 years agoImplement RORV x_x_x, w_w_w
Julian Seward [Tue, 25 Nov 2014 17:27:32 +0000 (17:27 +0000)] 
Implement RORV x_x_x, w_w_w

git-svn-id: svn://svn.valgrind.org/vex/trunk@3025

10 years agoImplement CLS x_x, w_w
Julian Seward [Tue, 25 Nov 2014 15:51:07 +0000 (15:51 +0000)] 
Implement CLS x_x, w_w

git-svn-id: svn://svn.valgrind.org/vex/trunk@3024

10 years agoarm64: implement "BRK #imm16".
Julian Seward [Tue, 25 Nov 2014 12:17:53 +0000 (12:17 +0000)] 
arm64: implement "BRK #imm16".

git-svn-id: svn://svn.valgrind.org/vex/trunk@3023

10 years agoAdd function s390_isel_amode_b12_b20 to compile an expression into an
Florian Krohm [Sat, 22 Nov 2014 20:10:21 +0000 (20:10 +0000)] 
Add function s390_isel_amode_b12_b20 to compile an expression into an
amode that is either S390_AMODE_B12 or S390_AMODE_B20. This is needed
for compare-and-swap insns. As we're currently not generating amodes
using an index register, there was never a problem.
This change future-proofs the code.
Also add a few more asserts for amodes in the s390_insns supporting
translation chaining.
Fixes BZ #269360.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3000

10 years agoRemove dead code.
Florian Krohm [Fri, 21 Nov 2014 21:40:45 +0000 (21:40 +0000)] 
Remove dead code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2999

10 years agoThis change was triggered by BZ #247974 which suggested to include
Florian Krohm [Thu, 20 Nov 2014 15:08:56 +0000 (15:08 +0000)] 
This change was triggered by BZ #247974 which suggested to include
VEX/test_main.* in the tarball. We don't want to do that because those
files are really just scaffolding for developers to play with and not
meant for general consumption (and are also bitrotting ATM). Therefore,
this patch moves them to the "useful" subdirectory and adds a crude
Makefile there to build the executable.
Makefile-gcc updated accordingly.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2998

10 years agoarm64: enable FCVT{A,N}S X,S.
Julian Seward [Thu, 20 Nov 2014 11:30:41 +0000 (11:30 +0000)] 
arm64: enable FCVT{A,N}S X,S.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2997

10 years agoImplement {S,U}CVTF (scalar, fixedpt).
Julian Seward [Thu, 20 Nov 2014 10:14:06 +0000 (10:14 +0000)] 
Implement {S,U}CVTF (scalar, fixedpt).

git-svn-id: svn://svn.valgrind.org/vex/trunk@2996

10 years agoImplement VFPv4 VFNMA, VFNMS d_d and s_s variants (not that
Julian Seward [Wed, 19 Nov 2014 16:07:28 +0000 (16:07 +0000)] 
Implement VFPv4 VFNMA, VFNMS d_d and s_s variants (not that
there are any other variants).  Fixes #340807.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2995

10 years agoFix stupid bug introduced in r2993, which causes many simple scalar
Julian Seward [Mon, 17 Nov 2014 14:16:56 +0000 (14:16 +0000)] 
Fix stupid bug introduced in r2993, which causes many simple scalar
floating point instructions to ignore their operands and return zero.  Sigh.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2994

10 years agoImplement arm64 insns:
Julian Seward [Mon, 17 Nov 2014 11:21:21 +0000 (11:21 +0000)] 
Implement arm64 insns:
ADDP s_2s, d_2d
FADDP 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FMAX d_d, s_s
FMIN d_d, s_s
FMAXNM d_d, s_s (not really correct)
FMINNM d_d, s_s (not really correct)
FCVT{A,N}S W,D

git-svn-id: svn://svn.valgrind.org/vex/trunk@2993

10 years agoImplement "fcvtpu w, s". n-i-bz.
Julian Seward [Sat, 15 Nov 2014 22:24:18 +0000 (22:24 +0000)] 
Implement "fcvtpu w, s".  n-i-bz.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2992

10 years agoImplement fcsel d_d, s_s. Fixes #340856.
Julian Seward [Sat, 15 Nov 2014 16:07:14 +0000 (16:07 +0000)] 
Implement fcsel d_d, s_s.  Fixes #340856.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2991

10 years agoAdd detection of old ppc32 magic instructions from bug 278808.
Mark Wielaard [Thu, 13 Nov 2014 14:29:03 +0000 (14:29 +0000)] 
Add detection of old ppc32 magic instructions from bug 278808.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2990

10 years agoAdd a nasty temporary kludge to CPUID that allows 64-bit MacOSX 10.10
Julian Seward [Tue, 11 Nov 2014 12:49:21 +0000 (12:49 +0000)] 
Add a nasty temporary kludge to CPUID that allows 64-bit MacOSX 10.10
(Yosemite) to run, until such time as XSAVE and XRSTOR are implemented.
Detailed in the comments.  All other targets should be unaffected.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2989

10 years agoFix incorrect decoding of AVX2 insns:
Julian Seward [Fri, 7 Nov 2014 10:08:21 +0000 (10:08 +0000)] 
Fix incorrect decoding of AVX2 insns:
  VPBROADCASTB xmm, xmm
  VPBROADCASTB xmm, ymm
  VPBROADCASTW xmm, xmm
  VPBROADCASTW xmm, ymm
Fixes #340725.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2988

10 years agoBug 340632 arm64: unhandled instruction fcvtas
Mark Wielaard [Tue, 4 Nov 2014 15:30:42 +0000 (15:30 +0000)] 
Bug 340632 arm64: unhandled instruction fcvtas

git-svn-id: svn://svn.valgrind.org/vex/trunk@2987

10 years agoHandle all DSB/DMB/ISB variants. Fixes #340033.
Julian Seward [Fri, 31 Oct 2014 10:25:19 +0000 (10:25 +0000)] 
Handle all DSB/DMB/ISB variants.  Fixes #340033.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2986

10 years agoImplement PRFM (immediate). Fixes #335713.
Julian Seward [Thu, 30 Oct 2014 23:56:10 +0000 (23:56 +0000)] 
Implement PRFM (immediate).  Fixes #335713.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2985

10 years agoImplement FCVTAS W_S and FCVTAU W_S. Fixes #340509.
Julian Seward [Thu, 30 Oct 2014 23:10:45 +0000 (23:10 +0000)] 
Implement FCVTAS W_S and FCVTAU W_S.  Fixes #340509.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2984

10 years agoImplement
Julian Seward [Thu, 30 Oct 2014 16:36:53 +0000 (16:36 +0000)] 
Implement
FMLA 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
FMLS 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
Fixes #339938 and its dup, #339950.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2983

10 years agoImplement fcvtmu x_d. Fixes #339927.
Julian Seward [Thu, 30 Oct 2014 15:54:53 +0000 (15:54 +0000)] 
Implement fcvtmu x_d.  Fixes #339927.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2982

10 years agoImplement frintx d_d and s_s. Fixes #339926.
Julian Seward [Thu, 30 Oct 2014 15:37:16 +0000 (15:37 +0000)] 
Implement frintx d_d and s_s.  Fixes #339926.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2981

10 years agoTweak to allow the use of this Makefile with the ICC compiler.
Florian Krohm [Wed, 29 Oct 2014 13:53:11 +0000 (13:53 +0000)] 
Tweak to allow the use of this Makefile with the ICC compiler.
Patch by Gregory Czajkowski <gregczajkowski@yahoo.com>.
Related to BZ #339542.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2980

10 years ago* add a missing extra m-reg check for some LD/ST vector cases
Julian Seward [Mon, 27 Oct 2014 09:29:48 +0000 (09:29 +0000)] 
* add a missing extra m-reg check for some LD/ST vector cases

* implement
  LD1/ST1 (multiple 1-elem structs to/from 2 regs
  LD1/ST1 (multiple 1-elem structs to/from 3 regs
  LD1/ST1 (multiple 1-elem structs to/from 4 regs
  LD1R (single structure, replicate)
  LD2R (single structure, replicate)
  LD3R (single structure, replicate)
  LD4R (single structure, replicate)
  LD1/ST1 (single structure, to/from one lane)
  LD2/ST2 (single structure, to/from one lane)
  LD3/ST3 (single structure, to/from one lane)
  LD4/ST4 (single structure, to/from one lane)

I believe this completes the implementation of load and store
instructions for AArch64 ARMv8.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2979

10 years agoCompanion patch of valgrind r14664.
Florian Krohm [Sat, 25 Oct 2014 20:10:30 +0000 (20:10 +0000)] 
Companion patch of valgrind r14664.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2978

10 years agoMemove unused macro. Should have been part of r2955.
Florian Krohm [Thu, 23 Oct 2014 13:52:05 +0000 (13:52 +0000)] 
Memove unused macro. Should have been part of r2955.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2977

10 years agoImplement SIMD (de)interleaving loads/stores:
Julian Seward [Wed, 22 Oct 2014 13:52:51 +0000 (13:52 +0000)] 
Implement SIMD (de)interleaving loads/stores:
  LD1/ST1 (multiple 1-elem structs to/from 1 reg
  LD2/ST2 (multiple 2-elem structs to/from 2 regs
  LD3/ST3 (multiple 3-elem structs to/from 3 regs
  LD4/ST4 (multiple 4-elem structs to/from 4 regs
Also:
  LDNP, STNP  (load/store vector pair, non-temporal)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2976

10 years agoBug 339858 arm64 recognize dmb sy. Data Memory Barrier full SYstem variant.
Mark Wielaard [Sat, 11 Oct 2014 19:13:35 +0000 (19:13 +0000)] 
Bug 339858 arm64 recognize dmb sy. Data Memory Barrier full SYstem variant.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2975

10 years agoMerge the memory allocation bits from libvex.h into main_util.c.
Florian Krohm [Sat, 11 Oct 2014 14:48:38 +0000 (14:48 +0000)] 
Merge the memory allocation bits from libvex.h into main_util.c.
This is to avoid linkage problems due to unresolved symbols for
some compilers. See also valgrind r14600 and BZ #339542.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2974

10 years agoThis patch makes the needed changes to the lxvw4x for Little Endian.
Carl Love [Thu, 9 Oct 2014 21:08:25 +0000 (21:08 +0000)] 
This patch makes the needed changes to the lxvw4x for Little Endian.
The data was being loaded in the Big Endian data order for most
cases.  The code in host_ppc_isel.c was changed to do a right
shift and to permute the hi and lo registers in the other order
to ensure the data was always loaded in BE order.  The lxvw4x
emulation in guest_ppc_toIR.c was changed to permute the data from
the BE order to LE order when running on an LE system.

bugzilla 339433

git-svn-id: svn://svn.valgrind.org/vex/trunk@2973

10 years agomips: add a missing break
Petar Jovanovic [Thu, 9 Oct 2014 01:19:34 +0000 (01:19 +0000)] 
mips: add a missing break

Add a missing break found by IBM's BEAM checker and reported by Florian.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2972

10 years agomips: use putDReg/getDReg for ceil.l.d
Petar Jovanovic [Thu, 9 Oct 2014 01:01:57 +0000 (01:01 +0000)] 
mips: use putDReg/getDReg for ceil.l.d

For better clarity and consistency, use putDReg/getDReg instead of
putFReg/getFReg for ceil.l.d.
Non-functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2971

10 years agoConstification part 5.
Florian Krohm [Wed, 8 Oct 2014 08:54:44 +0000 (08:54 +0000)] 
Constification part 5.
Constify ppXXXInstr, getRegUsage_XXXInstr, isMove_XXXInstr, emit_XXXInstr,
and iselSB_XXX.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2970

10 years agoUse __typeof__ to improve readability and future maintainability.
Florian Krohm [Tue, 7 Oct 2014 22:13:47 +0000 (22:13 +0000)] 
Use __typeof__ to improve readability and future maintainability.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2969

10 years agoRemove unused prototype. Add a fixs390.
Florian Krohm [Tue, 7 Oct 2014 21:57:05 +0000 (21:57 +0000)] 
Remove unused prototype.  Add a fixs390.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2968

10 years agoThis commit just makes white space changes to the three files in commit
Carl Love [Tue, 7 Oct 2014 18:20:39 +0000 (18:20 +0000)] 
This commit just makes white space changes to the three files in commit
r2966 so I can fix the commit message for that commit.  The previous
commit message was "msg".  The "msg" was the file with the commit message below.

The first attempt to fix the false positive message "Invalid read of size"
was to change to a V128 read instead of four 32-bit reads.  Unfortunately,
this caused some regression test failures that were not caught before
committing the change.

This patch implements the V128 read without creating any regression failures.
The issue with the previous fix is that the lvx instruction was used to
do the V128 fetch.  Unfortunately, that instruction takes the effective
address masks it to make it 16 byte aligned and then does the fetch.  So,
non-aligned fetches do not work correctly.  The fix in this patch does
two aligned fetches with the lvx instruction, calculates a how to permute
the data from the two loads and then permutes the data so the result in the
vector register is the correct value for an unaligned fetch.

The fix is for bugzilla 339433.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2967

10 years agomsg
Carl Love [Tue, 7 Oct 2014 17:49:14 +0000 (17:49 +0000)] 
msg

git-svn-id: svn://svn.valgrind.org/vex/trunk@2966

10 years agoguest_amd64_spechelper: fill in a number of missing cases for
Julian Seward [Thu, 2 Oct 2014 16:15:30 +0000 (16:15 +0000)] 
guest_amd64_spechelper: fill in a number of missing cases for
conditions after SUBQ/SUBL/SUBW.  Also, add cases for
Overflow-after-ADDL/SUBL for the benefit of code generated by
Javascript JITs.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2965

10 years agoAdd folding rules for: Sar64(x,0) and Sar32(x,0). Immediate
Julian Seward [Thu, 2 Oct 2014 16:13:20 +0000 (16:13 +0000)] 
Add folding rules for: Sar64(x,0) and Sar32(x,0).  Immediate
shifts by zero seem to have a surprisingly large perf hit on
Intels, possibly due to the bizarre eflags/rflags semantics
involved.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2964

10 years agoguest_amd64_spechelper: number (in comments) and reorder the spec
Julian Seward [Thu, 2 Oct 2014 11:32:39 +0000 (11:32 +0000)] 
guest_amd64_spechelper: number (in comments) and reorder the spec
cases for arbitrary-condition-after-sub32/sub64.  This makes it easier
to see which cases are missing.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2963

10 years agoppc64: lxvw4x instruction uses four 32-byte loads. When run on an
Carl Love [Mon, 29 Sep 2014 19:33:00 +0000 (19:33 +0000)] 
ppc64:  lxvw4x instruction uses four 32-byte loads.  When run on an
application that does partial loads an error message is generated by
valgrind about Invalid read of size 4.  Valgrind is incorrectly
detecting the invalid read.  The four loads were replaced
by a single 128-bit load.  The invalid read message can now be
suppressed using the command line option " --partial-loads-ok=yes ".

This fix is for Valgrind bugzilla 339433.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2962

10 years agoRemove unneeded variable.
Florian Krohm [Thu, 25 Sep 2014 20:33:50 +0000 (20:33 +0000)] 
Remove unneeded variable.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2961

10 years agoThe function mk_AvDuplicateRI() stores 16 bytes to memory and then
Carl Love [Thu, 25 Sep 2014 15:57:31 +0000 (15:57 +0000)] 
The function mk_AvDuplicateRI() stores 16 bytes to memory and then
fetches the data into a vector register.  The load was being
generated as a lvewx instead of a lvx instruction by the code:

      /* Effectively splat the r_src value to dst */
      addInstr(env, PPCInstr_AvLdSt( True/*ld*/, 4, dst, am_offset_zero ) );

The second argument controls which load instruction is generated.  The
second argument should have been 16 to generate the lvx instruction not
the lvewx instruction.  The issue was reported on the Freescale processor
for the vsptlb instruction.  The issue was not detected before because
the backend code generation used the same vector register to load into
as was used previously to create the data.  However, the code generation
is dependent on the HW/Distro/compiler.  If the same register isn't used
the bug appears.  The issue was found with Valgrind 3.10.0 on the Freescale
processor as the Valgrind code generation didn't happen to pick the same
register to do the load into.

The issue was reported in bugzilla 339182.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2960

10 years agoConstification part 4.
Florian Krohm [Wed, 24 Sep 2014 15:18:09 +0000 (15:18 +0000)] 
Constification part 4.
Constify pointer typed members of VexTanslateArgs.
Fix ripple.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2959

10 years agoConstification part 3.
Florian Krohm [Wed, 24 Sep 2014 12:00:49 +0000 (12:00 +0000)] 
Constification part 3.
Constify parameters of instrumentation functions and callbacks from
VexTranslateArgs.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2958

10 years agoThe PPC64 store quad instruction is updating the address register with the
Carl Love [Tue, 23 Sep 2014 16:22:36 +0000 (16:22 +0000)] 
The PPC64 store quad instruction is updating the address register with the
effective address of the store.  The instruction should not update the
address register.  The issue is due to the two putIReg() calls at the end of
the instruction.  The two putIReg() calls were removed to fix the bug.

This issue was reported in bugzilla 339336.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2957

10 years agoConstification part 2.
Florian Krohm [Mon, 22 Sep 2014 21:43:37 +0000 (21:43 +0000)] 
Constification part 2.
Constify parameters of the LibVEX_Chain/Unchain/PatchProfInc.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2956

10 years agoRemove the valgrind_support parameter from LibVEX_Init. It's unused
Florian Krohm [Mon, 22 Sep 2014 21:39:12 +0000 (21:39 +0000)] 
Remove the valgrind_support parameter from LibVEX_Init. It's unused
and looks like an anachronism. VEX is also cleaner without valgrind things
creeping in.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2955

10 years agoConstification part 1.
Florian Krohm [Sun, 21 Sep 2014 21:53:39 +0000 (21:53 +0000)] 
Constification part 1.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2954

10 years agoCouple of fixes:
Florian Krohm [Tue, 16 Sep 2014 22:33:52 +0000 (22:33 +0000)] 
Couple of fixes:
- deepCopyIRConst failed to copy Ico_V256 constants
- deepCopyIRExpr did not copy Iex_Binder expressions
- handle_gets_Stmt should also handle an Ist_Put statement

git-svn-id: svn://svn.valgrind.org/vex/trunk@2953

10 years agoIn s390_decode_and_irgen don't divert the default case to a decoding error.
Florian Krohm [Tue, 16 Sep 2014 21:49:45 +0000 (21:49 +0000)] 
In s390_decode_and_irgen don't divert the default case to a decoding error.
That's wrong as the default case is never supposed to occur.

In disInstr_S390_WRK use vpanic for the default case for sake of consistency.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2952