|
From: Tom H. <to...@co...> - 2007-03-12 10:58:31
|
> To clarify the example a bit, I'm translating the numbers indicating the > virtual registers of the virtual CPU to their counterparts on a x86 CPU. > > For example my initial translation is : > > -- IMark(0x400484, 3) -- ; sub %rcx,%rsi > PUT(168) = 0x400484:I64 > t12 = GET:I64(48) > t11 = GET:I64(8) > t10 = Sub64(t12,t11) > PUT(128) = 0x8:I64 > PUT(136) = t12 > PUT(144) = t11 > PUT(48) = t10 > > and I try to clarify it by rewriting it to > > -- IMark(0x400484, 3) -- ; sub %rcx,%rsi > PUT(%RIP) = 0x400484:I64 > t12 = GET:I64(%RSI) > t11 = GET:I64(%RCX) > t10 = Sub64(t12,t11) > PUT(%RFLAGS) = 0x8:I64 > PUT(136) = t12 > PUT(144) = t11 > PUT(%RSI) = t10 > > but as you can see, still some virtual registers are unclear to me. > > So I basicly have the following question: > - Is there a list of these numbers to their virtual counterparts? Which numbers do you mean? The tXX temporary register numbers? or the offsets in the PUT() expressions? There is no fixed mapping from the tXX registers to the physical registers - they are just allocated as required and a register allocator is then used to map them to real registers in as efficient a way as possible, just like in a compiler. The offsets in the PUT() expressions come from the structure at the top of the VEX/priv/libvex_guest_XXX.h files. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |