Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12755874rwd; Fri, 23 Jun 2023 10:11:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DoG9Yw7EUXOVvsU53pQsv1n0mBdprdcE1IKEIIKD7DXuJHtgL8rGL1xDhoyL2QkoH1PSc X-Received: by 2002:a05:6a21:7896:b0:121:c372:6d57 with SMTP id bf22-20020a056a21789600b00121c3726d57mr23442791pzc.12.1687540297455; Fri, 23 Jun 2023 10:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687540297; cv=none; d=google.com; s=arc-20160816; b=cvvKixnFmWW7K2SYs9oN+Ni2zSL29unJZpj7WC6MddljKg6c8FiHbdIftdjwSkU3P5 p/4eifOduos54axDxVhF9LOy32NLkNBQG82vP6rAswvjbcY2+bPmh4VrPWsUUHlvVAJr Vxl496XBaDEPq/fIA5CBG3ZO+cUVrtZ++OjdCnadYWcmcpVsGlj4psw8R/lC16rTQH5r eJQHOx8yi0c+0IyEEAY/xcIGIPNNTAV+Dmjfyyhbom3jNhGfRQuTOdbZcNOo7XQZ9B/z dQFvueH4/yJKJFnlMfkHFMiArm6iby3rLi9SuLfmUtvut9MRFi4XOhaBhMYH7lCnhly1 bQkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bAsIQBfYRtWlIbsiiZtenF+RZ25JZA0d+ULjRgQ24gs=; b=LzZchNYQbXCStjsrA6b5KZ9qP4nQEkSORhCwM524+inJ4lUDZP23/OFOabQ5D7RNzh LktK3rgU6kBJC4jjWHJojSVJ7F4KcytZcXUPy6mtxTHGVeh+SEd3fS2+UqAyd6vKKVlf JglwxxLPQL5cpEpNvG6VKHC0NsbO2vA7m1phAruzdyHXk528eI9Ep2chVL2oSdoeHyWl fIINOlhsOH2ili2L7W/sLwNlA55O/4E/b8IPOWTA041MxdopxH4OdqfCHkNHbf3/f0/W +oRqAppkzaiZ11TKoAN+RmmdcyWlLRdtuhhFWpyvUU5tbNk3bZMEjy41gUHIyudLMMTr bOUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SvsCFQ3m; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w191-20020a6382c8000000b00530b3b98fc5si800172pgd.417.2023.06.23.10.11.23; Fri, 23 Jun 2023 10:11:37 -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=@kernel.org header.s=k20201202 header.b=SvsCFQ3m; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231621AbjFWQAi (ORCPT + 99 others); Fri, 23 Jun 2023 12:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbjFWQAg (ORCPT ); Fri, 23 Jun 2023 12:00:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFBF82117; Fri, 23 Jun 2023 09:00:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C13961A5F; Fri, 23 Jun 2023 16:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1A6EC433C0; Fri, 23 Jun 2023 16:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687536034; bh=lGUFlPPTlGJTju7ucb5booe1R91+kYqXJSf7ei+QnP0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SvsCFQ3mSl1g+Uj3A/P+4AeMMM07O1NdJbdW3MF8udVS+lGl3PntY8TJYPU4J8DqQ jEbcyU5mfdNs3XfXQzJ/v18YY3fKxusKK5iQywDj0eI6jDvfDAXPqS8uGguF9D4/Qx Atlb7jER8C31ofSo9i754crSFo8Beos7Amq1Hk+0QTHgBsP3gW1Q/V3yGkb0nTnoSt 1VynU1+2NZ+f89dGVdWexxOC/3eTNjtQUZsGp6dKW4ZcPdTQn4iw+lzhf60odpFQWR Mo3OBqNY98ZzxO0i8DIxZ/DyP6TUSqFRgFdDBF/oBvMvxRGqAt2Bpkj82lvm7qG0/T JUIXrz9j8VdpQ== Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2b475b54253so13683451fa.2; Fri, 23 Jun 2023 09:00:34 -0700 (PDT) X-Gm-Message-State: AC+VfDzFafpxb9e6Bl6oGTnwUGyLS0babjcmhiAFIWB44taexe2xyZJ/ wxPapVZAQlCMqFUchARep5uuNDBAcS96dwby2X0= X-Received: by 2002:a2e:a175:0:b0:2b3:3175:5d46 with SMTP id u21-20020a2ea175000000b002b331755d46mr14342611ljl.45.1687536032826; Fri, 23 Jun 2023 09:00:32 -0700 (PDT) MIME-Version: 1.0 References: <20230623134351.1898379-1-kernel@xen0n.name> <20230623134351.1898379-4-kernel@xen0n.name> In-Reply-To: <20230623134351.1898379-4-kernel@xen0n.name> From: Huacai Chen Date: Sat, 24 Jun 2023 00:00:20 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/9] LoongArch: Prepare for assemblers with proper FCSR bank support To: WANG Xuerui Cc: WANG Rui , Xi Ruoyao , loongarch@lists.linux.dev, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, WANG Xuerui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 Hi, Xuerui, On Fri, Jun 23, 2023 at 9:44=E2=80=AFPM WANG Xuerui wro= te: > > From: WANG Xuerui > > The GNU assembler (as of 2.40) mis-treats FCSR operands as GPRs, but > the LLVM IAS does not. Probe for this and refer to FCSRs as "$fcsrNN" > if support is present. > > Signed-off-by: WANG Xuerui > --- > arch/loongarch/Kconfig | 3 +++ > arch/loongarch/include/asm/fpregdef.h | 7 +++++++ > 2 files changed, 10 insertions(+) > > diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig > index 743d87655742..c8e4f8b03c55 100644 > --- a/arch/loongarch/Kconfig > +++ b/arch/loongarch/Kconfig > @@ -242,6 +242,9 @@ config SCHED_OMIT_FRAME_POINTER > config AS_HAS_EXPLICIT_RELOCS > def_bool $(as-instr,x:pcalau12i \$t0$(comma)%pc_hi20(x)) > > +config AS_HAS_FCSR_BANK > + def_bool $(as-instr,x:movfcsr2gr \$t0$(comma)\$fcsr0) The word "bank" is difficult to understand, at least for me, so use "class" may be better. Huacai > + > config CC_HAS_LSX_EXTENSION > def_bool $(cc-option,-mlsx) > > diff --git a/arch/loongarch/include/asm/fpregdef.h b/arch/loongarch/inclu= de/asm/fpregdef.h > index b6be527831dd..b0ac640db74c 100644 > --- a/arch/loongarch/include/asm/fpregdef.h > +++ b/arch/loongarch/include/asm/fpregdef.h > @@ -40,6 +40,12 @@ > #define fs6 $f30 > #define fs7 $f31 > > +#ifdef CONFIG_AS_HAS_FCSR_BANK > +#define fcsr0 $fcsr0 > +#define fcsr1 $fcsr1 > +#define fcsr2 $fcsr2 > +#define fcsr3 $fcsr3 > +#else > /* > * Current binutils expects *GPRs* at FCSR position for the FCSR > * operation instructions, so define aliases for those used. > @@ -48,5 +54,6 @@ > #define fcsr1 $r1 > #define fcsr2 $r2 > #define fcsr3 $r3 > +#endif > > #endif /* _ASM_FPREGDEF_H */ > -- > 2.40.0 >