[PATCH] testsuites: Fix RISC-V tests with 'nop' instruction.
Nelson Chu
nelson@rivosinc.com
Thu Sep 11 02:27:47 GMT 2025
On Thu, Sep 11, 2025 at 9:52 AM Jiawei <jiawei@iscas.ac.cn> wrote:
> In 2025/9/10 22:44, Nelson Chu wrote:
>
> On Wed, Sep 10, 2025 at 8:59 PM Jan Beulich <jbeulich@suse.com> wrote:
>
>> On 10.09.2025 14:09, Jiawei wrote:
>> > This patch forces tests containing 'nop'(0x13) instructions to specify
>> the
>> > as parameter. The default as parameter is rv64gc will generation
>> compressed
>> > instruction 'c.nop'(0x1) and broken the result as expected.
>>
>> I don't follow this explanation. There's no breakage right now, and you
>> also
>> don't alter any of the test expectations. Was the 2nd sentence maybe
>> intended
>> to start "If the default gas setting is rv64gc ..."? (I.e. if an override
>> of
>> DEFAULT_RISCV_ARCH_WITH_EXT was in effect.)
>
>
> Yeah I guess that's the problem, but the weird thing is I suppose the
> regressions of riscv-gnu-toolchain should test it, but I don't get any
> failures... I think it's fine to make test cases passed for specific
> DEFAULT_RISCV_ARCH_WITH_EXT build, but force them to rv64i means we won't
> test rv32 for those test cases, which I think original we also wants rv32
> were tested. Does the .option norvc directives work for those testcase?
> It seems only the difference between nop and c.nop, and we don't want c.nop
> breaks the test cases.
>
> For the dis-partial-insn-byte, rv64i generates nop, and rv64gc generates
> c.nop, which breaks the "objdump --start-address 0 --stop-address 1 -d",
> the former shows .byte 0x13, but the latter shows .byte 0x01.
>
> Yes, that's the problem, before the riscv-gnu-toolchain update,
> --with-arch option will not be passed into binutils part, but currently it
> does,
>
>
> https://github.com/riscv-collab/riscv-gnu-toolchain/commit/1faa77ffe8daec705aa1ef266e944c554d838881
>
> so some test will show compressed result and come into fail.
>
Thanks! So we should fix these failures in binutils test cases.
> Thanks for your hint, the current revision is indeed one-sided. I think
> maybe add .option norvc in assemble file is a better choice.
>
Cool. As the above discussions with Jan and Peter, I think it worth to try
.option norvc first.
Nelson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20250911/dc9bb15c/attachment-0001.htm>
More information about the Binutils
mailing list