New RiscV-compliant architecture extension mechanism
Warning: incompatible command options and elf numbers
This release replaces the adhoc RiscV architecture flags and options with the more usual scheme. Command line options have changed -- there was no way to keep compatibility. But the good news is you do not have to specify things twice and risk doing that inconsistently.
-
Tenstorrent has reserved
tt
as an architecture extension prefix -- see https://github.com/riscv-non-isa/riscv-toolchain-conventions/blob/main/src/toolchain-conventions.adoc -
There are 3 new RiscV architecture extension attributes:
xttgs
,xttwh
&xttbh
for Grayskull, Wormhole & Blackhole respectively. These replace the non-standardy
,w
&l
letters. These extensions remain mutually incompatible -- you can only select at most one of them. This means a lack of binary compatibility with old object files and executables (as the attributes are embedded in.riscv_attributes
sections). -
The non-standard ELF machine numbers for the 3 ISAs are removed. All object files are marked with the conventional
EM_RISCV
(243) machine number. Thus a regular RiscV toolchain will be able to examine binaries, but not disassemble the new instructions. This means a lack of binary compatibility with old object files and executables. -
The
-mgrayskull
,-mwormhole
,-mblackhole
command line options are removed from both compiler and assembler. -
It is sufficient to use
-march=rv32i_xttgs
,-march=rv32im_xttwh
or-march=rv32im_xttbh
to select a variant. See below about a simpler mechanism available in the compiler. -
The
grayskull
,wormhole
&blackhole
cpus have been renamed tott-gs
,tt-wh
&tt-bh
, which is consistent with other vendors' cpu names. -
The compiler defines
__riscv_tt_grayskull
,__riscv_tt_wormhole
or__riscv_tt_blackhole
#defines when one of the architecture extensions is targetted. -
A number of assembler & disassembler bugs have been fixed.
The simplest way to drive the compiler is to specify a cpu, e.g. -mcpu=tt-bh
, rather than the previously-required combination of -march=rv32iml -mblackhole -mtune=rvtt-b1
.