]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
12 years agoIndentation only change.
Florian Krohm [Thu, 27 Dec 2012 20:59:43 +0000 (20:59 +0000)] 
Indentation only change.

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

12 years agos390: Support the "test data class/group" and "extract significance"
Florian Krohm [Thu, 27 Dec 2012 20:14:03 +0000 (20:14 +0000)] 
s390: Support the "test data class/group" and "extract significance"
insns. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

[ revision 2621 was also implemented by Maran. ]

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

12 years agoNew IROps: Iop_ExtractSigD64 and Iop_ExtractSigD128. These are needed to
Florian Krohm [Thu, 27 Dec 2012 20:01:13 +0000 (20:01 +0000)] 
New IROps: Iop_ExtractSigD64 and Iop_ExtractSigD128. These are needed to
implement s390's "extract significance" insns.

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

12 years agoRemove Makefile-icc which has been broken for a long time.
Florian Krohm [Thu, 27 Dec 2012 17:19:12 +0000 (17:19 +0000)] 
Remove Makefile-icc which has been broken for a long time.

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

12 years agos390: Do not waste a register when assigning a constant to a memory
Florian Krohm [Thu, 27 Dec 2012 00:59:43 +0000 (00:59 +0000)] 
s390: Do not waste a register when assigning a constant to a memory
location. If available, use MVHI and friends. If those are not available,
load the constant value into register r0 and store that. r0 is not visible
to register allocation and therefore using it does not increase register
pressure.
Remove S390_INSN_MZERO and replace it with S390_INSN_MIMM. Assigning zero
is just a special case..
Saves between 0.9% and 2.4% of insns as measured with the perf regression
bucket.

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

12 years agos390: Remove a forgotten debug print statement.
Florian Krohm [Thu, 27 Dec 2012 00:44:30 +0000 (00:44 +0000)] 
s390: Remove a forgotten debug print statement.

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

12 years agos390x: Support "compare biased exponent" insns CEDTR, CEXTR.
Florian Krohm [Wed, 26 Dec 2012 17:47:19 +0000 (17:47 +0000)] 
s390x: Support "compare biased exponent" insns CEDTR, CEXTR.
To do that properly, two new IROps are needed: Iop_CmpExpD64 and
Iop_CmpExpD128. It might seem that extracting the exponents using
Iop_ExtractExpD64/D128 and comparing the values could be used here.
But that only works for finite DFP values. Hence, the new IROps.

Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

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

12 years agoFix VEX standalone build with Makefile-gcc. This has been bit-rotting
Florian Krohm [Mon, 24 Dec 2012 00:25:34 +0000 (00:25 +0000)] 
Fix VEX standalone build with Makefile-gcc. This has been bit-rotting
for a while.

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

12 years agos390: New file s390_defs.h to contain definitions that are
Florian Krohm [Mon, 24 Dec 2012 00:14:31 +0000 (00:14 +0000)] 
s390: New file s390_defs.h to contain definitions that are
neither guest nor host specific, but just s390 specific. These
definitions formerly resided in host_s390_defs.h

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

12 years agos390: Simplify the optimisation for PUTs to tracked registers.
Florian Krohm [Sun, 23 Dec 2012 01:09:16 +0000 (01:09 +0000)] 
s390: Simplify the optimisation for PUTs to tracked registers.

There is no need to treat the guest IA register specially. The first
assignment in a SB to any tracked register will always assign the full value
and not do an incremental update. Therefore, maintaining
env->first_IA_assignment is redundant. Interestingly, the old code
forgot to mark the tracking state as valid when first_IA_assignment was
true, resulting in an inefficiency (in the order of 0.8% of insns).

Also, when a tracked register already contains the value that it is
being assigned, there is not need to
(a) check whether that register requires precise memory exceptions and
(b) if so, assign the new value.
By definition, the register is up-to-date and reassigning the new value
which is also the old value is meaningless. No idea, what I was thinking
at the time.

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

12 years agos390: Reduce the size of an s390_insn from 48 bytes to 32 bytes by
Florian Krohm [Sat, 22 Dec 2012 15:01:04 +0000 (15:01 +0000)] 
s390: Reduce the size of an s390_insn from 48 bytes to 32 bytes by
- adding one level of indirection for CDAS and DFP binops
- rearranging and tweaking the variant for helper calls
- using seperate insns kinds for signed and unsigned multiplication
  and division.
Add an assert to make sure the size stays at 32 bytes.

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

12 years agos390: Fix a silly mistake causing an infinite loop.
Florian Krohm [Sat, 22 Dec 2012 14:50:41 +0000 (14:50 +0000)] 
s390: Fix a silly mistake causing an infinite loop.
Spotted by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

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

