[RISCV] Support experimental/unratified extensions
authorSimon Cook <simon.cook@embecosm.com>
Thu, 9 Apr 2020 16:51:16 +0000 (17:51 +0100)
committerSimon Cook <simon.cook@embecosm.com>
Thu, 9 Apr 2020 17:04:22 +0000 (18:04 +0100)
commitdd1ee6dc076fe1da6cf6eeb9cf614d9c1796759a
tree14167cde2647c24aef9b4307ad453de834e4ad3a
parentfae40bd5a1d4d0ef5f60d5a441757d39a06ce077
[RISCV] Support experimental/unratified extensions

This adds support for enabling experimental/unratified RISC-V ISA
extensions in the -march string in the case where an explicit version
number has been declared, and the -menable-experimental-extensions flag
has been provided.

This follows the design as discussed on the mailing lists in the
following RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-January/138364.html

Since the RISC-V toolchain definition currently rejects any extension
with an explicit version number, the parsing logic has been tweaked to
support this, and to allow standard extensions to have their versions
checked in future patches.

The bitmanip 'b' extension has been added as a first use of this support,
it should easily extend to other as yet unratified extensions (such as
the vector 'v' extension).

Differential Revision: https://reviews.llvm.org/D73891
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Arch/RISCV.cpp
clang/test/Driver/riscv-arch.c