Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp772331rwe; Wed, 31 Aug 2022 10:41:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ggsNdzzyIBy7Ju5eSBOA3p+s1wrNyxQzHmD5/bDyH7uNxUmLlXHBjuECj4hFWy7+BDoCj X-Received: by 2002:a17:90a:4fc2:b0:1fb:3486:7b3d with SMTP id q60-20020a17090a4fc200b001fb34867b3dmr4449230pjh.49.1661967662846; Wed, 31 Aug 2022 10:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661967662; cv=none; d=google.com; s=arc-20160816; b=Ow6xdK6hxGZCBe24l61RernQoxe6QJfCdAJ/LmET9jQj2Slthu3HaxdbpTRAWyk/H4 0DYlNBAS6AWybpl85cIk1FJb619xw6xU9FYPVFsBGWIq7bbM44oALSV9VB1ZB3EOLiPF eiK150VK8bwT59imYsIhSJlHzz5TqAbDCPcdtxTxwRz92kY8nE0M3XhOg26lBbjUhDq0 WSaIeFx+yLrYwJM9RSq6EvyD7X+z/ZuHmOZkq3qaWFHzrqCY0UDIjOBHobZ74/gN51Dm 5qRYAJmQTem9483bbRsL6PS3UmaGv6FDg9ObJII1AoIGuvkWWlGhYO5Dzf8aJkRo1g1F OrWQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DdNOmnay44tpamKMrs1LwErqXxNdYL1hnnIQ+CjZ7QA=; b=1C8a8qjIarwLSoTZIx6OVUIjt8Z/fGDJ6wJracLjZcGn89gynuylT8Hs1zCODsk3bQ MP6Vs87SlKqbrsa3h2ZcpkHEt+gjh3mxKyTAYScrAJDbtH/Bc0BDbFyS6ObTERf05fWa IOzkMUms6AdM8Nr2E+hlgP4xt8KLP8DzzH0d19Fih+da83aMRVzidxMNsRLB7n5hxcNK 6nf4aWQAaNbrOsdHcqwdQ1IoYsnvdlzTksCe12tGK9s1IfrQpLF/nHON3xb0tnzlJyqx ZNtABsBNHPhbw6dohOn0L1zNM0fIDj3iQ84vMu4FVs1PDtVqoGwdz6RDH7lpbKo+/s3i UNaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=MG0rBr2w; 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 c2-20020aa781c2000000b0052b75c32fd2si13942443pfn.48.2022.08.31.10.40.52; Wed, 31 Aug 2022 10:41:02 -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=@ventanamicro.com header.s=google header.b=MG0rBr2w; 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 S231954AbiHaRZY (ORCPT + 99 others); Wed, 31 Aug 2022 13:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbiHaRZI (ORCPT ); Wed, 31 Aug 2022 13:25:08 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E5463C8 for ; Wed, 31 Aug 2022 10:25:05 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id k9so19217694wri.0 for ; Wed, 31 Aug 2022 10:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=DdNOmnay44tpamKMrs1LwErqXxNdYL1hnnIQ+CjZ7QA=; b=MG0rBr2wWp2+FARb5OnChcQ4x0S23ZL60h95CnzB7VjDZ/H2HzOa4qhBqJfaUhg+bl HH5NMuPrPw4BBMJ3GKz++cbp+aJPSUUdP776VpS+lgLuEgUKtZt18gnVv3ooY7nKDzxl vwmrQATtXcj1hDSk4rrVBtBx0sqkrypO3+3VGt8gksRuuwORrUdhboPgeoODeKhpbVqp W4+J069NjrhutbCY/qVWI0Pk5r3H8/XFTGFFdVfn7/SHsW0aszphuwKoa5PaZPpGYZQM WiwK8bGL1chbaM/cM+VZ5grJrVGRBHGb/OYSZDQwgm1s2MBXHEJqrvVJx8SRmoWWtlrg bViA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=DdNOmnay44tpamKMrs1LwErqXxNdYL1hnnIQ+CjZ7QA=; b=k0LGZmilDGwnb9LFq1BKr0iKFPON/8nvhzQKb2ecJwmNYgYLwcN3Mr35zsFgpffEuX /oSW7RgFP+mijQwX19DZry9ks+3eyFZUJQS/33rNuyGINm6/EstqvtknLlwDPHMDDH7Q dzhOPmBKL7iAl86699uHUgQ58/NFQLVbznx3UgpnVI43Ht9ZZJFiW8RMcF0vbxTKk+yA ByWuIKWnx5CwZeC7a5/Wan8wlhMbEy4foMn9RTpu0ZyHq5+MtciEAHgB6GArBW4oweu5 rxcUhdEtd4TLuJDoxBBWAGh4F/3qzX9+/yNYd1wJoBdMHRoFTGSvFzFk6qWFnNaP/QnC SWjA== X-Gm-Message-State: ACgBeo2xqQMbQZLPH7FM/SbA/LyIddjGfCDPWM0Axu+GFSE0Ztn/vZao alHYjhRVY/1MyPFUmIHhIgHPxQ== X-Received: by 2002:adf:d1c5:0:b0:222:cbe8:f9fa with SMTP id b5-20020adfd1c5000000b00222cbe8f9famr12286408wrd.383.1661966703923; Wed, 31 Aug 2022 10:25:03 -0700 (PDT) Received: from localhost (cst2-173-67.cust.vodafone.cz. [31.30.173.67]) by smtp.gmail.com with ESMTPSA id u18-20020a05600c19d200b003a5a5069107sm2618214wmq.24.2022.08.31.10.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 10:25:03 -0700 (PDT) From: Andrew Jones To: linux-riscv@lists.infradead.org, kvm-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, anup@brainfault.org, mchitale@ventanamicro.com, heiko@sntech.de Subject: [PATCH v2 1/4] riscv: Add X register names to gpr-nums Date: Wed, 31 Aug 2022 19:24:57 +0200 Message-Id: <20220831172500.752195-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220831172500.752195-1-ajones@ventanamicro.com> References: <20220831172500.752195-1-ajones@ventanamicro.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 When encoding instructions it's sometimes necessary to set a register field to a precise number. This is easiest to do using the x naming. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel --- arch/riscv/include/asm/gpr-num.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/riscv/include/asm/gpr-num.h b/arch/riscv/include/asm/gpr-num.h index dfee2829fc7c..efeb5edf8a3a 100644 --- a/arch/riscv/include/asm/gpr-num.h +++ b/arch/riscv/include/asm/gpr-num.h @@ -3,6 +3,11 @@ #define __ASM_GPR_NUM_H #ifdef __ASSEMBLY__ + + .irp num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 + .equ .L__gpr_num_x\num, \num + .endr + .equ .L__gpr_num_zero, 0 .equ .L__gpr_num_ra, 1 .equ .L__gpr_num_sp, 2 @@ -39,6 +44,9 @@ #else /* __ASSEMBLY__ */ #define __DEFINE_ASM_GPR_NUMS \ +" .irp num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\n" \ +" .equ .L__gpr_num_x\\num, \\num\n" \ +" .endr\n" \ " .equ .L__gpr_num_zero, 0\n" \ " .equ .L__gpr_num_ra, 1\n" \ " .equ .L__gpr_num_sp, 2\n" \ -- 2.37.2