12 years agos390: Generalise S390_INSN_GADD which only worked on the guest
Florian Krohm [Sat, 22 Dec 2012 02:28:25 +0000 (02:28 +0000)] 
s390: Generalise S390_INSN_GADD which only worked on the guest
state to S390_INSN_MADD which works for any memory location
addressable with base reg + 20-bit displacement.

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

12 years agos390: Fix an assert.
Florian Krohm [Sat, 22 Dec 2012 02:09:40 +0000 (02:09 +0000)] 
s390: Fix an assert.

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

12 years agos390: Rename s390_conv_t to s390_bfp_conv_t. Purely mechanical.
Florian Krohm [Fri, 21 Dec 2012 21:43:00 +0000 (21:43 +0000)] 
s390: Rename s390_conv_t to s390_bfp_conv_t. Purely mechanical.

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

12 years agos390: Distinguish between conversion to/from IRCmpFxxResult and
Florian Krohm [Fri, 21 Dec 2012 21:05:17 +0000 (21:05 +0000)] 
s390: Distinguish between conversion to/from IRCmpFxxResult and
IRCmpDxxResult, even though the encodings are currently the same.
Rename convert_s390_fpcc_to_vex to convert_s390_to_vex_bfpcc.
Add convert_s390_to_vex_dfpcc and convert_vex_dfpcc_to_s390.

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

12 years agoDefine IRCmpD64Result and IRCmpD128Result.
Florian Krohm [Fri, 21 Dec 2012 20:24:24 +0000 (20:24 +0000)] 
Define IRCmpD64Result and IRCmpD128Result.

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

12 years agos390: Add support for storing DFP values (32/64 bit).
Florian Krohm [Fri, 21 Dec 2012 18:55:03 +0000 (18:55 +0000)] 
s390: Add support for storing DFP values (32/64 bit).

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

12 years agoAdd support for these DFP insns:
Florian Krohm [Fri, 21 Dec 2012 17:32:12 +0000 (17:32 +0000)] 
Add support for these DFP insns:
AXTRA, CDTR, CXTR, DXTRA, LDETR, LXDTR, LDXTR, LEDTR, LTXTR, MXTRA, SXTRA
This is part of fixing BZ #307113.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com) with some minor
mods.

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

12 years agoRemove redundant code snippet.
Florian Krohm [Fri, 21 Dec 2012 04:40:28 +0000 (04:40 +0000)] 
Remove redundant code snippet.

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

12 years agoFix typos. Should really use __func__ instead.
Florian Krohm [Thu, 20 Dec 2012 19:44:18 +0000 (19:44 +0000)] 
Fix typos. Should really use __func__ instead.

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

12 years agos390: Fix IR generation for DDTR and MDTR. These insns do not modify
Florian Krohm [Thu, 20 Dec 2012 16:58:52 +0000 (16:58 +0000)] 
s390: Fix IR generation for DDTR and MDTR. These insns do not modify
the condition code.
Spotted and fixed by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

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

12 years agos390: Fix disassembly for ADTRA, DDTRA, MDTRA, and SDTRA.
Florian Krohm [Thu, 20 Dec 2012 14:44:42 +0000 (14:44 +0000)] 
s390: Fix disassembly for ADTRA, DDTRA, MDTRA, and SDTRA.
Spotted by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

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

12 years agos390: Add thunk layout documentation for S390_CC_OP_DFP_RESULT_64.
Florian Krohm [Thu, 20 Dec 2012 14:31:19 +0000 (14:31 +0000)] 
s390: Add thunk layout documentation for S390_CC_OP_DFP_RESULT_64.

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

12 years agoConstant folder: enable Sub32(x,0) ==> x.
Julian Seward [Wed, 19 Dec 2012 15:28:43 +0000 (15:28 +0000)] 
Constant folder: enable Sub32(x,0) ==> x.

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

12 years agoIop_GetMSBs8x16: remove a copy-n-paste error introduced in r2590.
Julian Seward [Wed, 19 Dec 2012 08:39:11 +0000 (08:39 +0000)] 
Iop_GetMSBs8x16: remove a copy-n-paste error introduced in r2590.

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

12 years agoFix typeOfPrimop for Iop_D32toD64 and Iop_D64toD32.
Florian Krohm [Wed, 19 Dec 2012 04:19:54 +0000 (04:19 +0000)] 
Fix typeOfPrimop for Iop_D32toD64 and Iop_D64toD32.
Spotted and fixed by Maran (maranp@linux.vnet.ibm.com).

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

