]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
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

12 years agos390: Mark a few more function parameters as unused.
Florian Krohm [Sat, 1 Sep 2012 20:01:39 +0000 (20:01 +0000)] 
s390: Mark a few more function parameters as unused.

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

12 years agos390: Generate an emulation failure if an insn is encountered that
Florian Krohm [Sat, 1 Sep 2012 17:54:09 +0000 (17:54 +0000)] 
s390: Generate an emulation failure if an insn is encountered that
requires the floating point extension facility but the host does not
have it. Factored out function emulation_failure.

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

12 years agos390: Add support for the "convert from/to logical" instruction family.
Florian Krohm [Sat, 1 Sep 2012 00:12:11 +0000 (00:12 +0000)] 
s390: Add support for the "convert from/to logical" instruction family.
A few (7) new IROps are introduced.
Patch by Christian Borntraeger (borntraeger@de.ibm.com).
Fixes bugzilla #274695.

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

12 years agoComment only change.
Florian Krohm [Thu, 30 Aug 2012 22:57:47 +0000 (22:57 +0000)] 
Comment only change.

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

12 years agos390: Add floating point extension facility to hwcaps.
Florian Krohm [Thu, 30 Aug 2012 20:28:00 +0000 (20:28 +0000)] 
s390: Add floating point extension facility to hwcaps.

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

12 years agoFix address computation in IR injection. When loading / storing a
Florian Krohm [Wed, 29 Aug 2012 17:40:52 +0000 (17:40 +0000)] 
Fix address computation in IR injection. When loading / storing a
128-bit value as 2 64-bit values, the two memory locations are 8 bytes
apart. Always. Everywhere. Due to a thinko this was busted on 32-bit
eachines.
Also add an assert that values requiring more than 128 bit are currently
not supported.

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

12 years agoFix IR injection for ppc32. Need to use mkSzImm not mkU64...
Florian Krohm [Wed, 29 Aug 2012 15:00:13 +0000 (15:00 +0000)] 
Fix IR injection for ppc32. Need to use mkSzImm not mkU64...

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

12 years agoMake debug printout look nicer.
Florian Krohm [Tue, 28 Aug 2012 20:58:23 +0000 (20:58 +0000)] 
Make debug printout look nicer.

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

12 years agoVEX-side support for the V-bit tester.
Florian Krohm [Tue, 28 Aug 2012 16:49:30 +0000 (16:49 +0000)] 
VEX-side support for the V-bit tester.
- recognise the new "special instruction" for all architectures
  (ARM needs implementation work; x86 and ARM are untested)
- inject IR into the superblock
- type definition for the IR injection control block

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

12 years agos390: Add the zEC12 machine model.
Florian Krohm [Tue, 28 Aug 2012 13:31:31 +0000 (13:31 +0000)] 
s390: Add the zEC12 machine model.

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

12 years agos390: Add support for the ecag insn. Patch from Divya Vyas
Florian Krohm [Sun, 26 Aug 2012 18:58:13 +0000 (18:58 +0000)] 
s390: Add support for the ecag insn. Patch from Divya Vyas
(divyvyas@linux.vnet.ibm.com) with mods to terminate the super block
with EmFail in case the insn is not available on the host.
Part of fixing bugzilla #275800.

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

12 years agoOn s390: Terminate the superblock with Ijk_EmFail if an stckf insn
Florian Krohm [Sun, 26 Aug 2012 14:32:28 +0000 (14:32 +0000)] 
On s390: Terminate the superblock with Ijk_EmFail if an stckf insn
is encountered but not supported on the host.

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

12 years agos390: Add STCKF hardware facility to hwcaps.
Florian Krohm [Sun, 26 Aug 2012 04:22:33 +0000 (04:22 +0000)] 
s390: Add STCKF hardware facility to hwcaps.

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

12 years agoOn s390: Terminate the superblock with Ijk_EmFail if an stfle insn
Florian Krohm [Sun, 26 Aug 2012 03:41:56 +0000 (03:41 +0000)] 
On s390: Terminate the superblock with Ijk_EmFail if an stfle insn
is encountered but not supported on the host.

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

