[PATCH v6 1/2] RISC-V: Add SpacemiT vendor extension xsmtvdot

Jeffrey Law jefflaw@qti.qualcomm.com
Tue Jun 23 01:59:41 GMT 2026



On 6/22/2026 3:14 PM, Mark Wielaard wrote:
> WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
>
> Hi,
>
> On Mon, Jun 22, 2026 at 04:48:35PM +0000, Jeffrey Law via Binutils wrote:
>> On 5/25/2026 2:20 AM, Mark Zhuang wrote:
>>> From: Mark Zhuang <mark.zhuang@spacemit.com>
>>>
>>> SpacemiT defines Intrinsic Matrix Extension (IME) specification [1].
>>> SpacemiT X60 implements version 1.0 of the SpacemiT Vector Dot Product
>>> Extension (XsmtVdot v1.0) [2], a subset of the full IME specification.
>>>
>>> [1] https://github.com/spacemit-com/riscv-ime-extension-spec/releases/download/v1.0/spacemit-ime-asciidoc.pdf
>>> [2] https://github.com/spacemit-com/docs-ai/blob/main/en/architecture/ime_extension.md
>>> ---
>>>    bfd/elfxx-riscv.c                         |  7 ++
>>>    gas/NEWS                                  |  3 +
>>>    gas/config/tc-riscv.c                     | 81 +++++++++++++++++++++++
>>>    gas/doc/c-riscv.texi                      |  8 +++
>>>    gas/testsuite/gas/riscv/march-help.l      |  1 +
>>>    gas/testsuite/gas/riscv/x-smt-vdot-fail.d |  3 +
>>>    gas/testsuite/gas/riscv/x-smt-vdot-fail.l | 73 ++++++++++++++++++++
>>>    gas/testsuite/gas/riscv/x-smt-vdot-fail.s | 50 ++++++++++++++
>>>    gas/testsuite/gas/riscv/x-smt-vdot.d      | 41 ++++++++++++
>>>    gas/testsuite/gas/riscv/x-smt-vdot.s      | 33 +++++++++
>>>    include/opcode/riscv-opc.h                | 38 +++++++++++
>>>    include/opcode/riscv.h                    |  9 +++
>>>    opcodes/riscv-dis.c                       | 33 +++++++++
>>>    opcodes/riscv-opc.c                       | 23 +++++++
>>>    14 files changed, 403 insertions(+)
>>>    create mode 100644 gas/testsuite/gas/riscv/x-smt-vdot-fail.d
>>>    create mode 100644 gas/testsuite/gas/riscv/x-smt-vdot-fail.l
>>>    create mode 100644 gas/testsuite/gas/riscv/x-smt-vdot-fail.s
>>>    create mode 100644 gas/testsuite/gas/riscv/x-smt-vdot.d
>>>    create mode 100644 gas/testsuite/gas/riscv/x-smt-vdot.s
>> THanks.  I've pushed this to the trunk.
> This does break the build with older gcc versions (8.5.0):
>
> ../../binutils-gdb/opcodes/riscv-dis.c: In function ‘print_insn_args’:
> ../../binutils-gdb/opcodes/riscv-dis.c:927:9: error: a label can only be part of a statement and a declaration is not a statement
>           unsigned vd = EXTRACT_OPERAND (SPACEMIT_IME_VD, l) * 2;
>           ^~~~~~~~
> ../../binutils-gdb/opcodes/riscv-dis.c:932:9: error: a label can only be part of a statement and a declaration is not a statement
>           unsigned vs = EXTRACT_OPERAND (SPACEMIT_IME_VS1, l) * 2;
>           ^~~~~~~~
>
> It wants a block after a case label when declaring new variables.
>
> See also
> https://builder.sourceware.org/buildbot/#/builders/290/builds/6952/steps/4/logs/stdio
Ugh.  gcc-8 era.   I don't recall the default C language dialect used in 
that era, but definitely old and crusty.  I think the whole block can be 
wrapped in a curly block to fix this.

jeff


More information about the Binutils mailing list