12 years agoFix an assert in s390 disassembly. Eliminate a few magic array
Florian Krohm [Sun, 16 Dec 2012 22:49:05 +0000 (22:49 +0000)] 
Fix an assert in s390 disassembly. Eliminate a few magic array
width constants and use S390_MAX_MNEMONIC_LEN instead.
New function "mnemonic" to construct a mnemonic string padded with
blanks for alignment.

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

12 years agoTeach vprintf_wrk about '*' as format width, in which case the width
Florian Krohm [Sun, 16 Dec 2012 22:44:32 +0000 (22:44 +0000)] 
Teach vprintf_wrk about '*' as format width, in which case the width
is given in an argument.

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

12 years agoImplement 128-bit PMOVMSKB using a single new primop (Iop_GetMSBs8x16)
Julian Seward [Thu, 13 Dec 2012 18:29:56 +0000 (18:29 +0000)] 
Implement 128-bit PMOVMSKB using a single new primop (Iop_GetMSBs8x16)
rather than chopping it up into two 64-bit pieces in the front end.

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

12 years agoSupport the UMAAL instruction. (n-i-bz). Based on a patch from
Julian Seward [Wed, 12 Dec 2012 00:16:41 +0000 (00:16 +0000)] 
Support the UMAAL instruction.  (n-i-bz).  Based on a patch from
Torbjorn Granlund, tg@gmplib.org.

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

12 years agoGeneralise S390_INSN_GZERO which only worked on the guest
Florian Krohm [Tue, 11 Dec 2012 04:09:43 +0000 (04:09 +0000)] 
Generalise S390_INSN_GZERO which only worked on the guest
state to S390_INSN_MZERO which works for any memory location
addressable with base reg + 12-bit displacement.

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

12 years agoEliminate some lameness when writing out hwcaps.
Florian Krohm [Sun, 9 Dec 2012 17:53:45 +0000 (17:53 +0000)] 
Eliminate some lameness when writing out hwcaps.

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

12 years agoMove definition of facility bits to libvex_s390x_common.h so we
Florian Krohm [Sun, 9 Dec 2012 17:26:32 +0000 (17:26 +0000)] 
Move definition of facility bits to libvex_s390x_common.h so we
can use them in m_machine.c. Rename LSCOND facility to LSC.

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

12 years agoUse VEX types.
Florian Krohm [Sun, 9 Dec 2012 02:06:29 +0000 (02:06 +0000)] 
Use VEX types.

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

12 years agoComplete the decoder. All published opcodes are now handled.
Florian Krohm [Fri, 7 Dec 2012 04:42:53 +0000 (04:42 +0000)] 
Complete the decoder. All published opcodes are now handled.

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

12 years agoMake diagnostics for SIGILL more controllable (VEX part).
Julian Seward [Thu, 6 Dec 2012 18:08:04 +0000 (18:08 +0000)] 
Make diagnostics for SIGILL more controllable (VEX part).
Fixes #309425.  (Mark Wielaard, mjw@redhat.com)

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

12 years agoRe-enable XADD Gb,Eb. Fixes #307106. (Jakub Jelinek, jakub@redhat.com)
Julian Seward [Thu, 6 Dec 2012 17:29:10 +0000 (17:29 +0000)] 
Re-enable XADD Gb,Eb.  Fixes #307106.  (Jakub Jelinek, jakub@redhat.com)

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

12 years agoRecognise insns for zEC12 in the decoder.
Florian Krohm [Wed, 5 Dec 2012 04:23:42 +0000 (04:23 +0000)] 
Recognise insns for zEC12 in the decoder.
There is no IR generation for these insns yet.

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

12 years agoIn the past, the implementation of STFLE returned the facilities of the host
Florian Krohm [Tue, 4 Dec 2012 04:45:32 +0000 (04:45 +0000)] 
In the past, the implementation of STFLE returned the facilities of the host
machine. This was not consistent in the following sense: Suppose the host
has a facility F installed and this facility implies the availability of an
insn X. Suppose further, that insn X is not supported in valgrind.
An application progrm that tests the availability of insn X by checking
for its associated facility F will fail under valgrind when using X because
valgrind will SIGILL. Not so good.

This patch changes the STFLE behaviour to adjust the facilities of the
virtual machine according to what the set of insns that is actually
supported. It's an approximation, because for some facilities we only
support a subset of the insns enabled by that facility.

Fixes BZ 310931.

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

12 years agoUse "load on condition" insns, if availably, to implement
Florian Krohm [Mon, 3 Dec 2012 13:32:05 +0000 (13:32 +0000)] 
Use "load on condition" insns, if availably, to implement
S390_INSN_COND_MOVE.

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

