]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
11 years ago Phase 4 support for IBM Power ISA 2.07
Carl Love [Thu, 3 Oct 2013 21:38:45 +0000 (21:38 +0000)] 
 Phase 4 support for IBM Power ISA 2.07

This patch adds support for the following instructions 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>
Bugzilla 325477

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

11 years agoPower PC, Approach 1, add Transactional Memory instruction support
Carl Love [Wed, 2 Oct 2013 16:25:57 +0000 (16:25 +0000)] 
Power PC, Approach 1, add Transactional Memory instruction support

The following Transactional Memory instructions are added:
  tbegin., tend., tsr., tcheck., tabortwc.,
  tabortdc., tabortwci., tabortdci., tabort.

The patch implements the first proposal by Julian on how to handle the
TM instructions. The proposal is as follows:

    translate "XBEGIN fail-addr" as "goto fail-addr"; that is: push
    simulated execution directly onto the failure path.  This is simple
    but will have poor performance, if (as is likely) the failure path
    uses normal locking and is not tuned for speed.

The tbegin instruction on Power sets the condition code register to
indicate if the tbegin instruction suceeded or failed.  The compiler
then generates a conditional branch instruction to take the success
or failure code path for the tbegin instruction.  In order to fail the
tbegin instruction, the condition code register is updated to indicate
that the tbegin instruction failed.  This patch assumes that there is
always an error handler for the tbegin instruction.  The other TM
instructions are all treated as no ops as we shouldn't be executing the
sucess transactional code path.

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

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

11 years agoPhase 3 support for IBM Power ISA 2.07
Carl Love [Tue, 1 Oct 2013 15:45:54 +0000 (15:45 +0000)] 
Phase 3 support for IBM Power ISA 2.07

This patch adds support for the following vector instructions for doing
arithmetic, min, max, shift, pack, unpack and rotate:

  vsubudm, vmaxud, vmaxsd, vminud, vminsd, vmulouw,
  vmuluwm, vmulosw, vmuleuw, vmulesw, vcmpequd, vcmpgtud, vcmpgtsd,
  vrld, vsld, vsrad, vsrd, vpkudus, vpksdus, vpksdss,
  vupkhsw, vupklsw, vmrgew, vmrgow

The following Iops were added to support the above instructions:
  Iop_MullEven32Ux4, Iop_MullEven32Sx4, Iop_Max64Sx2, Iop_Max64Ux2,
  Iop_Min64Sx2, Iop_Min64Ux2, Iop_CmpGT64Ux2, Iop_Rol64x2,
  Iop_QNarrowBin64Sto32Ux4, Iop_QNarrowBin64Uto32Ux4, Iop_NarrowBin64to32x4,

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

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

11 years agoImplement LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Julian Seward [Sun, 29 Sep 2013 19:48:44 +0000 (19:48 +0000)] 
Implement LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Fixes 321891, 323035, 324047.  (vasily.golubev@gmail.com)

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

11 years agoImplement LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Julian Seward [Sun, 29 Sep 2013 18:24:15 +0000 (18:24 +0000)] 
Implement LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Fixes 321891, 323035, 324047.  (vasily.golubev@gmail.com)

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

11 years agoAdd a kludgey implementation of XTEST to go with the kludgey
Julian Seward [Fri, 27 Sep 2013 15:03:58 +0000 (15:03 +0000)] 
Add a kludgey implementation of XTEST to go with the kludgey
implementation of XBEGIN.  Also kludge the CPUID output for AVX
capable targets so as to claim we support HTM.
Mark Wielaard, mjw@redhat.com)

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

