[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~
- Re: [Qemu-devel] [RISU PATCH v3 11/18] x86.risu: add SSE instructions, (continued)
- [Qemu-devel] [RISU PATCH v3 01/18] risugen_common: add helper functions insnv, randint, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 07/18] risugen: allow all byte-aligned instructions, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 02/18] risugen_common: split eval_with_fields into extract_fields and eval_block, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 04/18] risugen_x86_constraints: add module, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 15/18] x86.risu: add SSE4.1 and SSE4.2 instructions, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 03/18] risugen_x86_asm: add module, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 14/18] x86.risu: add SSSE3 instructions, Jan Bobek, 2019/07/11
- [Qemu-devel] [RISU PATCH v3 12/18] x86.risu: add SSE2 instructions, Jan Bobek, 2019/07/11