12 years agoFollowup to r2483, purely mechanical. Rename:
Florian Krohm [Sun, 26 Aug 2012 03:20:07 +0000 (03:20 +0000)] 
Followup to r2483, purely mechanical. Rename:
VexEmWarn -> VexEmNote
EmWarn_NUMBER -> EmNote_NUMBER
guest_EMWARN -> guest_EMNOTE
LibVEX_EmWarn_string -> LibVEX_EmNote_string
offB_EMWARN -> offB_EMNOTE
EmWarn_NONE -> EmNote_NONE

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

12 years agoRename libvex_emwarn.h to libvex_emnote.h and fix all
Florian Krohm [Sat, 25 Aug 2012 21:48:04 +0000 (21:48 +0000)] 
Rename libvex_emwarn.h to libvex_emnote.h and fix all
#include's. The renaming of guest_EMWARN, VexemWarn etc will
be done in a followup patch.
The rationale for all this is that we want to reuse the existing
machinery for emulation warnings also for emulation failures.
And that calls for some kind of neutral naming scheme.

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

12 years agoComment only change.
Florian Krohm [Sat, 25 Aug 2012 02:01:25 +0000 (02:01 +0000)] 
Comment only change.

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

12 years agoRemove now-redundant comment that should have been removed in r2475.
Julian Seward [Fri, 24 Aug 2012 16:47:27 +0000 (16:47 +0000)] 
Remove now-redundant comment that should have been removed in r2475.

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

12 years agoImplement MOVBE in 32 bit mode. Fixes #304867. (Ambroz Bizjak,
Julian Seward [Thu, 23 Aug 2012 23:39:49 +0000 (23:39 +0000)] 
Implement MOVBE in 32 bit mode.  Fixes #304867.  (Ambroz Bizjak,
ambrop7@gmail.com)

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

12 years agoImplement QDADD and QDSUB. Fixes #305199. (Mans Rullgard,
Julian Seward [Thu, 23 Aug 2012 20:56:17 +0000 (20:56 +0000)] 
Implement QDADD and QDSUB.  Fixes #305199.  (Mans Rullgard,
mans@mansr.com)

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

12 years agoFix LZCNT and TZCNT properly. Fixes #295808. (Jakub Jelinek,
Julian Seward [Thu, 23 Aug 2012 20:14:51 +0000 (20:14 +0000)] 
Fix LZCNT and TZCNT properly.  Fixes #295808.  (Jakub Jelinek,
jakub@redhat.com)

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

12 years agoRe-enable 'prefetch m8' and 'prefetchw m8'. Fixes #305321.
Julian Seward [Thu, 23 Aug 2012 19:47:05 +0000 (19:47 +0000)] 
Re-enable 'prefetch m8' and 'prefetchw m8'.  Fixes #305321.

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

12 years agoIimplement 0F 7F encoding of movq between two registers. Fixes
Julian Seward [Thu, 23 Aug 2012 19:00:06 +0000 (19:00 +0000)] 
Iimplement 0F 7F encoding of movq between two registers.  Fixes
#305042.  (Mans Rullgard, mans@mansr.com)

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

12 years agoHandle a reg-reg encoding of MOVAPS. Fixes #289584.
Julian Seward [Thu, 23 Aug 2012 18:49:59 +0000 (18:49 +0000)] 
Handle a reg-reg encoding of MOVAPS.  Fixes #289584.
(Alexander Potapenko, glider@google.com)

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

12 years agoRemove unused IRops Iop_SqrtF64r32 and Iop_CalcFPRF.
Florian Krohm [Tue, 21 Aug 2012 22:15:19 +0000 (22:15 +0000)] 
Remove unused IRops Iop_SqrtF64r32 and Iop_CalcFPRF.

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

12 years agoHandle Iop_Left16 so And16 / Sub16 work properly with memcheck.
Florian Krohm [Mon, 20 Aug 2012 20:13:27 +0000 (20:13 +0000)] 
Handle Iop_Left16 so And16 / Sub16 work properly with memcheck.

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

12 years agoFix insn selection for Iop_Shr8/16 and Iop_Sar8/16 on s390.
Florian Krohm [Mon, 20 Aug 2012 13:44:29 +0000 (13:44 +0000)] 
Fix insn selection for Iop_Shr8/16 and Iop_Sar8/16 on s390.

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

12 years agoRemove unused IR ops: Iop_I16StoF64, Iop_F32toI16S, and Iop_I16StoF32.
Florian Krohm [Sat, 18 Aug 2012 02:41:58 +0000 (02:41 +0000)] 
Remove unused IR ops: Iop_I16StoF64, Iop_F32toI16S, and Iop_I16StoF32.

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

12 years agoFix a mnemonic
Florian Krohm [Thu, 16 Aug 2012 23:57:43 +0000 (23:57 +0000)] 
Fix a mnemonic

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

12 years agoFix a mixup. This never caused a problem because both fields have
Florian Krohm [Thu, 16 Aug 2012 00:11:20 +0000 (00:11 +0000)] 
Fix a mixup. This never caused a problem because both fields have
the same offset in the enclosing struct.

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

12 years agoVEX part Implement --vex-iropt-register-updates=sp-at-mem-access
Philippe Waroquiers [Tue, 14 Aug 2012 22:29:01 +0000 (22:29 +0000)] 
VEX part Implement --vex-iropt-register-updates=sp-at-mem-access

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

13 years agoSupport Ijk_TInval style exits on ARM, so that --smc-check= works on
Julian Seward [Wed, 8 Aug 2012 21:02:20 +0000 (21:02 +0000)] 
Support Ijk_TInval style exits on ARM, so that --smc-check= works on
ARM.  (Not that it's actually necessary, but still ..)

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

13 years agofix the put optimization. It is ok to have F-types in the CC_*
Christian Borntraeger [Wed, 8 Aug 2012 14:11:33 +0000 (14:11 +0000)] 
fix the put optimization. It is ok to have F-types in the CC_*
registers, dont assert, just use the slow path.

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

13 years agoUpdate copyright notices for s390
Florian Krohm [Mon, 6 Aug 2012 18:33:21 +0000 (18:33 +0000)] 
Update copyright notices for s390

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

13 years agoThe arguments in a helper call need to be sign/zero-extended
Florian Krohm [Mon, 6 Aug 2012 13:35:33 +0000 (13:35 +0000)] 
The arguments in a helper call need to be sign/zero-extended
to 64 bit. Fix helper calls accordingly. And because I keep forgetting
this, add checking machinery in the insn selector so it won't happen again.
Diagnosed by Christian Borntraeger.

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

13 years agoAdd support for the cu41 insn. This completes the unicode conversion
Florian Krohm [Mon, 6 Aug 2012 00:07:54 +0000 (00:07 +0000)] 
Add support for the cu41 insn. This completes the unicode conversion
insns and fixes #289839.

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

13 years agoUpdate copyright dates to include 2012.
Julian Seward [Sun, 5 Aug 2012 15:36:51 +0000 (15:36 +0000)] 
Update copyright dates to include 2012.

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

13 years agoSupport the cu14 insn. That insn is very much like cu12 except the
Florian Krohm [Sun, 5 Aug 2012 02:59:55 +0000 (02:59 +0000)] 
Support the cu14 insn. That insn is very much like cu12 except the
converted value is always 4 byte wide. The only other difference is
the encoding of a 4-byte UTF-8 character.
Some code refactoring does the trick.
Part of fixing #289839.

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

13 years agoFix a bug in insn selection. For some reason Iop_1UtoXYZ did no
Florian Krohm [Sat, 4 Aug 2012 04:25:30 +0000 (04:25 +0000)] 
Fix a bug in insn selection. For some reason Iop_1UtoXYZ did no
zero-extension. That is essential, as not all computation is donw
using 8-byte values.
For example
- do a 64-bit computation in r1; assume leftmost 4 bytes != 0
- do a 32-bit computation in r1; leftmost 4 bytes are untouched != 0
- do 32to1 on r1; rightmost 4 bytes == 1; leftmost 4 bytes != 0
- do 1Uto64 on r1
Without zero-extension r1 will contain a value that is not boolean

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

13 years agoAdd IR debugging aid.
Florian Krohm [Fri, 3 Aug 2012 18:41:58 +0000 (18:41 +0000)] 
Add IR debugging aid.

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

13 years agoSupport cu12 insn. Part of fixing #289839.
Florian Krohm [Fri, 3 Aug 2012 18:35:39 +0000 (18:35 +0000)] 
Support cu12 insn. Part of fixing #289839.

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

13 years agoFix a bug in insn selection. Though shalt not modify the
Florian Krohm [Fri, 3 Aug 2012 00:42:18 +0000 (00:42 +0000)] 
Fix a bug in insn selection. Though shalt not modify the
register returned by s390_isel_XYZ_expr...

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

13 years agoVEX part (remove --vex-iropt-precise-memory-exns, add --vex-iropt-register-updates)
Philippe Waroquiers [Wed, 1 Aug 2012 22:04:13 +0000 (22:04 +0000)] 
VEX part (remove --vex-iropt-precise-memory-exns, add --vex-iropt-register-updates)

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

13 years agoImplement VCVT.F32.{S,U}32 S[d], S[d], #frac_bits. Fixes #287175.
Julian Seward [Wed, 1 Aug 2012 20:05:42 +0000 (20:05 +0000)] 
Implement VCVT.F32.{S,U}32 S[d], S[d], #frac_bits.  Fixes #287175.

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

13 years agoAdd support for the CU42 insn. Part of fixing bugzilla #289839.
Florian Krohm [Sat, 28 Jul 2012 22:18:32 +0000 (22:18 +0000)] 
Add support for the CU42 insn. Part of fixing bugzilla #289839.

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

13 years agoNon-functional change. Fix some overly long lines and such..
Florian Krohm [Fri, 27 Jul 2012 20:55:01 +0000 (20:55 +0000)] 
Non-functional change. Fix some overly long lines and such..

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

13 years agoUpon decode failure set the guest_IA to the address of the insn that
Florian Krohm [Thu, 26 Jul 2012 02:37:49 +0000 (02:37 +0000)] 
Upon decode failure set the guest_IA to the address of the insn that
could not be decoded (current insn). Otherwise, a wrong address will be
reported in the complaint.

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

13 years agoClean up IR construction for insns that do not have straight-line
Florian Krohm [Thu, 26 Jul 2012 02:01:50 +0000 (02:01 +0000)] 
Clean up IR construction for insns that do not have straight-line
internal control flow. Introduce a few new convenience functions: iterate,
iterate_if, next_insn_if that are now used to build IR for insns with implicit
loops. These functions behave like if_condition_goto, except they do
not terminate the super block and do not call put_IA(next insn). Previously,
the guest_IA was assigned possibly several times for such insn. Now we do
it exactly once as it should be. This improves complaints for cu21 which was
the motivation behind this patch.
As a side effect insns with an implicit loop no longer terminate the super
block. All calls to dummy_put_IA have been eliminated.
No changes in runtime performance were observed.

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

13 years agoChange IR generation for MVCLE to not generate cc=3. This should have been
Florian Krohm [Wed, 25 Jul 2012 17:10:49 +0000 (17:10 +0000)] 
Change IR generation for MVCLE to not generate cc=3. This should have been
included in r2446, but was not obvious to spot.

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

13 years agoFix bug 303963.
Josef Weidendorfer [Wed, 25 Jul 2012 09:36:54 +0000 (09:36 +0000)] 
Fix bug 303963.

Emulation of PCMPxSTRx mode 0x0C was wrong
for searching an empty needle in an empty haystack.

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

13 years agoChange IR generation for SRST, CLST, and CLCLE to not generate cc=3.
Florian Krohm [Wed, 25 Jul 2012 00:52:21 +0000 (00:52 +0000)] 
Change IR generation for SRST, CLST, and CLCLE to not generate cc=3.
Two reasons:
(1) Consistency in implementation (we don't generate cc=3 for "translate",
   "convert to unicode" and possibly other insns)
(2) There is nothing to be gained. A program that does not handle cc=3
    correctly (by looping back to the insn that generated it) may exhibit
    unpredictable behaviours. And there is no way for us to match that (as
    we cannot know when hardware decides to interrupt the insn). So why
    add complexity for that.

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

13 years agoUse always_goto_and_chase for consistency with other "translate" insns.
Florian Krohm [Tue, 24 Jul 2012 21:06:34 +0000 (21:06 +0000)] 
Use always_goto_and_chase for consistency with other "translate" insns.

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

13 years agoBack out special handling for opcode 00 (VEX r2189).
Florian Krohm [Mon, 23 Jul 2012 18:03:47 +0000 (18:03 +0000)] 
Back out special handling for opcode 00 (VEX r2189).
This was added based on the following analysis at the time:
(1) during decoding a sequence of insns we run into a 00 opcode (as that
    opcode is sometimes used on purpose to force an abort)
(2) #1 only happens when chasing through unconditional gotos
(3) the path that was decoded in #1 would not be executed because an earlier
    side exit in the super block was taken

But chasing through an unconditional branch should not reach an insn that is
not reached at execution time, because
(a) conditional gotos are supposed to terminate a superblock
(b) side exits that appear in the IR of complex insns will transfer control
    to the very same address (for insns that have implicit loops) and/or to
    the address that immediately follows the current insn (fall through)

Therefore, the special handling of opcode 00 was just fighting the
symptom but not the cause.
Most likely a super block was not correctly terminated.

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

13 years agoChange logic in computed gotos to use if_condition_goto_computed
Florian Krohm [Sat, 21 Jul 2012 20:32:57 +0000 (20:32 +0000)] 
Change logic in computed gotos to use if_condition_goto_computed
instead of if_not_condition_goto_computed. Hide the implementation
detail of inverting the condition in if_condition_goto_computed and
fix the call sites. This is clearer as it better matches the semantic
description in the POP.

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

13 years agoAdd support for the CU24 insn (s390x). Part of fixing #289839.
Florian Krohm [Sat, 21 Jul 2012 17:41:36 +0000 (17:41 +0000)] 
Add support for the CU24 insn (s390x). Part of fixing #289839.

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

13 years agoAdd support for the CU21 instruction (s390x).
Florian Krohm [Fri, 20 Jul 2012 00:06:35 +0000 (00:06 +0000)] 
Add support for the CU21 instruction (s390x).

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

13 years agoHandle Iop_32to1 in the amd64 insn selector.
Florian Krohm [Thu, 19 Jul 2012 17:22:33 +0000 (17:22 +0000)] 
Handle Iop_32to1 in the amd64 insn selector.

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

13 years agoFix disassembly for insns using the RRF_M0RERE format.
Florian Krohm [Thu, 19 Jul 2012 14:54:03 +0000 (14:54 +0000)] 
Fix disassembly for insns using the RRF_M0RERE format.

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

13 years agoeqIRConst: handle Ico_V256.
Julian Seward [Wed, 18 Jul 2012 11:48:23 +0000 (11:48 +0000)] 
eqIRConst: handle Ico_V256.

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

13 years agoAdd more debug print information for the instructions for MIPS.
Petar Jovanovic [Mon, 16 Jul 2012 14:25:05 +0000 (14:25 +0000)] 
Add more debug print information for the instructions for MIPS.

Extend debug info output for the guest instructions. Useful for debugging.

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

13 years agoFix incorrect instruction decoding for MOVBE. Followup fix for r2435.
Julian Seward [Mon, 16 Jul 2012 08:35:31 +0000 (08:35 +0000)] 
Fix incorrect instruction decoding for MOVBE.  Followup fix for r2435.

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

13 years agoImplement MOVBE. Fixes #302287.
Julian Seward [Sun, 15 Jul 2012 10:11:10 +0000 (10:11 +0000)] 
Implement MOVBE.  Fixes #302287.

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

13 years agoMove helper functions to guest_s390_helpers.c for consistency with
Florian Krohm [Sun, 15 Jul 2012 02:25:55 +0000 (02:25 +0000)] 
Move helper functions to guest_s390_helpers.c for consistency with
other frontends.

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

13 years agoHandle UD2 a bit better. This change causes Vex to decode UD2 like
Julian Seward [Sat, 14 Jul 2012 14:31:17 +0000 (14:31 +0000)] 
Handle UD2 a bit better.  This change causes Vex to decode UD2 like
any other instruction -- so it doesn't complain -- but Valgrind still
complains when synthesising the SIGILL for the guest.  Marginally less
confusing than it was before.

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

13 years agoGet rid of gcc warnings about uninitialised variables in the arm front end.
Julian Seward [Sat, 14 Jul 2012 14:21:56 +0000 (14:21 +0000)] 
Get rid of gcc warnings about uninitialised variables in the arm front end.

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

13 years agoImplement VCMPNGESS (and other laneages: SD, PD, PS). Fixes #302578.
Julian Seward [Sat, 14 Jul 2012 14:20:00 +0000 (14:20 +0000)] 
Implement VCMPNGESS (and other laneages: SD, PD, PS).  Fixes #302578.

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

13 years agoIncrease max allowed pre-allocation (vreg-ised) block size from 10000
Julian Seward [Sat, 14 Jul 2012 09:18:02 +0000 (09:18 +0000)] 
Increase max allowed pre-allocation (vreg-ised) block size from 10000
to 15000.  In very extreme circumstances the JIT pipeline can create
huge blocks.  Fixes #303250, at least for the time being.

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

13 years agoppc front end: fnmadd, fnmsub, fnmadds, fnmsubs: don't negate the
Julian Seward [Sat, 14 Jul 2012 08:22:13 +0000 (08:22 +0000)] 
ppc front end: fnmadd, fnmsub, fnmadds, fnmsubs: don't negate the
result when it is a NaN.  Fixes #302370.  (Carl Love, carll@us.ibm.com)

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

13 years agoUse vpanic, not vassert, you silly.
Florian Krohm [Fri, 13 Jul 2012 14:13:06 +0000 (14:13 +0000)] 
Use vpanic, not vassert, you silly.

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

13 years agoUse a proper type for sign_mask.
Florian Krohm [Fri, 13 Jul 2012 13:41:41 +0000 (13:41 +0000)] 
Use a proper type for sign_mask.

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

13 years agoRemove redundant break statements.
Florian Krohm [Fri, 13 Jul 2012 12:48:39 +0000 (12:48 +0000)] 
Remove redundant break statements.

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

13 years agoImplement (T1) SMMUL{R}. Fixes #300140. (Evgeniy Stepanov,
Julian Seward [Wed, 11 Jul 2012 16:46:47 +0000 (16:46 +0000)] 
Implement (T1) SMMUL{R}.  Fixes #300140.  (Evgeniy Stepanov,
eugeni.stepanov@gmail.com) w/ fixes.

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

