RISC-V: Extend syntax for the multilib-generator
authorKito Cheng <kito.cheng@sifive.com>
Tue, 28 Jul 2020 02:29:49 +0000 (10:29 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Thu, 22 Oct 2020 08:02:44 +0000 (16:02 +0800)
commitdf7f0a3a21418f8e06bb4710f09587e54225da93
tree8f0db46a2182ae8910b08af6cd8a5b4d70ad56cd
parentef2d3ec325b1b720df5da20784eba46249af2294
RISC-V: Extend syntax for the multilib-generator

 - Support expansion operator (*) in the multilib config string.

 - Motivation of this patch is reduce the complexity when we deal multilib with
   sub-extension, expand the combinations by hand would be very painful and
   error prone, no one deserve to experience this[1] again!

[1] https://github.com/sifive/freedom-tools/blob/f4d7facafb27d16125768c90ff1790c674e4be7a/Makefile#L348

gcc/ChangeLog:

* config/riscv/multilib-generator: Add TODO, import itertools
and functools.reduce.
Handle expantion operator.
(LONG_EXT_PREFIXES): New.
(arch_canonicalize): Update comment and improve python3
debuggability/compatibility.
(add_underline_prefix): New.
(_expand_combination): Ditto.
(unique): Ditto.
(expand_combination): Ditto.
gcc/config/riscv/multilib-generator