[PATCH 1/2] RISC-V: Make .insn tests stricter

Tsukasa OI research_trasio@irq.a4lg.com
Wed Nov 23 08:20:08 GMT 2022


On 2022/11/21 16:32, Jan Beulich wrote:
> On 19.11.2022 08:10, Tsukasa OI wrote:
>> To make sure that all instruction bits are dumped through ".byte", this
>> commit makes matching patterns stricter (to cover all instruction bits).
> 
> Hmm, it was deliberate to omit the .<n>byte part of the disassembly,
> very specifically because of the inconsistency of using <n> only in
> some cases. Personally I would agree with such tightening of the
> expectations only if the disassembler was first improved. But of
> course it's the maintainers judgement ...
> 
> Jan

Hi,

I can agree most of your opinion except... even if we fix this
inconsistency later (I won't, though), I think we can change the tests
once we have changed the disassembler.  So I don't find any problems
making tests tighter.

Nelson assigned you as the person who makes the final judgement and I
want to hear your thoughts/decision about PATCH 1/2.

p.s.
I made a small change to PATCH 2/2 and I'll reply your feedback to PATCH
2/2 after PATCH v2 is submitted (PATCH v2 1/2 is unchanged from v1).

Thanks,
Tsukasa

> 
>> --- a/gas/testsuite/gas/riscv/insn-na.d
>> +++ b/gas/testsuite/gas/riscv/insn-na.d
>> @@ -61,15 +61,15 @@ Disassembly of section .text:
>>  [^:]+:[ 	]+022180d7[ 	]+vadd\.vv[ 	]+v1,v2,v3
>>  [^:]+:[ 	]+0001[ 	]+c\.addi[ 	]+zero,0
>>  [^:]+:[ 	]+00000013[ 	]+addi[ 	]+zero,zero,0
>> -[^:]+:[ 	]+001f 0000 0000[ 	].*
>> -[^:]+:[ 	]+0000003f 00000000[ 	].*
>> -[^:]+:[ 	]+007f 0000 0000 0000 0000[ 	]+[._a-z].*
>> -[^:]+:[ 	]+0000107f 00000000 00000000[ 	]+[._a-z].*
>> -[^:]+:[ 	]+607f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000[ 	]+[._a-z].*
>> +[^:]+:[ 	]+001f 0000 0000[ 	]+\.byte[ 	]+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+0000003f 00000000[ 	]+\.8byte[ 	]+0x3f
>> +[^:]+:[ 	]+007f 0000 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+0000107f 00000000 00000000[ 	]+\.byte[ 	]+0x7f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+607f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>>  [^:]+:[ 	]+0001[ 	]+c\.addi[ 	]+zero,0
>>  [^:]+:[ 	]+00000013[ 	]+addi[ 	]+zero,zero,0
>> -[^:]+:[ 	]+001f 0000 0000[ 	].*
>> -[^:]+:[ 	]+0000003f 00000000[ 	].*
>> -[^:]+:[ 	]+007f 0000 0000 0000 0000[ 	]+[._a-z].*
>> -[^:]+:[ 	]+0000107f 00000000 00000000[ 	]+[._a-z].*
>> -[^:]+:[ 	]+607f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000[ 	]+[._a-z].*
>> +[^:]+:[ 	]+001f 0000 0000[ 	]+\.byte[ 	]+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+0000003f 00000000[ 	]+\.8byte[ 	]+0x3f
>> +[^:]+:[ 	]+007f 0000 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+0000107f 00000000 00000000[ 	]+\.byte[ 	]+0x7f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+607f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> diff --git a/gas/testsuite/gas/riscv/insn.d b/gas/testsuite/gas/riscv/insn.d
>> index 2e5d35b39702..cf84f177af39 100644
>> --- a/gas/testsuite/gas/riscv/insn.d
>> +++ b/gas/testsuite/gas/riscv/insn.d
>> @@ -83,12 +83,12 @@ Disassembly of section .text:
>>  [^:]+:[ 	]+0000 0000 0000 ?
>>  [^:]+:[ 	]+0001[ 	]+nop
>>  [^:]+:[ 	]+00000013[ 	]+nop
>> -[^:]+:[ 	]+001f 0000 0000[ 	].*
>> -[^:]+:[ 	]+0000003f 00000000[ 	].*
>> -[^:]+:[ 	]+007f 0000 0000 0000[ 	]+[._a-z].*
>> +[^:]+:[ 	]+001f 0000 0000[ 	]+\.byte[ 	]+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00
>> +[^:]+:[ 	]+0000003f 00000000[ 	]+\.8byte[ 	]+0x3f
>> +[^:]+:[ 	]+007f 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>>  [^:]+:[ 	]+0000 ?
>> -[^:]+:[ 	]+0000107f 00000000[ 	]+[._a-z].*
>> +[^:]+:[ 	]+0000107f 00000000[ 	]+\.byte[ 	]+0x7f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>>  [^:]+:[ 	]+00000000 ?
>> -[^:]+:[ 	]+607f 0000 0000 0000[ 	]+[._a-z].*
>> +[^:]+:[ 	]+607f 0000 0000 0000[ 	]+\.byte[ 	]+0x7f, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>>  [^:]+:[ 	]+0000 0000 0000 0000 ?
>>  [^:]+:[ 	]+0000 0000 0000 ?
> 


More information about the Binutils mailing list