From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from camel.birch.relay.mailchannels.net (camel.birch.relay.mailchannels.net [23.83.209.29]) by sourceware.org (Postfix) with ESMTPS id 158F6398EC3B for ; Wed, 12 May 2021 15:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 158F6398EC3B X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1FC77703535; Wed, 12 May 2021 14:52:29 +0000 (UTC) Received: from pdx1-sub0-mail-a52.g.dreamhost.com (100-96-13-83.trex.outbound.svc.cluster.local [100.96.13.83]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 94F13703089; Wed, 12 May 2021 14:52:28 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|tuliom@ascii.art.br Received: from pdx1-sub0-mail-a52.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.13.83 (trex/6.2.1); Wed, 12 May 2021 14:52:29 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|tuliom@ascii.art.br X-MailChannels-Auth-Id: dreamhost X-Trade-Sponge: 3b46c3d369dece79_1620831148904_1788682964 X-MC-Loop-Signature: 1620831148903:1028673720 X-MC-Ingress-Time: 1620831148903 Received: from pdx1-sub0-mail-a52.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a52.g.dreamhost.com (Postfix) with ESMTP id 3B7B97F0E1; Wed, 12 May 2021 07:52:28 -0700 (PDT) Received: from ascii.art.br (unknown [187.1.62.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: tuliom@ascii.art.br) by pdx1-sub0-mail-a52.g.dreamhost.com (Postfix) with ESMTPSA id 089147F0DB; Wed, 12 May 2021 07:52:26 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a52 From: Tulio Magno Quites Machado Filho To: Florian Weimer , "Lucas A. M. Magalhaes" Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 2/3] powerpc64le: Check HWCAP bits against compiler build flags In-Reply-To: <87im3owe4q.fsf@oldenburg.str.redhat.com> References: <162076753769.316372.10532385586864995177@fedora.local> <87im3owe4q.fsf@oldenburg.str.redhat.com> User-Agent: Notmuch/0.31.3 (http://notmuchmail.org) Emacs/27.2 (x86_64-redhat-linux-gnu) Date: Wed, 12 May 2021 11:52:23 -0300 Message-ID: <871racxavs.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2021 15:09:39 -0000 Florian Weimer via Libc-alpha writes: > I tried to allude in the commit message that this is expected. Maybe I > should drop the POWER10 check? I don't think this is necessary. Even if you removed the P10 check, I don't think the P9 check is guaranteed to work because when _ARCH_PWR9 is set, the compiler is allowed to use P9 instructions in this function before the test is executed. I think this patch is trying to improve the error message to the user. With that said, it doesn't hurt to copy your explanation as a source code comment, i.e.: /* This approach does not work for the POWER10 because the bootstrap relocation already uses PCREL instructions, so the detection code does not actually run. */ >> +#ifdef __MMA__ >> + if ((GLRO (dl_hwcap2) & PPC_FEATURE2_MMA) == 0) >> + _dl_fatal_printf ("\ >> +Fatal glibc error: CPU lacks MMA support (POWER10 or later required)\n"); >> +#endif >> +} I'm not sure it's a good idea to require MMA. __MMA__ is enabled with -mcpu=power10. However, I'm not aware of any compilers able to auto-mma code. In other words, we have to use it explicitly right now. Which means we shouldn't have MMA instructions in glibc at the moment. -- Tulio Magno