|
From: Nicholas N. <nj...@ca...> - 2004-11-07 15:43:20
|
On Sun, 7 Nov 2004, Maurice van der Pot wrote:
> 1) Is it allowed to simply call VG_(synth_ccall) multiple times from
> within synth_LOADV for instance? I was planning something like
> this:
>
> VG_(synth_ccall) ( helper, 1, 1, argv, tagv, tv_reg,
> regs_live_before, regs_live_after );
>
> UInt argv2[] = { a_reg, tv_reg };
> Tag tagv2[] = { RealReg, RealReg };
>
> VG_(synth_ccall) ( helper2, 2, 2, argv2, tagv2, INVALID_REALREG,
> regs_live_after, regs_live_after );
No, as this comment says:
WARNING: a UInstr should *not* be translated with synth_ccall followed
by some other x86 assembly code; vg_liveness_analysis() doesn't expect
such behaviour and everything will fall over.
> 2) Is there a way to get to a register itself instead of the value it
> contains, from a helper function? In helper2 I would like to somehow
> modify some information about tv_reg dependent on both tv_reg's own
> value and the value of a_reg.
>
>A 3) Alternatively i might want to add code to do this to the first helper
> function. Is it possible to get to the register that will receive the
> return value? Or should I modify synth_ccall to receive not only the
> return value but also the extra information that needs to be remembered
> about the return value register?
If it's only LOADV that you want to augment, I would add an extra arg to
the functions that get called by LOADV, and pass in whatever extra info
you need that way, if you see what I mean.
N
|