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

Jan Beulich jbeulich@suse.com
Mon Nov 21 07:32:30 GMT 2022


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

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