Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2967749rwb; Mon, 7 Aug 2023 06:24:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6DaZ6VX3lgKDFIPDDWX5dO4yKxUfiontR/Yz0+V3eCd51R1j7bwjCoBdEXOw/aaVzP/9Y X-Received: by 2002:a05:6a20:734b:b0:f0:50c4:4c43 with SMTP id v11-20020a056a20734b00b000f050c44c43mr8688682pzc.5.1691414698088; Mon, 07 Aug 2023 06:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691414698; cv=none; d=google.com; s=arc-20160816; b=zeAMK9hb9Qd4UB/x69PmE5xxkXw4t77jU7+Vjg7ZmNkVZL6dQbPrHx9iA3dKB184F7 0GmbMIVLDOjRYovbiP5N0QT2YuYFy4jLO4QKXzsz5ZwzvmTDmUhLmBGpSTrpA8Q5qKnq 45xBgHw/b1XhNB9ymsiO92+C1Dt9B2oAfXHCl+UZjiPsawtNlryspJle1vlNe0N53TW1 JzqVD/OgAahaB1JIF7FX0iaaYYrPGE6XGhoE46bLZHxDWX/0b/W4g5GN3zoB+mzRSOnq hh9C70UrQintrAd7C269njdIdeESY5bWGI2QUFFwstbcPAQK1GNsegr99y0GZHn8Qm+B lo8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=pgN6ITNOX4XAghEqnE7rc109x2dPHO2XXLtjfGMGEBw=; fh=KutyjcbQvQAObT73hZ9+Mk/TI79Vc0CV6w2Xk+1Erfc=; b=tUFX8xhx0r/pWaJHLyLcE4EG41GfvHgWlSQaw56G+ZyJXRyMy3Hj4JPDUnTrQdoj/H 7VEy7UKBW1OipT4qNYTe+hKGZtamZiFe5wE+TYz1GKcpmY2098gi/7//T8eMUOXoHdA5 a/GKmJNeyrylgHWkHyH/ldQZwulq46EbU3CrnQyRD29AwMO0LqjiWFW+7sKBRKSMPQRm xcQvNiAMzhDqCxjl76G9jTTCXTvSj8nz36AC9mQbSjiluSYq+ozZz4+tAOTrHiIWers9 BrC8EVHViGbmEL9dDclF3NcfUvT64G7ZOIjSkQHk3QUJ5FGVZW+ks0sGmTWdWJ4a0VW5 VmRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ZiWN/a3p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 134-20020a63028c000000b0055e48c43ab7si5566591pgc.470.2023.08.07.06.24.45; Mon, 07 Aug 2023 06:24:58 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ZiWN/a3p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233716AbjHGMo5 (ORCPT + 99 others); Mon, 7 Aug 2023 08:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233771AbjHGMoh (ORCPT ); Mon, 7 Aug 2023 08:44:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C283AC9 for ; Mon, 7 Aug 2023 05:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691412231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pgN6ITNOX4XAghEqnE7rc109x2dPHO2XXLtjfGMGEBw=; b=ZiWN/a3p4R6zIVtKfkSGQ/XwOazIHTNuaxp8kYidz2edqLEeDpUpEGuw+eOaxCObb2ZKYj 9/t6S1Px5sjAER6BlxrqFD9fu1budZ8Z1N1+rG1bnBWGR6cI1nwmEMHoorqj/U0rboz5v/ 8bIEdQXdJljmkIuRqV7DKha2mxFBywE= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-VkhQ3GWqNk66vZeVUGT2Qw-1; Mon, 07 Aug 2023 08:43:49 -0400 X-MC-Unique: VkhQ3GWqNk66vZeVUGT2Qw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD5F6381AE49; Mon, 7 Aug 2023 12:43:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6342E40C2076; Mon, 7 Aug 2023 12:43:40 +0000 (UTC) From: Florian Weimer To: Jakub Jelinek Cc: Marco Elver , Andrew Morton , Kees Cook , Guenter Roeck , Peter Zijlstra , Mark Rutland , Steven Rostedt , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Tom Rix , Miguel Ojeda , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Dmitry Vyukov , Alexander Potapenko , kasan-dev@googlegroups.com, linux-toolchains@vger.kernel.org Subject: Re: [PATCH v2 1/3] compiler_types: Introduce the Clang __preserve_most function attribute References: <20230804090621.400-1-elver@google.com> <87il9rgjvw.fsf@oldenburg.str.redhat.com> Date: Mon, 07 Aug 2023 14:43:39 +0200 In-Reply-To: (Jakub Jelinek's message of "Mon, 7 Aug 2023 14:38:05 +0200") Message-ID: <87h6pbf2f8.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 * Jakub Jelinek: > On Mon, Aug 07, 2023 at 02:24:26PM +0200, Marco Elver wrote: >> > | If the arguments are passed in callee-saved registers, then they will >> > | be preserved by the callee across the call. This doesn=E2=80=99t app= ly for >> > | values returned in callee-saved registers. >> > | >> > | =C2=B7 On X86-64 the callee preserves all general purpose register= s, except >> > | for R11. R11 can be used as a scratch register. Floating-point >> > | registers (XMMs/YMMs) are not preserved and need to be saved by = the >> > | caller. >> > | >> > | =C2=B7 On AArch64 the callee preserve all general purpose register= s, except >> > | X0-X8 and X16-X18. >> > >> > Ideally, this would be documented in the respective psABI supplement. >> > I filled in some gaps and filed: >> > >> > Document the ABI for __preserve_most__ function calls >> > >>=20 >> Good idea. I had already created >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110899, and we need >> better spec to proceed for GCC anyway. > > "Registers used for passing arguments > are preserved by the called function, but registers used for > returning results are not." > > You mean just GPRs or also vector SSE or MMX registers? I think this is pretty clear for x86-64: | Floating-point registers (XMMs/YMMs) are not preserved and need to be | saved by the caller. The issue is more with future GPR extensions like APX. Thanks, Florian