|
From: Julian S. <js...@ac...> - 2006-06-15 10:41:07
|
On Thursday 15 June 2006 00:21, Nicholas Nethercote wrote: > On Wed, 14 Jun 2006, Eric Li wrote: > > I have another question about PUT/GET in VEX. In the outdated > > documentation, it says PUT/GET is for moving values between CPU registers > > and Temp registers. In the VEX IR, PUT/GET uses offsets, which implies > > that it's addressed like memory, so then where do all the registers (eax, > > ebx, etc.) go? > > The guest state (registers) is stored by default in a block of memory. > Each register value gets pulled into real machine registers in order to be > used, and if it is changed it then gets written back to the memory block > before the end of the BB. > > > I looked at the IR for some common instructions and noticed that eax > > seems to be at PUT(0), is this always true? If so, is there a mapping of > > which registers go at which offsets somewhere? > > Yes. Look at VEX/libvex_guest_*.h, it has the mapping for each > architecture. Grepping for OFFB_ in priv/guest-<whatever>/toIR.c should make this clearer. In the x86 guest case, eax just happens to be at offset zero because guest_EAX is the first field in the struct. However the front ends are written in such a way that you can put the fields in any order and still get correct IR. J |