Julian Seward [Tue, 17 Jan 2006 01:57:33 +0000 (01:57 +0000)]
Rewrite VG_(translate) to make it clearer (it had grown like Topsy for
a long time) and to use the new preable-generating callback facility
supported by Vex. Use this to add support for R2 saving/restoring
needed for function replacement/wrapping on ppc64-linux.
Julian Seward [Tue, 17 Jan 2006 01:48:46 +0000 (01:48 +0000)]
Two different sets of changes (hard to disentangle):
* Remove from Vex all knowledge about function wrapping. All the IR
trickery needed can be done on the Valgrind side, by giving
LibVEX_Translate yet another callback. This one is called just
before any instructions are disassembled into IR, allowing Valgrind
to insert its own IR preamble if it wants. It also allows Valgrind
to inhibit any insn disassembly for the block. Effect is that this
allows Valgrind to provide any old IR for a given translation, and
have Vex process it as usual, yet that IR can be anything and does
not have to bear any relationship to any guest insns anywhere.
* Consistently pass a void* closure argument as the first parameter to
all Valgrind-supplied callbacks. This gets rid of various nasty hacks
at the Valgrind side to do with passing instance-specific values
to callbacks.
Julian Seward [Tue, 17 Jan 2006 01:42:56 +0000 (01:42 +0000)]
Give the ppc64 guest state a 16-entry pseudo-register array,
guest_REDIR_STACK. This is used (along with a stack pointer,
guest_REDIR_SP) by Valgrind to support function replacement and
wrapping on ppc64-linux. Due to the strange ppc64-linux ABI, both
replacement and wrapping require saving (%R2,%LR) pairs on a stack,
and this provides the stack.
Julian Seward [Tue, 17 Jan 2006 01:39:15 +0000 (01:39 +0000)]
Teach the ppc back end (64-bit mode only) how to deal with PutI and
GetI. These are needed to support by IR trickery which supports
function replacement/wrapping on ppc64-linux.
Julian Seward [Fri, 13 Jan 2006 23:12:49 +0000 (23:12 +0000)]
Tidy up ELF symbol table reading a bit. Make a completely new
function for reading ELF symbol tables on ppc64-linux so as to avoid
cluttering up the {x86,amd64,ppc32}-linux cases with convoluted
hoop-jumping needed to handle both the dotful (older) and dotless
(newer) ppc64-linux ABI variants.
Tom Hughes [Fri, 13 Jan 2006 09:57:01 +0000 (09:57 +0000)]
Use VG_(am_mmap_anon_float_valgrind) to allocate the unredirected
translation cache. This ensures that the cache space is executable
which it isn't when it is allocated as a static variable in the data
segment, at least on my amd64 box.
Julian Seward [Thu, 12 Jan 2006 12:32:32 +0000 (12:32 +0000)]
Merge in function wrapping support from the FNWRAP branch. That
branch hereby becomes inactive. This currently breaks everything
except x86; fixes for amd64/ppc32 to follow.
Note: Only the rounding mode field of the FPSCR is supported.
- Reads from any other bits return zero.
- Writes to any other bits are ignored. Writes to 'exception control' bits or the 'non-ieee mode' bit results in an emulation warning.
Julian Seward [Wed, 4 Jan 2006 01:20:28 +0000 (01:20 +0000)]
Somewhat rehash the biarch-build machinery so as to (1) formalise the
distinction between primary and secondary build targets, and (2) make
it independent of the default behaviour of gcc (iow, what gcc does
when you specify neither -m32 nor -m64).
As a result, an out-of-the-box build on ppc64-linux now builds a
system which is basically for 64-bit PowerPC, but also has the ability
to run 32-bit ppc-linux binaries (exactly the same arrangement as you
get when building on amd64-linux).
There are various twists and turns. multiple-architectures.txt is
updated all the gory details.
This will break amd64 builds until such time as
<tool>/tests/{amd64,x86}/Makefile.am are fixed up (shortly).
regtest none::ppc32
- More cleanup
- Fixed rlwimi test - init r_dst to zero.
- Fixed load/store tests - print change in updated base reg, not actual value.
Julian Seward [Sun, 1 Jan 2006 23:00:49 +0000 (23:00 +0000)]
Read dwarf2 line number information even if a .debug_str section was
not found. This is believed to fix the regression in 3.1.X wherein
debug info was sometimes not read from icc-8.1 generated executables.
Julian Seward [Fri, 30 Dec 2005 22:52:20 +0000 (22:52 +0000)]
Finally fix the bug causing dynamic ppc64-linux executables not to
work: start with with the correct toc pointer (r2), rather than some
nonsense value.
Julian Seward [Wed, 28 Dec 2005 04:18:20 +0000 (04:18 +0000)]
In fbench, compute sin/cos/sqrt from "first principles", so that the
program more uniformly measures the speed of FP +/-/* load/store
across different architectures.
Julian Seward [Mon, 26 Dec 2005 17:58:58 +0000 (17:58 +0000)]
More dispatcher tuning for ppc32/64. Makes a big difference for
perf/tinycc.
- run_thread_for_a_while: just clear this thread's reservation when
starting, not all of them.
- use a different fast-cache hashing function for ppc32/64 than for
x86/amd64. This allows the former to use all the fast-cache entries
rather than just 1/4 of them.
Julian Seward [Mon, 26 Dec 2005 03:54:49 +0000 (03:54 +0000)]
Attempt to make tinycc work on ppc32, by (1) getting rid of various
x86 isms in tinycc.c, (2) giving it a fixed, preprocessed input file
to chew on, and (3) just compiling to a .o with no attempt to link.