11 years agoarmg_calculate_condition: add missing masking (probably pointless,
Julian Seward [Fri, 27 Sep 2013 12:11:50 +0000 (12:11 +0000)] 
armg_calculate_condition: add missing masking (probably pointless,
but makes it easy to verify).

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

11 years agomips64: finetune mips_dirtyhelper_calculate_FCSR
Petar Jovanovic [Tue, 24 Sep 2013 22:27:23 +0000 (22:27 +0000)] 
mips64: finetune mips_dirtyhelper_calculate_FCSR

Several MIPS32 Revision 2 instructions also belong to Revision 1 of MIPS64.
Modifing parts of mips_dirtyhelper_calculate_FCSR to be active for MIPS64R1.

This fixes none/tests/mips64/round when Valgrind is compiled for MIPS64 R1.

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

11 years agomips32: protect mips32r2 instructions with a flag
Petar Jovanovic [Sat, 21 Sep 2013 01:47:18 +0000 (01:47 +0000)] 
mips32: protect mips32r2 instructions with a flag

Regression issue that came when mips_dirtyhelper_calculate_FCSR was added.
Inline assembly with MIPS32r2 instructions needs to be protected by flags
that disable it for non-MIPS32r2 platforms such as some Broadcom boards.

Fixes the issue: Bugzilla 325124.

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

11 years agomips32/64: Save the value of FCSR register at the beginning and restore it
Dejan Jevtic [Fri, 20 Sep 2013 09:58:16 +0000 (09:58 +0000)] 
mips32/64: Save the value of FCSR register at the beginning and restore it
back at the end of dirty helper.

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

11 years agomips32/64: Code cleanup and VEX optimizations. No functional changes.
Dejan Jevtic [Thu, 19 Sep 2013 13:35:45 +0000 (13:35 +0000)] 
mips32/64: Code cleanup and VEX optimizations. No functional changes.

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

11 years agomips32/64: Fix the problem with dirty helper when the
Dejan Jevtic [Thu, 19 Sep 2013 10:22:42 +0000 (10:22 +0000)] 
mips32/64: Fix the problem with dirty helper when the
__mips_isa_rev is not 2 on higher.

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

11 years agoAdd support for the Intel TM "xbegin" instruction, by jumping directly
Julian Seward [Wed, 18 Sep 2013 19:41:43 +0000 (19:41 +0000)] 
Add support for the Intel TM "xbegin" instruction, by jumping directly
to the failure address.  Currently disabled pending finding hardware
that can actually execute xbegin, for testing purposes.

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

11 years agox86 front ends: tighten up decoding of MOV Ib,Eb and MOV Iv,Ev. This
Julian Seward [Wed, 18 Sep 2013 18:27:55 +0000 (18:27 +0000)] 
x86 front ends: tighten up decoding of MOV Ib,Eb and MOV Iv,Ev.  This
failed to check the g-register in the modrm byte, with the result that
it will mis-decode the AVX2 XABORT and XBEGIN instructions as these
instead, with obviously-bizarre consequences.

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

11 years agoUnbreak the build on non-MIPS platforms.
Tom Hughes [Wed, 18 Sep 2013 11:24:25 +0000 (11:24 +0000)] 
Unbreak the build on non-MIPS platforms.

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

11 years agomips32/mips64: additional VEX support for FCSR register.
Dejan Jevtic [Wed, 18 Sep 2013 10:06:13 +0000 (10:06 +0000)] 
mips32/mips64: additional VEX support for FCSR register.

Some mips fpu instructions are changing the value of the
fcsr register so we need to update the value of the fcsr
register in the guest state.

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

11 years agomips64: VEX support for MIPS64 Octeon Instructions
Petar Jovanovic [Wed, 18 Sep 2013 02:17:43 +0000 (02:17 +0000)] 
mips64: VEX support for MIPS64 Octeon Instructions

Modeling the following Cavium Octeon instructions:

exts, exts32, cins, cins32, snei, sne, seqi, dmul, seq.

Patch by Zahid Anwar.

Bugzilla issue 322150

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

11 years agomips: clean-up in hardware detection (Cavium/DSP ASEs)
Petar Jovanovic [Mon, 16 Sep 2013 18:11:59 +0000 (18:11 +0000)] 
mips: clean-up in hardware detection (Cavium/DSP ASEs)

This change is a clean up in MIPS hardware detection code.
New flag for Cavium Company ID is added, as well as the codes for 34K and
74K processors (MIPS Company ID). The later two represent platforms with DSP
ASEs implemented (Rev 1 and Rev 2 respectively). Macros to detect these two
platforms have been added as well.

Additional macros to extract Company ID out of hwcaps added as well, and
used where possible.

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

11 years agomips32: small cleanup in show_hwcaps_mips32
Petar Jovanovic [Sun, 15 Sep 2013 23:38:39 +0000 (23:38 +0000)] 
mips32: small cleanup in show_hwcaps_mips32

Small cleanup in show_hwcaps_mips32(). More will follow as we need to add
support for Cavium boards too.

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

11 years agos390: Add spechelper for s390_calculate_cc.
Florian Krohm [Fri, 13 Sep 2013 21:42:14 +0000 (21:42 +0000)] 
s390: Add spechelper for s390_calculate_cc.

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

11 years agoBug 323893 - SSE3 not available on amd cpus in valgrind.
Mark Wielaard [Fri, 13 Sep 2013 13:30:45 +0000 (13:30 +0000)] 
Bug 323893 - SSE3 not available on amd cpus in valgrind.

Check minimum hardware capabilities, not exact matches to prevent
downgrading to baseline if the hardware has more capabilities than
we expect.

Note that this is still not exactly correct. CPUID should depend on
VEX capabilities, not on underlying CPU, see bug 324882.

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

11 years agoThe Power ISA 2.07 document includes a correction to the description for the
Carl Love [Thu, 12 Sep 2013 17:26:42 +0000 (17:26 +0000)] 
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.

This patch fixes both the VEX bug in xscvspdp implementation:
The current implementation of xscvspdp emulates the instruction by
extracting the single-precision floating point from the vector register,
storing it in single-prcision, and then loading the data just stored using
the lfsx instruction. But the lfsx instruction does not change SNaN input
arguments to QNaN inputs before conversion to double-precision, so this
emulation is not sufficient for the xscvspdp instruction as described in the
current documentation. This patch fixes that issue by recognizing a SNaN input
and changing it to a QNaN before performing the emulation using lfsx.
While fixing the bug in xscvspdp implementation, it was also discovered that
xvcvspdp had the same issue where SNaN inputs were not being handled correctly,
so this patch also fixes its implementation, too

See bugzilla 324816.

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

11 years agoRemove dead code.
Florian Krohm [Thu, 12 Sep 2013 11:32:05 +0000 (11:32 +0000)] 
Remove dead code.

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

11 years agoEnhance ado_treebuild_BB to allow an expression preceding a Put
Florian Krohm [Wed, 11 Sep 2013 17:58:32 +0000 (17:58 +0000)] 
Enhance ado_treebuild_BB to allow an expression preceding a Put
statement and containing one or more Get expressions to be
substituted in an expression following the Put statement.
That transformation is harmless as long as the guest state areas being
accessed by the Put and Get(s) do not overlap.

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

11 years agomips64: fixed problem with Iop's for mips64.
Dejan Jevtic [Wed, 11 Sep 2013 15:34:37 +0000 (15:34 +0000)] 
mips64: fixed problem with Iop's for mips64.

Fixed problem with some Iop's that was discovered while running vbit-test
on mips64. Fixed operations are: Iop_1Uto64, Iop_Left64 and Iop_CmpwNEZ64.

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

11 years agoBugzilla 323437, this is phase 2 in a series of patches adding support for IBM
Carl Love [Tue, 10 Sep 2013 18:46:40 +0000 (18:46 +0000)] 
Bugzilla 323437, this is phase 2 in a series of patches adding support for IBM
Power ISA 2.07. The first bugzilla in the series was: 322294: Add initial
support for IBM Power ISA 2.07

Phase 2 adds support for the following new instructions to
VEX/priv/guest_ppc_toIR.c:
 - lq, stq, lqarx, stqcx.
 - mfvsrwz, mtvsrwz
 - fmrgew, fmrgow

There is a corresponding test case for these instructions, see the bugzilla
for the commit number.

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

11 years agoAdd a few more optimisations for CmpwNEZ64, CmpNEZ32, and CmpNEZ64.
Florian Krohm [Fri, 6 Sep 2013 23:13:39 +0000 (23:13 +0000)] 
Add a few more optimisations for CmpwNEZ64, CmpNEZ32, and CmpNEZ64.
Observed on s390.

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

11 years agoThe existing overflow detection in VEX/priv/guest_ppc_toIR.c/set_XER_OV_64()
Carl Love [Fri, 6 Sep 2013 22:27:34 +0000 (22:27 +0000)] 
The existing overflow detection in VEX/priv/guest_ppc_toIR.c/set_XER_OV_64()
under the case PPCG_FLAG_OP_MULLW: does not apply to the mulldo as we need to
detect overflow when performing a Multiply Low Doubleword (not Multiply Low
Word). Hence, we added a new enumeration value PPCG_FLAG_OP_MULLD in
VEX/priv/guest_ppc_defs.h and a corresponding new case under which the
computation for detecting overflow for mulldo/mulldo. is added in
set_XER_OV_64(). The tests have been added to: none/tests/ppc32/jm-insns.c

Bugzilla 324594, submitted by Anmol P. Paralkar

Patch reviewed and tested by Carl Love

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

11 years agoThe patch used the binary constants 0b10000 and 0b10001. The 0b designator
Carl Love [Fri, 6 Sep 2013 16:49:42 +0000 (16:49 +0000)] 
The patch used the binary constants 0b10000 and 0b10001.  The 0b designator
is supported by the GCC extensions but not all compilers seem to support the
0b extension in GCC.  Therefore, the binary constats were changed to their
equivalent hex values as suggested by Florian.

The Bugzilla for the change is 324518.

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

11 years agoUpdate list of ignored files.
Florian Krohm [Fri, 6 Sep 2013 15:04:39 +0000 (15:04 +0000)] 
Update list of ignored files.

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

11 years agoThe current code is not properly handling a non-zero TH field in the
Carl Love [Thu, 5 Sep 2013 19:47:40 +0000 (19:47 +0000)] 
The current code is not properly handling a non-zero TH field in the
dcbt instruction, which is valid for several forms of data cache block
touch instructions.  This patch adds the needed support to
VEX/priv/guest_ppc_toIR.c.

Bugzilla 324518

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

11 years agodeltaIRExpr cannot handle Iex_VECRET and Iex_BBPTR and
Florian Krohm [Tue, 3 Sep 2013 21:48:02 +0000 (21:48 +0000)] 
deltaIRExpr cannot handle Iex_VECRET and Iex_BBPTR and
needs to be guarded.

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

11 years agomips32/mips64: Fix the problem with lwl and lwr for mips32 and mips64.
Dejan Jevtic [Mon, 2 Sep 2013 15:35:58 +0000 (15:35 +0000)] 
mips32/mips64: Fix the problem with lwl and lwr for mips32 and mips64.

This patch is fixing the problem with lwl and lwr for mips32 and mips64
that was discovered while running v8 tests for mips32.

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

11 years agoComment-only change.
Julian Seward [Mon, 2 Sep 2013 13:17:49 +0000 (13:17 +0000)] 
Comment-only change.

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

11 years agoAdd an optimisation for Iop_Left64.
Florian Krohm [Sun, 1 Sep 2013 20:17:23 +0000 (20:17 +0000)] 
Add an optimisation for Iop_Left64.

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

11 years agoAdd algebraic simplifications for Iop_And64 (same as for Iop_And32).
Florian Krohm [Sun, 1 Sep 2013 14:22:05 +0000 (14:22 +0000)] 
Add algebraic simplifications for Iop_And64 (same as for Iop_And32).
Remove isOnesU32 which is no longer needed.

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

11 years agoSupport mmxext (integer sse) subset on i386 (athlon).
Mark Wielaard [Tue, 27 Aug 2013 10:19:03 +0000 (10:19 +0000)] 
Support mmxext (integer sse) subset on i386 (athlon).

Some processors like the AMD Athlon "Classic" support mmxext,
a sse1 subset. This subset is not properly detected by VEX.
The subset uses the same encoding as the sse1 instructions.

The subset is described at:
  http://support.amd.com/us/Embedded_TechDocs/22466.pdf
  https://en.wikipedia.org/wiki/3DNow!#3DNow.21_extensions

This introduces a new VEX_HWCAPS_X86_MMXEXT that sits between
the baseline (0) and VEX_HWCAPS_X86_SSE1. There is also a new
x86g_dirtyhelper_CPUID_mmxext to mimics a Athlon "Classic"
(Model 2, K75 "Pluto/Orion").

Groups all mmxext instructions together in one block.

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

11 years agomips64: Fix a problem with CCall.retty type.
Dejan Jevtic [Fri, 16 Aug 2013 12:11:20 +0000 (12:11 +0000)] 
mips64: Fix a problem with CCall.retty type.

Fix a problem when CCall needs to return 64 bits
for return type.

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

11 years agoAdd support for 256-bit return values for dirty helpers (amd64 only).
Julian Seward [Fri, 16 Aug 2013 08:32:15 +0000 (08:32 +0000)] 
Add support for 256-bit return values for dirty helpers (amd64 only).
(Patrick J. LoPresti, lopresti@gmail.com).  Bug 294285.

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

11 years agoEliminate IRExprP__VECRET and IRExprP__BBPTR and introduce two new
Florian Krohm [Thu, 15 Aug 2013 20:54:52 +0000 (20:54 +0000)] 
Eliminate IRExprP__VECRET and IRExprP__BBPTR and introduce two new
IRExpr kinds instead: Iex_VECRET and Iex_BBPTR. Add constructor
functions and adjust ppIRExpr, typeOfIRxpr and deepCopyExpr. The
rest is mechanics.

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

11 years agomips32/mips64: Fix compiler warnings.
Dejan Jevtic [Thu, 15 Aug 2013 13:38:26 +0000 (13:38 +0000)] 
mips32/mips64: Fix compiler warnings.

Fix some compiler warnings when compiling Valgrind for no mips arch.

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

11 years agoInitial ISA 2.07 support for POWER8-tuned libc
Carl Love [Mon, 12 Aug 2013 18:01:40 +0000 (18:01 +0000)] 
Initial ISA 2.07 support for POWER8-tuned libc

The IBM Power ISA 2.07 has been published on power.org, and IBM's new POWER8
processor is under development to implement that ISA. This patch provides
initial VEX support for running Valgrind on POWER8 systems running a soon-to-be
released Linux distribution. This Linux distro will include a POWER8-tuned
libc that uses a subset of the new instructions from ISA 2.07. Since virtually
all applications link with libc, it would be impossible to run an application
under Valgrind on this distro without adding support for these new instructions
to Valgrind, so that's the intent of this patch. Note that applications built
on this distro will *not* employ new POWER8 instructions by default. There are
roughly 150 new instructions in the Power ISA 2.07, including hardware
transaction management (HTM). Support for these new instructions (modulo the
subset included in this bug) will be added to Valgrind in a phased approach,
similar to what we did for Power ISA 2.06.

Bugzilla 322294

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

12 years agoAdd infrastructural support (IR, VEX) to allow returns of 128-
Julian Seward [Thu, 8 Aug 2013 10:28:59 +0000 (10:28 +0000)] 
Add infrastructural support (IR, VEX) to allow returns of 128-
and 256-bit values from dirty helper functions, in a way which is
independent of the target ABIs and of compilers generating
correct struct return code.

Is a prereq for bug #294285.

MIPS fixes: Petar Jovanovic, mips32r2@gmail.com
S390 fixes: Maran, maranp@linux.vnet.ibm.com

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

12 years agoAdd a spec rule for SUBQ/NLE.
Julian Seward [Wed, 7 Aug 2013 09:45:08 +0000 (09:45 +0000)] 
Add a spec rule for SUBQ/NLE.

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

12 years agoUpdate Makefile-gcc to include additional files that were added in r2702.
Florian Krohm [Sat, 3 Aug 2013 20:57:17 +0000 (20:57 +0000)] 
Update Makefile-gcc to include additional files that were added in r2702.
Fixes BZ 319494.
Patch by Stephen McCamant (smcc@CS.Berkeley.EDU).

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

12 years agoDo not use the 0b notation as older GCC's do not accept it.
Florian Krohm [Sat, 3 Aug 2013 20:39:32 +0000 (20:39 +0000)] 
Do not use the 0b notation as older GCC's do not accept it.
Fixes BZ 322851 and also unbreaks the OS X nightly build (hopefully).
Patch by Thomas Rast (trast@student.ethz.ch).

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

12 years agoRename ppc_cache_line_szB to indicate that this is the size
Florian Krohm [Sat, 3 Aug 2013 19:36:55 +0000 (19:36 +0000)] 
Rename ppc_cache_line_szB to indicate that this is the size
of the instruction cache.

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

12 years agomips32: Correctly model SHLL_S.PH on MIPS32.
Dejan Jevtic [Fri, 2 Aug 2013 16:02:28 +0000 (16:02 +0000)] 
mips32: Correctly model SHLL_S.PH on MIPS32.

Fix problem with IRTemp size when modeling SHLL_S.PH on MIPS32.

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

12 years agos390: New machine model: zBC12
Florian Krohm [Sun, 28 Jul 2013 15:28:57 +0000 (15:28 +0000)] 
s390: New machine model: zBC12

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

12 years agomips32: Add support for mips32 DSP instruction set.
Dejan Jevtic [Thu, 25 Jul 2013 09:08:03 +0000 (09:08 +0000)] 
mips32: Add support for mips32 DSP instruction set.

Add support for mips32 DSP and DSP revision 2 ASE.
More details about the mips32 DSP(r2) ASE:
http://www.mips.com/media/files/MD00566-2B-MIPSDSP-QRC-01.00.pdf
Applied patch provided by Maja Gagic <maja.gagic@rt-rk.com>

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

12 years agoImplement the following instructions, in both ARM and Thumb
Julian Seward [Thu, 4 Jul 2013 20:35:42 +0000 (20:35 +0000)] 
Implement the following instructions, in both ARM and Thumb
encodings:
  SSAX SXTAB16 SHASX SHSAX SHSUB16 SHSUB8
  UASX USAX UQADD16 UQASX UQSAX UHASX UHSAX REVSH

Fixes
  321363 321364 321466 321467 321468 321619 321704
  321620 321621 321692 321694 321696 321697 321703

(Vasily, w.golubev@mail.ru)

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

12 years agoAdd support for
Julian Seward [Thu, 4 Jul 2013 15:25:36 +0000 (15:25 +0000)] 
Add support for
(T1) STRBT reg+#imm8
(T1) STRHT reg+#imm8
(T1) LDRBT reg+#imm8
(T1) LDRSBT reg+#imm8
(T1) PLI reg+#imm12
(T2) PLI reg-#imm8
(T3) PLI PC+/-#imm12

Fixes: 319858 319932 320083 321693 321148
(Vasily, w.golubev@mail.ru)

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

12 years agomips: implement Iop_8Uto64 in iselInt64Expr
Petar Jovanovic [Thu, 4 Jul 2013 00:39:37 +0000 (00:39 +0000)] 
mips: implement Iop_8Uto64 in iselInt64Expr

Iop_8Uto64 was missing in iselInt64Expr.
The change should resolve Bugzilla #319505.

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

12 years agos390: Support some more BFP <-> DFP conversions (the ones
Florian Krohm [Mon, 17 Jun 2013 21:03:56 +0000 (21:03 +0000)] 
s390: Support some more BFP <-> DFP conversions (the ones
that were added in VEX r2727).
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

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

12 years agoAdd some more IRops to convert between binary floating point and
Florian Krohm [Mon, 17 Jun 2013 18:59:51 +0000 (18:59 +0000)] 
Add some more IRops to convert between binary floating point and
decimal floating point values. Needed to complete s390 DFP support.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

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

12 years agomips64: fix 'unused variable' warning
Petar Jovanovic [Sun, 9 Jun 2013 16:46:14 +0000 (16:46 +0000)] 
mips64: fix 'unused variable' warning

On a couple of places, the code expected either _MIPSEB or _MIPSEL flag to
use some variables, but none of these flags is set when the code is compiled
for non-MIPS architectures.

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

12 years agoEliminate IRRoundingModeDFP by merging its values into IRRoundingMode.
Florian Krohm [Thu, 6 Jun 2013 19:12:46 +0000 (19:12 +0000)] 
Eliminate IRRoundingModeDFP by merging its values into IRRoundingMode.
Retain encodings. The rationale is that a rounding mode is an abstraction
and as such independent of formats used to represent numeric values.
This was triggered by the need for a rounding mode to express conversions
between binary floating point values and decimal floating point values.

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

12 years agos390x: Make the CC_DEP1 field appear completely initialised when
Florian Krohm [Fri, 31 May 2013 15:41:55 +0000 (15:41 +0000)] 
s390x: Make the CC_DEP1 field appear completely initialised when
writing a 32-bit floating point value into it.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

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

12 years agomips32/mips64: implement sdl, sdr, swl and swr without reading memory
Petar Jovanovic [Fri, 31 May 2013 15:09:56 +0000 (15:09 +0000)] 
mips32/mips64: implement sdl, sdr, swl and swr without reading memory

New implementation of SDL, SDW, SWL and SWR instructions in a way in which
no memory read is required. This came as an issue for programs that map
memory as write-exec only.

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

12 years agoImplement STRT. Fixes #319395. (Vasily Golubev, w.golubev@mail.ru)
Julian Seward [Mon, 13 May 2013 10:28:59 +0000 (10:28 +0000)] 
Implement STRT.  Fixes #319395.  (Vasily Golubev, w.golubev@mail.ru)

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

12 years agoImplement SSAT16. Fixes #318929. (Vasily Golubev, w.golubev@mail.ru)
Julian Seward [Mon, 13 May 2013 10:02:33 +0000 (10:02 +0000)] 
Implement SSAT16.  Fixes #318929.  (Vasily Golubev, w.golubev@mail.ru)

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

12 years agoFix s390 build failure.
Florian Krohm [Sun, 12 May 2013 13:57:13 +0000 (13:57 +0000)] 
Fix s390 build failure.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

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

12 years agos390: First round of changes to support the PFPO insn.
Florian Krohm [Sat, 11 May 2013 15:02:58 +0000 (15:02 +0000)] 
s390: First round of changes to support the PFPO insn.
Support these IROps:
Iop_F64toD64, Iop_D64toF64
Iop_F64toD128, Iop_D128toF64,
Iop_F128toD128, Iop_D128toF128,

Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113

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

12 years agoGet rid of gcc warning on non-MIPS platforms.
Julian Seward [Wed, 8 May 2013 08:56:45 +0000 (08:56 +0000)] 
Get rid of gcc warning on non-MIPS platforms.

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

12 years agoAdd the following IROPs which are needed for s390 DFP support:
Florian Krohm [Sun, 5 May 2013 15:04:30 +0000 (15:04 +0000)] 
Add the following IROPs which are needed for s390 DFP support:
Iop_F64toD64, Iop_D64toF64
Iop_F64toD128, Iop_D128toF64,
Iop_F128toD128, Iop_D128toF128,

Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113

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

12 years agomips: fix some style issues, non-functional change
Petar Jovanovic [Sat, 27 Apr 2013 02:18:11 +0000 (02:18 +0000)] 
mips: fix some style issues, non-functional change

Minor cleanup, no real functional change.

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

12 years agomips: fix corner case for INS instruction
Petar Jovanovic [Sat, 27 Apr 2013 01:15:48 +0000 (01:15 +0000)] 
mips: fix corner case for INS instruction

This change fixes corner case for INS instruction when lsb = 0.
The test in none/tests/mips32/MIPS32int.c will be extended to include
additional test cases that trigger this condition.

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

12 years agoSTRD (both ARM and Thumb): for push-like cases -- specifically, STRD
Julian Seward [Fri, 26 Apr 2013 10:24:31 +0000 (10:24 +0000)] 
STRD (both ARM and Thumb): for push-like cases -- specifically, STRD
rD1,rD2, [sp, #-8], generate IR for the SP writeback before the
stores.  This loses restartability of the instruction but avoids
Memcheck complaining that we're writing below the stack pointer.

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

12 years agoImplement SMMLA{r}, both ARM and Thumb. n-i-bz.
Julian Seward [Tue, 23 Apr 2013 08:56:43 +0000 (08:56 +0000)] 
Implement SMMLA{r}, both ARM and Thumb.  n-i-bz.
(Ben Cheng <bccheng@google.com>)

Also, move ARM encoding of SMMUL{R} to a more sensible place.

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

12 years agoGenerate better code for Shl64(x, imm8) since the Neon front end
Julian Seward [Sun, 21 Apr 2013 00:45:18 +0000 (00:45 +0000)] 
Generate better code for Shl64(x, imm8) since the Neon front end
produces a lot of those for V{LD,ST}{1,2,3,4}.

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

12 years agoVLD4/VST4: generate in-line interleave/de-interleave code, so that
Julian Seward [Sat, 20 Apr 2013 23:27:36 +0000 (23:27 +0000)] 
VLD4/VST4: generate in-line interleave/de-interleave code, so that
loads can always be done in 8 byte units.

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

12 years agoVLD3/VST3: generate in-line interleave/de-interleave code, so that
Julian Seward [Sat, 20 Apr 2013 21:19:44 +0000 (21:19 +0000)] 
VLD3/VST3: generate in-line interleave/de-interleave code, so that
loads can always be done in 8 byte units.

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

12 years agomips: fix endian issues for LWL, LWR, LDR and LDL for mips64
Petar Jovanovic [Fri, 19 Apr 2013 12:35:00 +0000 (12:35 +0000)] 
mips: fix endian issues for LWL, LWR, LDR and LDL for mips64

This change:
- fixes endian issues for unaligned loads for MIPS64,
- (re)moves endian dependencies in guest-to-IR for Iop_ReinterpI32asF32
   and Iop_ReinterpI64asF64 to host-mips-isel,
- adds minor style changes in the area touched by the code.

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

12 years agoImproved front end translations for Neon V{LD,ST}{1,2} instructions,
Julian Seward [Thu, 18 Apr 2013 11:50:58 +0000 (11:50 +0000)] 
Improved front end translations for Neon V{LD,ST}{1,2} instructions,
that do deinterleaving/interleaving via IROps and so generate far
fewer memory references.  As a side effect, fix incorrect ARM back end
implementation of many of the SIMD lane interleaving/deinterleaving
and concatenation IROps.

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

12 years agoRemove some unused ifdeffery that allowed disabling QC flag updating
Julian Seward [Wed, 17 Apr 2013 11:21:58 +0000 (11:21 +0000)] 
Remove some unused ifdeffery that allowed disabling QC flag updating
for Neon.

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

12 years agoImplement ARM SDIV and UDIV instructions. Fixes #314178. Partially
Julian Seward [Thu, 11 Apr 2013 13:57:43 +0000 (13:57 +0000)] 
Implement ARM SDIV and UDIV instructions.  Fixes #314178.  Partially
based on a patch by Ben Cheng, bccheng@android.com.  Also renames two
misnamed PPC helpers.

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

12 years agoImplement (T1) LDRT reg+#imm8. Fixes #315689.
Julian Seward [Thu, 11 Apr 2013 10:56:42 +0000 (10:56 +0000)] 
Implement (T1) LDRT reg+#imm8.  Fixes #315689.
(Vasily, w.golubev@mail.ru)

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

12 years agoFix some rebasing fallout pertaining to today's AVX2 landing.
Julian Seward [Wed, 27 Mar 2013 22:15:36 +0000 (22:15 +0000)] 
Fix some rebasing fallout pertaining to today's AVX2 landing.
Fixes #317463.

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

12 years agoAdd support for the EQ_UQ SSE FP comparison operation. BZ#317444.
Tom Hughes [Wed, 27 Mar 2013 15:38:47 +0000 (15:38 +0000)] 
Add support for the EQ_UQ SSE FP comparison operation. BZ#317444.

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

12 years agoAMD64: Add support for AVX2, BMI1, BMI2 and FMA instructions (VEX side).
Julian Seward [Wed, 27 Mar 2013 11:37:33 +0000 (11:37 +0000)] 
AMD64: Add support for AVX2, BMI1, BMI2 and FMA instructions (VEX side).
Fixes #305728.  (Jakub Jelinek, jakub@redhat.com)

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

12 years agoImplement RDTSCP on amd64, finally. This fixes #251569 and dups
Julian Seward [Tue, 26 Mar 2013 13:53:18 +0000 (13:53 +0000)] 
Implement RDTSCP on amd64, finally.  This fixes #251569 and dups
311933, 313348 and 313354.

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

12 years agoImplement SSE4 MOVNTDQA insn. Fixes #316503.
Julian Seward [Tue, 26 Mar 2013 10:27:39 +0000 (10:27 +0000)] 
Implement SSE4 MOVNTDQA insn.  Fixes #316503.
(Patrick J. LoPresti, lopresti@gmail.com)

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

12 years agoFix an assertion failure on CVT.F64.S32 d16, d16, #1. Fixes #317186 (I think).
Julian Seward [Fri, 22 Mar 2013 13:28:50 +0000 (13:28 +0000)] 
Fix an assertion failure on CVT.F64.S32 d16, d16, #1.  Fixes #317186 (I think).

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

12 years agoVEX, ppc code cleanup
Carl Love [Wed, 20 Mar 2013 15:51:34 +0000 (15:51 +0000)] 
VEX, ppc code cleanup

This patch removes some dead code left behind when the code was restructured
to fix the implementation changes to make it compliant with the iop
definitions.

The patch makes no functional changes as it is just removing code that is not
reachable.

This patch is for Bugzilla 314269.

Signed-off-by: Carl Love <cel@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/vex/trunk@2697

12 years agos390: Support the SRNMT instruction.
Florian Krohm [Tue, 12 Mar 2013 01:31:24 +0000 (01:31 +0000)] 
s390: Support the SRNMT instruction.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

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

12 years agoImplement VCVT.{S,U}32.F64 D[d], D[d], #frac_bits. Fixes #315738.
Julian Seward [Wed, 6 Mar 2013 08:34:04 +0000 (08:34 +0000)] 
Implement VCVT.{S,U}32.F64 D[d], D[d], #frac_bits.  Fixes #315738.

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

12 years agoImplement VCVT.F64.{SU}32, #imm. Fixes #308717.
Julian Seward [Tue, 5 Mar 2013 14:26:22 +0000 (14:26 +0000)] 
Implement VCVT.F64.{SU}32, #imm.  Fixes #308717.

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

12 years agoHandle "vmov qDest.I32 V128{0xFFFF}" so to speak, and make the case
Julian Seward [Tue, 5 Mar 2013 10:35:44 +0000 (10:35 +0000)] 
Handle "vmov qDest.I32 V128{0xFFFF}" so to speak, and make the case
for a zero immediate more similar.  Verify assembled output against
GNU as.  Fixes #311318.

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

12 years agoImplement SMLAL{BB,BT,TB,TT}. Fixes #308718. (Mans Rullgard,
Julian Seward [Mon, 4 Mar 2013 18:33:56 +0000 (18:33 +0000)] 
Implement SMLAL{BB,BT,TB,TT}.  Fixes #308718.  (Mans Rullgard,
mans@mansr.com)

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

12 years agos390: Fix disassembly. Wrong argument order was causing asserts.
Florian Krohm [Sun, 3 Mar 2013 03:21:57 +0000 (03:21 +0000)] 
s390: Fix disassembly. Wrong argument order was causing asserts.

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

12 years agoRemove dead code (a Coverity finding).
Florian Krohm [Sat, 2 Mar 2013 20:46:08 +0000 (20:46 +0000)] 
Remove dead code (a Coverity finding).

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

12 years agomips: fix for some warnings in mips files when compiling on amd64/x86
Petar Jovanovic [Sat, 2 Mar 2013 02:37:01 +0000 (02:37 +0000)] 
mips: fix for some warnings in mips files when compiling on amd64/x86

Fixing some constant size related warnings in mips files on gcc20(amd64).
Thanks Philippe for reporting it.

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

12 years agoHandle WFE and SEV, needed for spinlock hinting.
Julian Seward [Fri, 1 Mar 2013 21:13:24 +0000 (21:13 +0000)] 
Handle WFE and SEV, needed for spinlock hinting.

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

12 years agomips: adding MIPS64LE support to VEX
Petar Jovanovic [Wed, 27 Feb 2013 22:57:17 +0000 (22:57 +0000)] 
mips: adding MIPS64LE support to VEX

Necessary changes to VEX to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267

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

12 years agos390: Non-functional change. Pedant at work...
Florian Krohm [Fri, 22 Feb 2013 03:40:22 +0000 (03:40 +0000)] 
s390: Non-functional change. Pedant at work...

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

12 years agos390: Fix a type mixup found by BEAM.
Florian Krohm [Thu, 21 Feb 2013 03:03:05 +0000 (03:03 +0000)] 
s390: Fix a type mixup found by BEAM.

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

12 years agos390: Support the following DFP insns:
Florian Krohm [Thu, 14 Feb 2013 14:27:12 +0000 (14:27 +0000)] 
s390: Support the following DFP insns:
- extract basied exponent
- insert biased exponent
- quantize
- reround to significance
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113.

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

12 years agoStop gcc-4.4 complaining when this file is compiled on a 32 bit platform.
Julian Seward [Mon, 11 Feb 2013 16:06:03 +0000 (16:06 +0000)] 
Stop gcc-4.4 complaining when this file is compiled on a 32 bit platform.

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

12 years agoMake HReg a struct. In the past there were several occurences where
Florian Krohm [Mon, 11 Feb 2013 00:47:35 +0000 (00:47 +0000)] 
Make HReg a struct. In the past there were several occurences where
a HReg was assigned to an integer. This worked by accident because the
bits representing the register number (which was meant to be accessed)
happened to be in the right place.
Two new functions: hregIsInvalid and sameHReg.
The HReg struct just wraps the integer that was previously used to
represent a register without changing the encoding.

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

12 years agos390: Be consistent with emulation warnings about unsupported
Florian Krohm [Mon, 11 Feb 2013 00:03:27 +0000 (00:03 +0000)] 
s390: Be consistent with emulation warnings about unsupported
rounding modes in absence of the floating-point extension facility.
For some insns we would vassert for others we'd give a warning.
Now we always issue an emulation warning.

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