qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] VSX Instruction Set Implementation


From: Jacques Mony
Subject: Re: [Qemu-ppc] VSX Instruction Set Implementation
Date: Thu, 15 Aug 2013 19:23:41 +0000

Hi,

Going through the code, I believe I started gathering the logic. However, there 
is one piece that I just can't quite understand (and it's probably so obvious):

In translate.c, GEN_HANDLER (which is actually GEN_OPCODE)... is used in the 
following manner:

GEN_HANDLER(sraiq, 0x1F, 0x18, 0x1D, 0x00000000, PPC_POWER_BR),

I believe I get the meaning of first parameter (the instruction name), the 
second one (0x1F -> primary opcode 31 - right ?), then I assume the last one to 
be categories). However, the 3 numeric parameters just make no sense to me. I 
tried mapping them as secondary opcode values, masks for opc2 and opc3 in the 
instruction, I just can't find where this comes from...

Can someone point me in the right direction, please?

Thanks,
Jacques Mony

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Alexander Graf
Sent: 15 août 2013 11:05
To: Jacques Mony
Cc: address@hidden list:PowerPC; address@hidden qemu-devel
Subject: Re: [Qemu-ppc] VSX Instruction Set Implementation

Hi Jacques,

On 15.08.2013, at 16:42, Jacques Mony wrote:

> Hello,
>  
> After going through the archives, I read an interesting thread regarding 
> unimplemented instruction set from PowerISA 2.06. The specific instruction 
> that seems to be called by AIX is stxvd2x, from VSX Instruction Set (new in 
> 2.06 as I can understand).
>  
> How do one start to implement a instruction sub-set? Where to start? I see 
> there are helpers, TCG, etc. is there a tutorial that explains where to 
> start? I already know it will have to support new encoding forms (XX1-form , 
> XX2-form.) which is not being used yet (afaik), but for the rest, I'm a bit 
> lost.

There is a tiny bit of documentation, but mostly it's all about reading code. I 
think a good place to start is a patch set that implements instructions. Check 
out this one from Aurelien:

  https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg02569.html

There is also some documentation available at the QEMU wiki:

  http://wiki.qemu.org/Documentation/TCG

I also did a talk on TCG last year that should give you a high level idea on 
how it works:

  http://chemnitzer.linux-tage.de/2012/vortraege/1062

Just get yourself through these and try to figure out what's going on. Keep in 
mind that TCG is a JIT, so you have 2 phases:

  1) translation (guest -> tcg -> host code)
  2) execution (host code gets executed)

If you still have questions left after that, please feel free to ask again :).


Alex





reply via email to

[Prev in Thread] Current Thread [Next in Thread]