From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 53EDC3857BB2 for ; Mon, 17 Apr 2023 17:57:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53EDC3857BB2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x630.google.com with SMTP id p17so15438978pla.3 for ; Mon, 17 Apr 2023 10:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1681754272; x=1684346272; h=message-id:to:from:cc:in-reply-to:subject:date:from:to:cc:subject :date:message-id:reply-to; bh=inKnsSmG78/Q+UDSR/oEWN4bSAS129IQLj+4dTHV70I=; b=4d8mSh02KJciueZ2JiF1z8Y0mGAYJ4x8dxxXDBlJlHlvTcmgLXAlp0xyA5NtM3E/C7 s3+mL30piAt/+/GggPPmGhrZJbWRUoTlRmegXxHJ5nw+5JlXZLso4qwZHGCjkUcCXzPA xaeoaDMCvRhAGHvxjCIiI4YNU6JxC9B7f0Z5fn+ZMJGI3Db/urjcYAC67GjgVCEDgg+0 RoeP7xsDmiZjoDlparF5hot4tX6FW1LTH6366lqo4D4or8nym6FSfU7pbitttMv13L1y +n3v5lieIddd0udirbJqKGF8s4I30pvhFIMKvyKGX/jwQ05mOJqt1doYHcuq4eJhZpDT 8R5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681754272; x=1684346272; h=message-id:to:from:cc:in-reply-to:subject:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=inKnsSmG78/Q+UDSR/oEWN4bSAS129IQLj+4dTHV70I=; b=CoMNgQ0zyCgd2Qn12zxFd1HgciL2EMnSNZsFAyYZBiZ8pufnnufuNb4Vs9epGvR/m2 94ToWt1WIGPoa7zKQ2an2tl+ti9MhkVzxZsPYp4QPH/2txUZKKEYzrPCXOznoWDlnVam qsw67JlbR7ZVHMOmTgKdKlHlV6vb5qsjkJhpikr5NYHJE/UVjwiy+5CFoda4U7ql/csS bTpmmBgbymu8uNItYyphBc/nuuUKWPZW2wBFjbCNIpPhYk7qyrX6wqqjPO3UIAnR26lP TZDfG5vEGtjHh2DAl1eBsIEKdDVKikmWUWF3EawiODtkY7ZQPbkTvQaBeQpyi2/6ZPBj CY5A== X-Gm-Message-State: AAQBX9eS+a81ixQnuxAADiwuElM0Z/ggQ9zuQj/zgmkY/og5oh7xDOIj +/GSKSjN0rXeAlVOnnSMIUZgQk88Tis/rIZmKEA= X-Google-Smtp-Source: AKy350Y/u8tklQDTjki6k1VtSyiy6qMO/F9945OX7GRhM/8BlwOv0Kif4sNJbZOwQ0B/QpNzbxBVEQ== X-Received: by 2002:a05:6a20:7925:b0:e3:86d1:55e8 with SMTP id b37-20020a056a20792500b000e386d155e8mr14183959pzg.53.1681754271770; Mon, 17 Apr 2023 10:57:51 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id j24-20020a632318000000b0050bc03741ffsm7247422pgj.84.2023.04.17.10.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 10:57:51 -0700 (PDT) Date: Mon, 17 Apr 2023 10:57:51 -0700 (PDT) X-Google-Original-Date: Mon, 17 Apr 2023 10:57:37 PDT (-0700) Subject: Re: [PATCH] RISC-V: Update multilib-generator to handle V In-Reply-To: CC: gcc-patches@gcc.gnu.org From: Palmer Dabbelt To: Kito Cheng Message-ID: X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 17 Apr 2023 08:24:44 PDT (-0700), Palmer Dabbelt wrote: > On Fri, 14 Apr 2023 00:15:07 PDT (-0700), Kito Cheng wrote: >> Wait, take second round review: >> >>> * All extensions were being prefixed with an underscore, which leads to >>> some odd combinations like "rv32gc_v", this just adds underscores to >>> the multi-letter extensions. >>> * The input base ISAs were being canonicalized, which resulted in some >>> odd multilib default search paths. I'm not sure if anything breaks >>> due to this, but it seems safer to just leave them alone. >> >>>* All extensions were being prefixed with an underscore, which leads to >>> some odd combinations like "rv32gc_v", this just adds underscores to >>> the multi-letter extensions. >> >> I think that weirdness can be removed arch-canonicalize I think? >> >> And currently all -march will be canonicalized before query multi lib >> >>> @@ -163,14 +168,13 @@ for cmodel in cmodels: >>> if cmodel == "compact" and arch.startswith("rv32"): >>> continue >>> >>> - arch = arch_canonicalize (arch, args.misa_spec) >>> arches[arch] = 1 >>> abis[abi] = 1 >>> extra = list(filter(None, extra.split(','))) >>> ext_combs = expand_combination(ext) >>> alts = sum([[x] + [x + y for y in ext_combs] for x in [arch] + extra], []) >>> alts = filter(lambda x: len(x) != 0, alts) >>> - alts = list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) >>> + alts = alts + list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) >> >> So we don't really need to append non-canonical one to the list? > > IIUC the multilib processing happens before the canonicialization, so > we'd need the non-canonicial strings in there too (as those are what > most users will provide, and what we have now). I haven't actually > tested that, though... Yep, if I drop the non-canonicial strings via diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator index 58b7198b243..a63a4d69c18 100755 --- a/gcc/config/riscv/multilib-generator +++ b/gcc/config/riscv/multilib-generator @@ -174,7 +174,7 @@ for cmodel in cmodels: ext_combs = expand_combination(ext) alts = sum([[x] + [x + y for y in ext_combs] for x in [arch] + extra], []) alts = filter(lambda x: len(x) != 0, alts) - alts = alts + list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) + alts = list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) # Drop duplicated entry. alts = unique(alts) then I can't link `-march=rv32imafdcv`, I need `-march=rv32imacv_zicsr_zve32f_zve32x_zve64x_zvl128b_zvl32b_zvl64b`. That's kind of a headache for users to type in.