On Mon, Jun 29, 2020 at 7:35 PM Kito Cheng <kito.ch...@sifive.com> wrote: > * config/riscv/multilib-generator (arch_canonicalize): Handle > multi-letter extension. > Using underline as separator between different extensions.
This looks good to me. > + # Multi-letter extension must in lexicographic order. Suggest "must in" -> "must be in" > @@ -77,7 +91,7 @@ for cfg in sys.argv[1:]: > abis[abi] = 1 > extra = list(filter(None, extra.split(','))) > ext = list(filter(None, ext.split(','))) > - alts = sum([[x] + [x + y for y in ext] for x in [arch] + extra], []) > + alts = sum([[x] + [x + "_" + y for y in ext] for x in [arch] + extra], []) > # TODO: We should expand g to imadzifencei once we support newer spec. > alts = alts + [x.replace('imafd', 'g') for x in alts if 'imafd' in x] > alts = list(map(arch_canonicalize, alts)) Maybe add a line arch = arch_canonicalize (arch) after parsing arch? I notice with your example I get MULTILIB_OPTIONS = march=rv32izfh/march=rv32ic_zfh mabi=ilp32 which has inconsistent handling of _ before long extensions. This is harmless, but this could be fixed by canonicalizing arch too. And that might help make the script work better with minor user input errors. Jim