Improve callgrind performance by 4 to 8% using UNLIKELY
Performance improvements from 4 to 8% obtained on amd64 on the perf tests by:
1. using UNLIKELY inside tracing macros
2. avoid calling CLG_(switch_thread)(tid) on the hot patch setup_bbcc
unless tid differs from CLG_(current_tid).
Add testcase to check the emulation warning for new supported opcodes
on hosts without floating point extension facility.
See companion patch VEX r2501.
Part of fixing bugzilla #306098.
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.
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)
Change s390-features to allow testing for absence of a feature.
This is infintely less painful than to find out how to invert
the condition in a test prerequisite.
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.
s390: Valgrind-side changes to fixing bugzilla #274695:
Testcase, vbit tester update, memcheck support for the new IROps,
NEWS announcement and opcode list update.
Patch by Christian Borntraeger (borntraeger@de.ibm.com).
Vbit tester tweaks by myself.
Fixes bugzilla #274695.
See also companion patch VEX r2496.
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.
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.
Florian Krohm [Wed, 29 Aug 2012 02:50:56 +0000 (02:50 +0000)]
s390: Fix the default cache configuration. As z10-EC has an L3
cache, use that instead of the L2 -- bringing the code in synch
with documentation.
Also improve the warning message to be more meaningful.
Florian Krohm [Tue, 28 Aug 2012 23:38:49 +0000 (23:38 +0000)]
vbit tester: Disable Iop_CmpLT64S and Iop_CmpLE64S for ppc because
they cause assertion failures.
Do not test Iop_CmpORDxyz on ppc because the vbit tester does not
support them. This is just so we don't have to add another .exp file for ppc.
Florian Krohm [Tue, 28 Aug 2012 16:50:39 +0000 (16:50 +0000)]
Add a tester for V-bit propagation through IROps.
The tester is located in memcheck/tests/vbit-test.
It needs the following support on the valgrind / VEX side:
(1) a new client request VG_USERREQ__VEX_INIT_FOR_IRI
(2) a new "special instruction" on all architectures inserted via
VALGRIND_VEX_INJECT_IR
(3) VEX changes to detect the special insn and insert IR (ir_inject.c)
The README file in vbit-test has some more information.
See also VEX r2490. Fixes bugzilla #300102.
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
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.
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.
Julian Seward [Fri, 24 Aug 2012 16:42:57 +0000 (16:42 +0000)]
Change exp-sgcheck's memcpy implementation to be memmove-like (sigh)
since it appears that some part of the vast stack of libraries that
supports LibreOffice actually abuses it thusly.
Julian Seward [Fri, 24 Aug 2012 14:38:56 +0000 (14:38 +0000)]
Fix skipping of block forms when this code is compiled by gcc 4.8 -- it
has always been incorrect, modifying 'p' twice between sequence points.
Fixes #305513. (Mark Wielaard, mjw@redhat.com)
Florian Krohm [Mon, 20 Aug 2012 16:51:39 +0000 (16:51 +0000)]
Handle the following IRops as they may get generated:
Iop_Mul8, Iop_Sar8, Iop_CmpwNEZ32, and Iop_8HLto16.
With this change mc_translate now handles all IR ops which are architecture
independent, except Iop_LeftXYZ and Iop_Max32U.
fix 301281 valgrind hangs on OS X when the process calls system()
After looking more in depth, gdbserver must not be terminated
in PRE(posix_spawn) on MacOS: this is running in the parent and
(on MacOS) is a single syscall similar to a fork+exec.
On linux, posix_spawn is implemented using 2 syscalls
(fork followed by exec).
fix n-i-bz vgdb ptrace calls wrong on mips, causing blocked syscalls to fail
(patch from Petar Jovanovic).
The mips specific code of vgdb.c was storing the arguments
at wrong places in the ptrace setreg. This caused the blocked syscall(s)
to return with an error rather than to be properly restarted.
With this commit, the gdbsrv tests are not blocking anymore
with Valgrind mips32 running on mips64 GNU/Linux.
vgdb is believed to be functional, even if process is blocked in a syscall.
The following tests are still failing
gdbserver_tests/mcbreak (stdout)
gdbserver_tests/mcbreak (stdoutB)
gdbserver_tests/mcbreak (stderrB)
gdbserver_tests/mcsignopass (stderr)
gdbserver_tests/mcsignopass (stdoutB)
gdbserver_tests/mcsigpass (stderr)
gdbserver_tests/mcsigpass (stdoutB)
gdbserver_tests/nlcontrolc (stdoutB)
gdbserver_tests/nlsigvgdb (stderr)
gdbserver_tests/nlsigvgdb (stderrB)
Of the above, nlsigvgdb failure is still strange.
Others looks like "normal" differences due e.g. to mips specific gdb
behaviour and/or none/tests/faultstatus (re-used in gdbsrv tests)
behaving differently on mips.
Fix 301281 valgrind hangs on OS X when the process calls system()
This should fix the bug (but could not test it : no MacOSX).
See equivalent code in syswrap-generic.c and comment
in pub_tool_gdbserver.h:
// tid == 0 indicates to stop gdbserver and report to gdb
// that the valgrind-ified process has exited.
Use -s USR1 instead of -10 to send SIGUSR1 signal
On mips32, 10 is SIGBUS. This was making all tests using
simulate_control_c looping for ever or a long time.
Option sp-at-mem-access can be used by tools which do not
need an up to date BP and IP at each mem access.
It is needed however to have SP up to date at each memory
access, as an up to date SP is needed to grow the stack in
m_signals.c
Tools massif, cachegrind and callgrind are using sp-at-mem-access
as default.
None tool could also use sp-at-mem-access but default is kept
to unwindregs-at-mem-access (similar to memcheck, drd, helgrind, exp-sgcheck).
exp-dhat, exp-bbv, lackey have not been looked at to see if they
could make use of sp-at-mem-access.
Julian Seward [Wed, 8 Aug 2012 22:22:26 +0000 (22:22 +0000)]
Make the assembler-knows-POWER-DFP test a bit stricter, since it appears
some older assemblers know 'dadd' but not 'dcffix', which also appears
in the DFP tests.