13 years agoARM: Implement QADD and QSUB. Fixes #286917.
Julian Seward [Wed, 11 Jul 2012 13:19:10 +0000 (13:19 +0000)] 
ARM: Implement QADD and QSUB.  Fixes #286917.

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

13 years agoAdd Iop_CmpEQ16x8 to the set of known dependency-breakers. Fixes #290006.
Julian Seward [Tue, 10 Jul 2012 21:41:01 +0000 (21:41 +0000)] 
Add Iop_CmpEQ16x8 to the set of known dependency-breakers.  Fixes #290006.
(Alexey Samsonov, samsonov@google.com)

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

13 years agoComment/formatting only change, to clarify semantics w.r.t.
Julian Seward [Tue, 10 Jul 2012 16:41:46 +0000 (16:41 +0000)] 
Comment/formatting only change, to clarify semantics w.r.t.
relationship between guards and return temporaries from dirty helper
calls.

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

13 years agofix 303116 Add support for the POWER instruction popcntb (VEX part)
Philippe Waroquiers [Fri, 6 Jul 2012 21:56:53 +0000 (21:56 +0000)] 
fix 303116  Add support for the POWER instruction popcntb (VEX part)
patch from carll@us.ibm.com

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

13 years agoMake the IR sanity checker complain about dirty helpers that return
Florian Krohm [Thu, 5 Jul 2012 22:05:42 +0000 (22:05 +0000)] 
Make the IR sanity checker complain about dirty helpers that return
a value and are executed under a condition. That case is not handled
properly and will cause asserts down the road. As pointed out by Julian.

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