Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1648409rwb; Fri, 19 Aug 2022 07:12:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7o+cBIVMSOqSZSL4TCOJdlyIXOJtm/LiPtD9hRfLk0p/ndv+m3gvEwxcuYZM3/D8mMXXuL X-Received: by 2002:a17:907:1dea:b0:73d:5a2a:4bac with SMTP id og42-20020a1709071dea00b0073d5a2a4bacmr586366ejc.135.1660918361684; Fri, 19 Aug 2022 07:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660918361; cv=none; d=google.com; s=arc-20160816; b=q5mvH2ATwXAvluslGlmYLodgPixqa/08pHwMmFpjwZRI1b6v8+BVoUFLphjAld7e// KhoLOfOveyjIWZwgz3QPWPB7tGszGdGUHa6cQeSNKrtjiP3ny14a3ipLGMI72Lh/8UoG 2Q8PurMo5qsvouI8Qq9qsihqyw2LybClEV0o2/UC+lMexRGARTCzxX2MwpfsRkk0wjLH K+a1L6/1hzqFUvBkDxSjOx3OoPUZuCKB7Svw//RG4Hbd0s99O9HxN3lJKqRswdkluQoB Y2q0rVpHU7oj6zor00NGazy+Jyz/AcabUnJZX4O2rwzZdBEUh7vq1YbZGK5bfJtycRgK 8lSA== 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=gWpCeboSTd362c81JJRbfvlhocgLTAM7tdDbcBSzWLo=; b=wwgnp6/e05JKninFvQN04ACn1UMrYSaJL1GFa8mSeqmpZdIHua4dYpz2ovpyW9tSLk j9asURyGoqfmeU2ZMJfskjwmh6mvVv9hYvWqfrGqgYccIGb4aJFt503Urw1n+p3WeyMs 0CQ8foSuSeqNEEj9OoZ8tmZA0C51f7ZIkmKoo8T1WDNPmAzJGdlf/gZoblBRNSC8Sjma wu96YbnAmGsbzxytHlhLtIMzlB8w2rudqavqTEHGNM390CO2EoD0RyTe22wanRud5Mff jehTRw//aV/3MnsiJVWld6vKAwjZJefmWSm2HS9zHC+PWlh12cnHQjCAlLYpp/SCR9Eo F44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nAbT1+sm; 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 z16-20020a170906271000b00730cd48e30asi2593299ejc.474.2022.08.19.07.12.15; Fri, 19 Aug 2022 07:12:41 -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=nAbT1+sm; 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 S1349302AbiHSOC6 (ORCPT + 99 others); Fri, 19 Aug 2022 10:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349181AbiHSOC4 (ORCPT ); Fri, 19 Aug 2022 10:02:56 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3747100F0E for ; Fri, 19 Aug 2022 07:02:54 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id x21so5797637edd.3 for ; Fri, 19 Aug 2022 07:02:54 -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=gWpCeboSTd362c81JJRbfvlhocgLTAM7tdDbcBSzWLo=; b=nAbT1+smFaqdX4qfGI5TykDxMyIbjzhqPcHArokTkIhBwchex3uvH78ENi3Bnt4BX0 7w5W23B0DjDiFlHt0tvmIR7ZBNYQXCvUgD8pwYp8qlP3gFqj6NxL89vjWHt8T25TT1Wy UrKpuERmkAa5DCCZ1tOsYOxShaMrJ1Purq4AJ0OlUWJZnLKm9oeL6UTGZSl4ncJ7MzFr 82RvD6l56TIYCeypl3BK4Mgyzwq3H8JprBrW79AqcMzodyc7wGF4QoM8pQgA9htThGnF pqTJ9f/BsE6PliI6Iwsc5feBsinOW5WQUQkxw0puSHoOgvWPFWikY5bEgkDHA8tOF5ra LK2Q== 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=gWpCeboSTd362c81JJRbfvlhocgLTAM7tdDbcBSzWLo=; b=oxrs42yKyr9qY7hmx/evpjMKc1vEUaH1tdiZ9Z0ZHNRGi9pP/gQ/2crjwvHPCclesL 7M9YdViO9VqErx6sRbTUn+QlM3KzCQWm8x3qkzR5wbaJsiczWh5K00gsaCBZD4G/OQ06 9zEU78YPh31JGsRuYXkLkS70mbG2OkSYjbWw4vI1ohBEVt1Ua857mw0CTN36eAOxGwkB bZfM+zQyBi3Gc3YDtiRCFF4ogIIg8RuMxZbO4JXRL19ei9/mFvpO/i92JdJVihISKi6Q 43q7lMeBmQoPa+DaxeOL+IwuQZwOLwaTXhiof1Qg3gYlW0OHtcR/73IFqhxs3P4ztFus qzOg== X-Gm-Message-State: ACgBeo1QC2Qs9KK4gBDHRV/hflbIci11IbHx/6YYP0kYNuM/pTXEv0iD CNwgRhaDG8dwrDLSc0BTKxlwww== X-Received: by 2002:a05:6402:198:b0:442:da5a:6716 with SMTP id r24-20020a056402019800b00442da5a6716mr6164620edv.5.1660917773621; Fri, 19 Aug 2022 07:02:53 -0700 (PDT) Received: from localhost (cst2-173-67.cust.vodafone.cz. [31.30.173.67]) by smtp.gmail.com with ESMTPSA id q15-20020a170906360f00b00730a73cbe08sm2383101ejb.169.2022.08.19.07.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:02:53 -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 1/4] riscv: Add X register names to gpr-nums Date: Fri, 19 Aug 2022 16:02:47 +0200 Message-Id: <20220819140250.3892995-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819140250.3892995-1-ajones@ventanamicro.com> References: <20220819140250.3892995-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 --- 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.1