12 years agoRefactor the code based on s390_irgen_LAA.
Florian Krohm [Sun, 2 Dec 2012 21:31:15 +0000 (21:31 +0000)] 
Refactor the code based on s390_irgen_LAA.
New functions: s390_irgen_load_and_add32/64 and
s390_irgen_load_and_bitwise32/64.

Part of fixing BZ #306035.

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

12 years agoFix implementation of LAA for atomic update.
Florian Krohm [Sun, 2 Dec 2012 20:58:17 +0000 (20:58 +0000)] 
Fix implementation of LAA for atomic update.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com).
Part of fixing BZ #306035.

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

12 years agoFix typo.
Florian Krohm [Sat, 1 Dec 2012 21:29:07 +0000 (21:29 +0000)] 
Fix typo.

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

12 years agoFormatting only change.
Florian Krohm [Sun, 25 Nov 2012 01:22:27 +0000 (01:22 +0000)] 
Formatting only change.

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

12 years agoMake some function parameters pointer to const.
Florian Krohm [Sat, 24 Nov 2012 21:07:14 +0000 (21:07 +0000)] 
Make some function parameters pointer to const.
Companion patch to valgrind r13138.

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

12 years agoCorrectly model LL/SC on MIPS.
Petar Jovanovic [Fri, 23 Nov 2012 00:44:37 +0000 (00:44 +0000)] 
Correctly model LL/SC on MIPS.

As the issue with RMW on MIPS does not block execution anymore (see Valgrind
patch r13136), we can switch back to model it through LoadL and StoreC instead
of using incorrect Load and Store.

This will give back correct output to memcheck/tests/atomic_incs on MIPS.

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

12 years agoChanges for -Wwrite-strings
Florian Krohm [Wed, 21 Nov 2012 00:36:55 +0000 (00:36 +0000)] 
Changes for -Wwrite-strings

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

12 years agoVEX, ppc fix use of modified value in the Iop_32HLto64 implementation
Carl Love [Tue, 20 Nov 2012 17:32:48 +0000 (17:32 +0000)] 
VEX, ppc fix use of modified value in the Iop_32HLto64 implementation

The issue with the Iop_32HLto64, as explained by Julian:
One of the "rules of the game" of instruction selection is that the register
returned by any of the isel* functions may not be modified -- if it needs to
be modified, first copy the value off to a different register. The rule exists
because, in this case, e->Iex.Binop.arg2 might be an IRExpr_RdTmp, in which
case iselWordExpr_R simply returns the register which holds the value of the
relevant IR temporary. And so if r_Lo is modified then any subsequent uses of
that IR temporary will get the wrong value. In this case, r_Lo is
modified without first copying it.

This patch fixes the issue by assigning the result of the AND operation to
a temporary and then using the temporary result in the OR operation thus
avoiding using a modified value.

This patch is for bugzilla 309922.

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

12 years agoAdd a special-case implementation of PCMPISTRI $0x3A, which generates
Julian Seward [Tue, 20 Nov 2012 15:24:24 +0000 (15:24 +0000)] 
Add a special-case implementation of PCMPISTRI $0x3A, which generates
in-line IR instead of calling helpers.  This is so that Memcheck can
do exact definedness propagation through it.  This is important for
dealing with inlined PCMPISTRI-based strlen calls.

#309921, comment 6.  (Patrick J. LoPresti , lopresti@gmail.com)

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

12 years agoFix type mixup. Spotted by GCC, analysed by Julian.
Florian Krohm [Mon, 19 Nov 2012 16:29:31 +0000 (16:29 +0000)] 
Fix type mixup. Spotted by GCC, analysed by Julian.

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

12 years agoAdd support for binary DFP operations (64-bit).
Florian Krohm [Sat, 10 Nov 2012 22:34:14 +0000 (22:34 +0000)] 
Add support for binary DFP operations (64-bit).
Patch by Maran (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

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

12 years agoImprove accuracy of definedness tracking through the x86 PMOVMSKB and
Julian Seward [Thu, 8 Nov 2012 10:57:08 +0000 (10:57 +0000)] 
Improve accuracy of definedness tracking through the x86 PMOVMSKB and
BSF instructions, as the lack of it causes false positives (VEX side).
Fixes #308627.  Combined efforts of Patrick J. LoPresti
<lopresti@gmail.com> and me.

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

12 years agoValgrind, ppc: Fix missing checks for 64-bit instructions operating in 32-bit mode...
Carl Love [Mon, 29 Oct 2012 20:23:41 +0000 (20:23 +0000)] 
Valgrind, ppc:  Fix missing checks for 64-bit instructions operating in 32-bit mode, Bugzilla 308573

A number of the POWER instructions are only intended to run on 64-bit
hardware.  These instructions will give a SIGILL instruction on 32-bit
hardware.  The check for 32-bit mode on some of these instructions is
missing.  Although, the 64-bit hardware will execute these instructions
on 64-bit hardware without generating a SIGILL the use of these
instructions in 32-bit mode on 64-bit hardware is typically indicative of
a programming error. There are cases where these instructions are used
to determine if the code is running on 32-bit hardware or not.  In these
cases, the instruction needs to generate a SIGILL for the error handler
to properly determine the hardware is running in 32-bit mode.

This patch adds the 32-bit mode check for those 64-bit instructions that
do not have the check.  If the check fails, the instruction is flagged
as an unsupported instruction and a SIGILL message is generated.

This patch fixes the bug reported in:
Bug 308573 - Internal Valgrind error on 64-bit instruction executed in
32-bit mode

Note, there is an accompaning fix to memcheck/tests/ppc32/power_ISA2_05.c
to only execute the 64-bit instruction prtyd test in 64-bit mode.

Carl Love  cel@us.ibm.com

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

12 years agoAdd machinery to support DFP rounding modes.
Florian Krohm [Sat, 27 Oct 2012 16:19:31 +0000 (16:19 +0000)] 
Add machinery to support DFP rounding modes.
Part of fixing BZ 307113.
Patch by Maran <maranp@linux.vnet.ibm.com>

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

12 years agoFix compilation warning on non-mips targets (rm was flagged as unused)
Julian Seward [Fri, 26 Oct 2012 08:00:59 +0000 (08:00 +0000)] 
Fix compilation warning on non-mips targets (rm was flagged as unused)

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

12 years agoConstify VEX's external interface.
Florian Krohm [Sun, 21 Oct 2012 02:09:51 +0000 (02:09 +0000)] 
Constify VEX's external interface.

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

12 years agoAdd a proper support for several MIPS instructions that generate SigFPE.
Petar Jovanovic [Fri, 19 Oct 2012 14:55:58 +0000 (14:55 +0000)] 
Add a proper support for several MIPS instructions that generate SigFPE.

This VEX change needs to be paired with r13059 on Valgrind.

Add support to properly handle TEQ, ADD and SUB instructions that generate
exceptions on MIPS platforms.

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

12 years agoAllow representation of trace caches (VexCache).
Florian Krohm [Thu, 18 Oct 2012 03:11:39 +0000 (03:11 +0000)] 
Allow representation of trace caches (VexCache).
Add more verbiage as to what can be expected from the "caches" array.

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

12 years agos390: Order the operands of the multiply-and-add/subtract IROps
Florian Krohm [Tue, 16 Oct 2012 02:53:33 +0000 (02:53 +0000)] 
s390: Order the operands of the multiply-and-add/subtract IROps
such that they match the definition in libvex_ir.h.  This was
spotted by Julian.

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

12 years agocheck in ltg jhe fix. Fixes https://bugs.kde.org/show_bug.cgi?id=308427
Christian Borntraeger [Mon, 15 Oct 2012 14:03:20 +0000 (14:03 +0000)] 
check in ltg jhe fix. Fixes https://bugs.kde.org/show_bug.cgi?id=308427

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

12 years agoFix HChar / UCHar / Char mixups. VEX now compiles without
Florian Krohm [Sat, 13 Oct 2012 19:34:19 +0000 (19:34 +0000)] 
Fix HChar / UCHar / Char mixups. VEX now compiles without
warnings about assigning pointers to incompatible types.

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

12 years agoPass VexArchInfo to the instrumentation functions.
Florian Krohm [Sun, 7 Oct 2012 21:58:07 +0000 (21:58 +0000)] 
Pass VexArchInfo to the instrumentation functions.

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

12 years agoAdd data structures for cache representation to libvex.h:
Florian Krohm [Sun, 7 Oct 2012 19:44:40 +0000 (19:44 +0000)] 
Add data structures for cache representation to libvex.h:
VexCacheInfo, VexCache, and VexCacheKind.
VexArchInfo gets a VexCacheInfo member which LibVEX_default_VexArchInfo
initialises.

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

12 years agos390: This is a pre-patch for DFP support. It renames certain
Florian Krohm [Sun, 7 Oct 2012 15:42:37 +0000 (15:42 +0000)] 
s390: This is a pre-patch for DFP support. It renames certain
identifiers to explicitly refer to BFP, as there will be counterparts
in the future for DFP.
Patch by Maran <maranp@linux.vnet.ibm.com>.
Part of fixing #307113.

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

12 years agoMake header files compilable by itself to get two benefits:
Florian Krohm [Sun, 30 Sep 2012 20:30:17 +0000 (20:30 +0000)] 
Make header files compilable by itself to get two benefits:
- never have to worry about order of inclusion
- never have to figure out hidden dependencies in order to be
  able to include a file

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

12 years agoChange the return value of LibVEX_{Chain,UnChain,PatchProfInc}.
Florian Krohm [Sat, 29 Sep 2012 17:05:46 +0000 (17:05 +0000)] 
Change the return value of LibVEX_{Chain,UnChain,PatchProfInc}.
These functions now always return the address range that was
patched. Therefore, these functions no longer need knowledge
about I-cache coherency of the host system.

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

12 years agoShorten the list of allocable registers for MIPS to fit Loongson MIPS32 mode.
Petar Jovanovic [Fri, 21 Sep 2012 00:06:14 +0000 (00:06 +0000)] 
Shorten the list of allocable registers for MIPS to fit Loongson MIPS32 mode.

In order to fit MIPS32 mode on Loongson and work around its issues, we avoid
use of odd single precision FP registers. This results in expected execution/
results of some FPU instructions on Loongson. Running FPU intensive tests has
not shown any performance decrease after the change is introduced.

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

12 years agoIn function irExpr_to_AvailExpr: Replace if-chains with a switch stmt.
Florian Krohm [Thu, 20 Sep 2012 02:40:57 +0000 (02:40 +0000)] 
In function irExpr_to_AvailExpr: Replace if-chains with a switch stmt.
This is a followup to r2524.

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

12 years agos390: Give function static linkage. Also avoids a compiler warning.
Florian Krohm [Thu, 20 Sep 2012 01:25:28 +0000 (01:25 +0000)] 
s390: Give function static linkage. Also avoids a compiler warning.

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

12 years agos390: Rename host_s390_disasm.[ch] to s390_disasm.[ch] as they
Florian Krohm [Thu, 20 Sep 2012 01:22:10 +0000 (01:22 +0000)] 
s390: Rename host_s390_disasm.[ch] to s390_disasm.[ch] as they
are not really host specific.

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

12 years agos390: Fix another harmless unop/binop field mixup.
Florian Krohm [Wed, 19 Sep 2012 16:01:21 +0000 (16:01 +0000)] 
s390: Fix another harmless unop/binop field mixup.
Spotted by Maran <maranp@linux.vnet.ibm.com>

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

12 years agos390: Update IR generation for the SRNM insn.
Florian Krohm [Tue, 18 Sep 2012 20:24:38 +0000 (20:24 +0000)] 
s390: Update IR generation for the SRNM insn.
Add support for the SRNMB insn.
New emulation warning EmWarn_S390X_invalid_rounding.

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

12 years agoAdd support for: uqsub16 shadd16 uhsub8 uhsub16. Fixes #304035.
Julian Seward [Mon, 17 Sep 2012 15:27:58 +0000 (15:27 +0000)] 
Add support for: uqsub16 shadd16 uhsub8 uhsub16.  Fixes #304035.

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

12 years agoFix PCMPxSTRx variant $0x46. Fixes #306664.
Julian Seward [Mon, 17 Sep 2012 13:40:11 +0000 (13:40 +0000)] 
Fix PCMPxSTRx variant $0x46.  Fixes #306664.

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

12 years agoSTM<c>.W <Rn>{!},<registers> (Encoding T2): allow the base register to
Julian Seward [Mon, 17 Sep 2012 11:37:43 +0000 (11:37 +0000)] 
STM<c>.W <Rn>{!},<registers> (Encoding T2): allow the base register to
appear in the list in any position, provided that writeback is not
selected.  Fixes #306297.

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

12 years agoConstify the format string in a few printf-like functions.
Florian Krohm [Thu, 13 Sep 2012 20:21:42 +0000 (20:21 +0000)] 
Constify the format string in a few printf-like functions.

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

12 years agoTweak the IR injector so it can handle an immediate operand for
Florian Krohm [Thu, 13 Sep 2012 19:33:24 +0000 (19:33 +0000)] 
Tweak the IR injector so it can handle an immediate operand for
shift operations. This is needed for Iop_ShlD64 and the like on
powerpc where the shift amount is an immediate field in the insn.
Part of fixing bugzilla #305948.

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

12 years agoAvoid compiler warning.
Florian Krohm [Thu, 13 Sep 2012 15:58:01 +0000 (15:58 +0000)] 
Avoid compiler warning.

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

12 years agos390: Handle S390_BFP_NABS correctly for 128-bit arguments.
Florian Krohm [Thu, 13 Sep 2012 03:13:26 +0000 (03:13 +0000)] 
s390: Handle S390_BFP_NABS correctly for 128-bit arguments.

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

12 years agos390: Fix s390_emit_SFPC. That insn never required two registers.
Florian Krohm [Wed, 12 Sep 2012 19:52:16 +0000 (19:52 +0000)] 
s390: Fix s390_emit_SFPC. That insn never required two registers.

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

12 years agos390: Change the handling of S390_ROUND_PER_FPC (which indicates that the
Florian Krohm [Wed, 12 Sep 2012 19:38:42 +0000 (19:38 +0000)] 
s390: Change the handling of S390_ROUND_PER_FPC (which indicates that the
actual rounding mode is to be taken from the FPC register). Previously, this
was just mapped to S390_ROUND_NEAREST_EVEN, which obviously has correctness
issues.

First, we add a function get_bfp_rounding_mode_from_fpc to extract the
rounding mode from the guest FPC when building IR.
Second, have encode_bfp_rounding_mode invoke get_bfp_rounding_mode_from_fpc
whenever a S390_ROUND_PER_FPC is requested.
Third, in insn selection track whether (and if so to what value) the
rounding mode was set for the IRSB at hand. That way redundant assignments
can be avoided. This works well because the IR optimiser do a fine job
recognising end eliminating the expressions returned earlier from
get_bfp_rounding_more_from_fpc. So they get all mapped to the same IRTemp.
Note, VEX r2524 is essential to get this behaviour.
Fourth, remove the rounding more from the bfp_unop/binop/triop s390_insns.
Fifth, if the rounding mode can be set on the insn directly, prefer that
over setting it in the FPC and picking it up from there.

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

12 years agoAdd three new kinds of AvailExpr: Mttc, Mtct, and Mtcc
Florian Krohm [Wed, 12 Sep 2012 16:40:54 +0000 (16:40 +0000)] 
Add three new kinds of AvailExpr:  Mttc, Mtct, and Mtcc
namely for Mux0X expressions where one or both of the operands
is constant.

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

12 years agos390: Remove insns for 128-bit BFP and merge with 32/64-bit. This
Florian Krohm [Mon, 10 Sep 2012 23:44:37 +0000 (23:44 +0000)] 
s390: Remove insns for 128-bit BFP and merge with 32/64-bit. This
eliminates code duplication.

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

12 years agos390: More prep work bfp reorg. In the future unary/binary/ternary
Florian Krohm [Mon, 10 Sep 2012 03:09:04 +0000 (03:09 +0000)] 
s390: More prep work bfp reorg. In the future unary/binary/ternary
operations on bfp data will no longer require a rounding mode in the
s390_insn. Only type conversion operations need a rounding mode.
So in this patch S390_BFP_CONVERT is introduced and
S390_BFP128_CONVERT_TO/FROM are consolidated to S390_BFP128_CONVERT.
This also makes the representation of bfp and bfp128 symmetric.
s390_insn gets a new variant: s390_convert.
The type conversion ops get their own data type now: s390_conv_t

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

12 years agos390: Prepare for bfp reorg. Change the emit functions for the
Florian Krohm [Sun, 9 Sep 2012 18:18:25 +0000 (18:18 +0000)] 
s390: Prepare for bfp reorg. Change the emit functions for the
convert-to-fixed and load-rounded instructions to emit the extended
form. E.g. change s390_emit_CEFBR to s390_emit_CEFBRA. In the future
we will take advantage of those insns if the host's hardware facilities
allow it.

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

12 years agos390: Add asserts to s390_emit_XYZ functions for convert-to/from-logical.
Florian Krohm [Sun, 9 Sep 2012 18:12:28 +0000 (18:12 +0000)] 
s390: Add asserts to s390_emit_XYZ functions for convert-to/from-logical.
This should have been part of r2496 when those functions were added.

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

12 years agoCorrecting how load/store doubles are modelled on MIPS for big-endian.
Petar Jovanovic [Sun, 9 Sep 2012 01:10:59 +0000 (01:10 +0000)] 
Correcting how load/store doubles are modelled on MIPS for big-endian.

One of the previous changes, r2511, was correct for little-endian and introduced
a regression for big-endian MIPS. This corrects the endianness issues.

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

12 years agos390: Fix another mixup. Did not cause problems due to same
Florian Krohm [Fri, 7 Sep 2012 21:18:42 +0000 (21:18 +0000)] 
s390: Fix another mixup. Did not cause problems due to same
field offset.

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

12 years agoFix a mixup. This never caused a problem because the fields happened
Florian Krohm [Fri, 7 Sep 2012 15:00:53 +0000 (15:00 +0000)] 
Fix a mixup. This never caused a problem because the fields happened
to have the same offset.

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

12 years agos390: Fix condition code computation for convert-to-fixed/logical
Florian Krohm [Thu, 6 Sep 2012 03:13:22 +0000 (03:13 +0000)] 
s390: Fix condition code computation for convert-to-fixed/logical
insns. Previously the condition code was computed based on the
to-be-converted value only. But that is not sufficient as testcase
none/tests/s390x/rounding-1 shows. The rounding mode needs to be
considered, too. Therefore, the rounding mode is now stored in the
flags thunk as well (in IRRoundingMode encoding). Note, that this is
done for *all* convert-to-fixed/logical insns. It's possible that some
of them do not need the rounding mode but I did not bother exploring
the fine print. Setting the rounding mode as it was on the incoming
insn certainly will not be detrimental so we can as well do it.
This patch fixes bugzilla #306054.

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

12 years agos390: The load-rounded insns also need to issue an emulation
Florian Krohm [Wed, 5 Sep 2012 20:05:20 +0000 (20:05 +0000)] 
s390: The load-rounded insns also need to issue an emulation
warning when the floating point extension is not present and
m3 != 0.

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

12 years agos390: Non-functional change.
Florian Krohm [Wed, 5 Sep 2012 19:54:08 +0000 (19:54 +0000)] 
s390: Non-functional change.
Rename enable_rounding_mode to enable_bfp_rounding_mode in
anticipation of dfp coming. Change its return value to be an
IRTemp which will be handy soon. Fix all call-sites.

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

12 years agoBinary floating point cleanup. This was an area that was hushed up
Florian Krohm [Wed, 5 Sep 2012 04:19:09 +0000 (04:19 +0000)] 
Binary floating point cleanup. This was an area that was hushed up
a bit when the s390 port was first committed. Time to get it in shape.

This patch
- completes s390_round_t to list all rounding modes that can appear
  in a convert-to instruction
- adapts function encode_rounding_mode accordingly
- ensures that all s390_round_t -> IRRoundingMode conversions go through
  encode_rounding_mode

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

12 years agoAdd vassert for DFP shift value to make sure shift value is an immediate value.
Carl Love [Tue, 4 Sep 2012 22:09:48 +0000 (22:09 +0000)] 
Add vassert for DFP shift value to make sure shift value is an immediate value.
V-bit tester was putting shift value in a register for the DFP shift
instructions causing the test to crash, see bugzilla #305948.

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

12 years agoLoad/store doubles on MIPS are modeled through Ity_F64 rather than two Ity_F32.
Petar Jovanovic [Tue, 4 Sep 2012 13:45:42 +0000 (13:45 +0000)] 
Load/store doubles on MIPS are modeled through Ity_F64 rather than two Ity_F32.

This patch changes how the load/store doublewords are modeled on MIPS.
Previously, this was modeled through two Ity_F32s which caused test reports to
be different to expected.
This fixes memcheck/tests/fprw.

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

12 years agoAdd ARM front/back end support for IR injection.
Julian Seward [Mon, 3 Sep 2012 21:48:42 +0000 (21:48 +0000)] 
Add ARM front/back end support for IR injection.

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

12 years agos390: Undo part of r2501. The "convert to fixed" opcodes always have an m3
Florian Krohm [Mon, 3 Sep 2012 17:41:22 +0000 (17:41 +0000)] 
s390: Undo part of r2501. The "convert to fixed" opcodes always have an m3
field -- independent of the floating point extension facility.
So do not issue an emulation warning for those opcodes.

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

12 years agoSupport the variety of "convert to/from fixed" and "load rounded" opcodes
Florian Krohm [Sun, 2 Sep 2012 18:07:08 +0000 (18:07 +0000)] 
Support the variety of "convert to/from fixed" and "load rounded" opcodes
that have an additional m3 and/or m4 field.
Add emulation warning EmWarn_S390X_fpext_rounding and issue it in case
the current opcode cannot be emulated correctly (i.e. with the specified
rounding mode).
New function: emulation_warning.
Part of fixing bugzilla #306098.

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

12 years agoRemove alignment checks for VMPSADBW, VPHMINPOSUW, VPALIGNR since they
Julian Seward [Sun, 2 Sep 2012 12:13:34 +0000 (12:13 +0000)] 
Remove alignment checks for VMPSADBW, VPHMINPOSUW, VPALIGNR since they
do not apply to the AVX versions of these instructions.  Fixes #305926.
(Jakub Jelinek, jakub@redhat.com)

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