RISC-V: Handle g extension in multilib-generator
diff mbox series

Message ID 20190806065554.9601-1-kito.cheng@sifive.com
State New
Headers show
Series
  • RISC-V: Handle g extension in multilib-generator
Related show

Commit Message

Kito Cheng Aug. 6, 2019, 6:55 a.m. UTC
gcc/ChangeLog

	* gcc/config/riscv/multilib-generator: (canonical_order): Add 'g'.
	(arch_canonicalize): Support rv32g and rv64g and fix error
	handling.
---
 gcc/config/riscv/multilib-generator | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jim Wilson Aug. 6, 2019, 7:36 p.m. UTC | #1
On Mon, Aug 5, 2019 at 11:56 PM Kito Cheng <kito.cheng@sifive.com> wrote:
> gcc/ChangeLog
>         * gcc/config/riscv/multilib-generator: (canonical_order): Add 'g'.
>         (arch_canonicalize): Support rv32g and rv64g and fix error
>         handling.

Looks good to me.

Jim
Kito Cheng Aug. 7, 2019, 3:12 a.m. UTC | #2
Committed as r274156

On Wed, Aug 7, 2019 at 3:37 AM Jim Wilson <jimw@sifive.com> wrote:
>
> On Mon, Aug 5, 2019 at 11:56 PM Kito Cheng <kito.cheng@sifive.com> wrote:
> > gcc/ChangeLog
> >         * gcc/config/riscv/multilib-generator: (canonical_order): Add 'g'.
> >         (arch_canonicalize): Support rv32g and rv64g and fix error
> >         handling.
>
> Looks good to me.
>
> Jim

Patch
diff mbox series

diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator
index e58231c2756..a4125ff01fd 100755
--- a/gcc/config/riscv/multilib-generator
+++ b/gcc/config/riscv/multilib-generator
@@ -36,17 +36,17 @@  abis = collections.OrderedDict()
 required = []
 reuse = []
 
-canonical_order = "mafdqlcbjtpvn"
+canonical_order = "mafdgqlcbjtpvn"
 
 def arch_canonicalize(arch):
   # TODO: Support Z, S, H, or X extensions.
   # TODO: Support implied extensions, e.g. D implied F in latest spec.
   # TODO: Support extension version.
   new_arch = ""
-  if arch[:5] in ['rv32e', 'rv32i', 'rv64i']:
+  if arch[:5] in ['rv32e', 'rv32i', 'rv32g', 'rv64i', 'rv64g']:
     new_arch = arch[:5]
   else:
-    raise Exception("Unexpected arch: `%d`" % arch[:5])
+    raise Exception("Unexpected arch: `%s`" % arch[:5])
 
   # Find any Z, S, H or X
   long_ext_prefixes = ['z', 's', 'h', 'x']