Re: [Qemu-devel] [RISU RFC PATCH v2 04/14] risugen_x86: add module

2019-07-11 Thread Jan Bobek
On 7/11/19 5:26 AM, Richard Henderson wrote: > On 7/10/19 8:21 PM, Jan Bobek wrote: >> Doesn't B8 (without REX.W) work for x86_64, too? It zeroes the upper >> part of the destination, so it's effectively zero-extending, and it's >> one byte shorter than C7 (no ModR/M byte needed). > > Sorry, I sho

Re: [Qemu-devel] [RISU RFC PATCH v2 04/14] risugen_x86: add module

2019-07-11 Thread Richard Henderson
On 7/10/19 8:21 PM, Jan Bobek wrote: > Doesn't B8 (without REX.W) work for x86_64, too? It zeroes the upper > part of the destination, so it's effectively zero-extending, and it's > one byte shorter than C7 (no ModR/M byte needed). Sorry, I shouldn't have been quite so terse. What I meant is i

Re: [Qemu-devel] [RISU RFC PATCH v2 04/14] risugen_x86: add module

2019-07-10 Thread Jan Bobek
On 7/3/19 12:11 PM, Richard Henderson wrote: > On 7/1/19 6:35 AM, Jan Bobek wrote: >> +sub write_mov_rr($$) >> +{ >> +my ($r1, $r2) = @_; >> + >> +my %insn = (opcode => X86OP_MOV, >> +modrm => {mod => MOD_DIRECT, >> + reg => ($r1 & 0x7), >> +

Re: [Qemu-devel] [RISU RFC PATCH v2 04/14] risugen_x86: add module

2019-07-03 Thread Richard Henderson
On 7/1/19 6:35 AM, Jan Bobek wrote: > +sub write_mov_rr($$) > +{ > +my ($r1, $r2) = @_; > + > +my %insn = (opcode => X86OP_MOV, > +modrm => {mod => MOD_DIRECT, > + reg => ($r1 & 0x7), > + rm => ($r2 & 0x7)}); > + > +$insn

[Qemu-devel] [RISU RFC PATCH v2 04/14] risugen_x86: add module

2019-06-30 Thread Jan Bobek
The risugen_x86.pm module contains most of the code specific to Intel i386 and x86_64 architectures. This commit also adds --x86_64 option, which enables emission of 64-bit (rather than 32-bit) assembly. Signed-off-by: Jan Bobek --- risugen| 6 +- risugen_x86.pm | 498 +