[PATCH] gdb/riscv: rewrite target description validation, add rv32e support

Jim Wilson jimw@sifive.com
Fri Nov 27 23:09:51 GMT 2020


On Thu, Nov 26, 2020 at 5:29 AM Andrew Burgess <andrew.burgess@embecosm.com>
wrote:

> This commit started as adding rv32e support to gdb.  The rv32e
> architecture is a cut-down rv32i, it only has 16 x-registers compared
> to the usual 32, and an rv32e target should not have any floating
> point registers.
>

The original definition of rv32e said no FP.  But this was changed in a
later ISA version, and rv32e is now allowed to have FP.  I don't see
anything obvious in the patch that prevents rv32e from having FP regs
though, so it seems OK.

However, the ilp32e ABI was defined with 32-bit alignment, plus the fact
that arguments get passed in regs without alignment padding, and the fact
that 64-bit FP still requires 64-bit alignment, means that there are
multiple ways that we can end up with unaligned data on the stack if we
allow rv32ed.  So at present, neither gcc nor llvm have support for rv32e
plus FP.  In theory, rv32ef should work fine, but no one has asked for it
yet, so we haven't bothered to implement it yet.  There is an EABI group
working on a new embedded ABI, and when that is done, the stack alignment
problem will be fixed and we will probably have to add rv32e f and d
support to the GNU toolchain.  That could be a year or two away though.

Jim


More information about the Gdb-patches mailing list