qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RISU PATCH v3 04/18] risugen_x86_constraints: add modu


From: Richard Henderson
Subject: Re: [Qemu-devel] [RISU PATCH v3 04/18] risugen_x86_constraints: add module
Date: Sat, 20 Jul 2019 18:54:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 7/11/19 3:32 PM, Jan Bobek wrote:
> +sub data16($%)
> +{
> +    my ($insn, %data16) = @_;
> +    $insn->{data16} = \%data16;
> +}
> +
> +sub rep($%)
> +{
> +    my ($insn, %rep) = @_;
> +    $insn->{rep} = \%rep;
> +}
> +
> +sub repne($%)
> +{
> +    my ($insn, %repne) = @_;
> +    $insn->{repne} = \%repne;
> +}

What do you think of replacing these with p($_, 0x66), etc?

It kinda matches up with the "p => 0x66" within vex(), and it is easier for the
eye to match up with the comments before each pattern.

> +sub modrm($%)
> +{
> +    my ($insn, %args) = @_;
> +    modrm_($insn, indexk => 'index', %args);
> +}
> +
> +sub modrm_vsib($%)
> +{
> +    my ($insn, %args) = @_;
> +    modrm_($insn, indexk => 'vindex', %args);
> +}

I'm thinking of adding a few more exports for very common patterns:

modrm_reg    -- force use of register.
modrm_mem    -- force use of memory.
modrm_mmx_1  -- crop reg1 to 0-7 for mm register.
modrm_mmx_2  -- crop reg2 to 0-7 if in use.
modrm_mmx_12 -- crop both reg1 and reg2.

I think these would significantly shorten some of the !constraints.

I'm willing to do these changes myself; for the GSoC project I'd rather you
continue to the next phase instead of iterating on risugen further.


r~



reply via email to

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