On 7/20/19 9:54 PM, Richard Henderson wrote:
> 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.

Good idea!

>> +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 agree. I thought of something similar when I was preparing the v3
series; I didn't include it only because it would have further delayed
getting the v3 out.

> 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.

Of course, and thank you!

-Jan

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to