Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp677964rwn; Thu, 8 Sep 2022 07:21:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR63AV13JhB9mMxYcamu1jtfhgdXMttW1V0KjesyLsR89PYNcOgcsndu+QusvfnnAQEytmo7 X-Received: by 2002:a17:903:230b:b0:177:e667:7862 with SMTP id d11-20020a170903230b00b00177e6677862mr6475568plh.154.1662646902462; Thu, 08 Sep 2022 07:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662646902; cv=none; d=google.com; s=arc-20160816; b=Dz46Lc27SZO/JTqnMaQq1JXbKP6zN20HhdKXc7V+0+P3L0mP9xiSX5u7ni2hBruGPO koLbQDzrytUWpo5xf4dynmwZg1nnEjO5gZK6h7l/9d7uMTUd+eL4FK0SWGU+AeI46Tg0 ubIhwdagBmp9yYZk45uZ04e+X61E7KlrX7EVVxf1r3nbKsDgQU1oAhSNW0otUX+1XA4/ hVzXnpWZifsbU780cOfsZNJz8a0u3ELk7OsPwX/5avLtIXD5jdYTnA839Va1jnzvw4m5 r9xnVtKkJrH3Be0s7OYI1XexVLjIU+HlDOv8lXM/NnXtdlpgLjIpwm0t8zI8ywW5S/hq 7uKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fEEvnElqhX9qtqwX4nK4wrqptp1p3xiOFbdUl6TjyH8=; b=TBCIFXynCRNNXbUHgk+Nu3c3BygLyQZzHO09hMQUd0OsrxXzhIB1jAoin025//Fx39 j2dSar4OSwBpHIKgoqbKfKzDIikefsqYG74qc/8MSDY1iCX0RP/RZK9ULoORjwlNvLK7 J4HZmYIvyGvDYzSrflhJV57PW7XStD8vUhaf4UMXul75By4VlSiDgps2w8j71L5WAnAP 4XhDMCdPFfM08/fYAwYA3w8/BkaGsjeOwHBvD0Fs1z0QCI117hd97JKtVItE4EoB86ln 8mVzk2Ns2m3UOd0n8h8CUSiwzC7rweORuqhEneClY+k5h+WF7DaicD7LzOKxyaBbZKbv HrSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a6560cf000000b0041b64ff7fe9si637252pgv.79.2022.09.08.07.21.30; Thu, 08 Sep 2022 07:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbiIHOCI (ORCPT + 99 others); Thu, 8 Sep 2022 10:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231475AbiIHOBq (ORCPT ); Thu, 8 Sep 2022 10:01:46 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C750910C980 for ; Thu, 8 Sep 2022 07:01:38 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 288Dm1Ft015930; Thu, 8 Sep 2022 08:48:01 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 288Dm0t8015929; Thu, 8 Sep 2022 08:48:00 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 8 Sep 2022 08:48:00 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Michael Ellerman , Mathieu Malaterre , Nick Desaulniers , "linux-kernel@vger.kernel.org" , Paul Mackerras , Joel Stanley , "linuxppc-dev@lists.ozlabs.org" Subject: Re: [PATCH] powerpc/lib/xor_vmx: Relax frame size for clang Message-ID: <20220908134800.GM25951@gate.crashing.org> References: <20190621085822.1527-1-malat@debian.org> <7cb1285a-42e6-2b67-664f-7d206bc9fd80@csgroup.eu> <87v8pyemmw.fsf@mpe.ellerman.id.au> <9a5bd7c2-13ee-2517-48f6-e61a6dc9c076@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a5bd7c2-13ee-2517-48f6-e61a6dc9c076@csgroup.eu> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2022 at 06:00:24AM +0000, Christophe Leroy wrote: > Looking at it more deeply, I see strange things. I'll have to see full generated machine code to be able to see strange things, there isn't enough information at all here yet. Sorry. Use private mail if it is too big or uninteresting for the list :-) > What is that frame size ? I thought it was the number of bytes r1 is > decremented at the begining of the function, but it seems not, at least > on GCC. It seems GCC substrats 112 bytes while clang doesn't. That is the vars size + the fixed size + the size of the parameter save area + the size of the regs save area, rounded up to a multiple of 16. Fixed size is 8 on 32-bit PowerPC ELF. Frame size used by GCC here is just the vars size. > So it seems that GCC and CLANG don't warn on the same thing, is that > expected ? GCC substrats 112 bytes, which is the minimum frame size on a > ppc64, but here I'm building a ppc32 kernel, min frame size is 16. I need to see the generated code to make sense of what is happening here. It sounds like it is doing varargs calls or similar expensive stack juggling. Or just saving a boatload of registers on the stack. > And CLANG is still using stack a lot more than GCC. Good to hear! Well, good for GCC, anyway ;-) Segher