Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5346780rwl; Tue, 11 Apr 2023 04:16:08 -0700 (PDT) X-Google-Smtp-Source: AKy350bvCRVD9MWXK9sRVzcsiXFoO9ZTfxmoJGqfkh4tbvm6zkMGBb4fnw5D7Vu+BCNVQEMGBj+h X-Received: by 2002:a17:906:710e:b0:94a:5a9e:9da0 with SMTP id x14-20020a170906710e00b0094a5a9e9da0mr8282203ejj.77.1681211767672; Tue, 11 Apr 2023 04:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681211767; cv=none; d=google.com; s=arc-20160816; b=MQrzZPz3RN7R0YvMQJ4iOskp8GLy+2oNkDcEnuX566ULmJ9nKw7Dw7IPJQAv3+yrAV FwJJrGFd51Qmm4P8zxaUnppJJJKXied7UoEp8Xo8gzx0G2HlUdUJEFrDNTJTUwP88wSU pdiKAWHMJL1Cw55C1a7MdY1Dn3jOSqeNSFn+89T1UDR+glIzgluApPU5Bj2eDMhGA9Sr D2EHfd8A3T4iAZpRFfcH5V97had2O6kdrEm4Z7DYNYhC1KOsHXxq3WOhYb5qn1Iwur0+ VkfCe9/oNdnGS2+h/esUhLsXXw2LnQfJSBOeFmOZbtFoabhh6K1sSiNHeFzOYdwFoynn L3aQ== 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 :feedback-id:dkim-signature:dkim-signature; bh=GICeuC5Na6dEOkT9RFxmFTSwUiB6wXXr5dWatVKt1SI=; b=L6HXDwDyZazW5Vgdtnqlfdaei6/0Ml4DoFlqLT0yOK0rMqMuyEz0ylG4MjupZ2Kree i7kV2TKXFYoryfEnpjRIKgAcuAdkOq90kywEo5fLTqgCzmFuH63zE22QInGpmRUg1wWU d0SjkhaHnxUVUwKN372giqLVwAp4W5xFSy/2Xa+e5CJe+FS2QpiTmx6TkpwQlUayiGYS W1/b1uk0BW3V8ee3kGQZY/NeqWxP6v1KhuOznRme7K0Qfm5v53VcyVSjKSDlftN7N9pF OFmPoUeLRT+76WOWUVi7I6qmZpg936K3kCizg+8deRe1il/mAgbQNZDEw2lYd4EozA1q QBkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=pkcPqLOT; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=M+Knq3Ao; 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=flygoat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v19-20020a170906b01300b009313e7b7273si10438157ejy.649.2023.04.11.04.15.30; Tue, 11 Apr 2023 04:16:07 -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=@flygoat.com header.s=fm1 header.b=pkcPqLOT; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=M+Knq3Ao; 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=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbjDKLM4 (ORCPT + 99 others); Tue, 11 Apr 2023 07:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjDKLMq (ORCPT ); Tue, 11 Apr 2023 07:12:46 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C17421F; Tue, 11 Apr 2023 04:12:45 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 35F525C0071; Tue, 11 Apr 2023 07:12:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 11 Apr 2023 07:12:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1681211565; x= 1681297965; bh=GICeuC5Na6dEOkT9RFxmFTSwUiB6wXXr5dWatVKt1SI=; b=p kcPqLOTDXDiX/CMkh31n1tqROjNO2IlD7uclASqF30oAVVIYvPZA/YEuphtzk+yJ rJSKO459pNf0JipcEe6gQJCKtFG/dTuSfCe1ss/hZoWSP3LetsDZ9E1w43kxDUrk ewgz9T/bpYBsK7Is29NJ1v8am8Ybv3LcLAZOOWCkadb+1B/oslKcmKcy+LtJg9eI h2iC53zc/RitRIhCg6Lkb7UgcnwDCMG8pO+kNMOtJ3I4NEW01oNf4h70T17E+9OP kh/24pt7AfKw3JHUWQIcCxfHXII3+HE4ib7dRXSHN94yf7BLVq8zUjLOaHZg1QHR aKuzvlHbQiIo/NIRKynrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1681211565; x= 1681297965; bh=GICeuC5Na6dEOkT9RFxmFTSwUiB6wXXr5dWatVKt1SI=; b=M +Knq3AoE1AfC0IokuH8rIhjOXIH6cUnlpwz8NM87QNJ8Ldybx0IVGWJKJx3WKg8q lI2aEZpZE/0z+b3DMFMYjYv8wg5zlceHktIToLp1ucci2/JHR9e5uwpKh733DKhv XQCSEXKmlepWtBVvAsvrOQPgVTDE1DcWjHWqHNU9jQQPeuPhcmfaQbYSIHVWdV9e V6LT9AggOdTZLaKog+v4lTZlp1a9ULg4uioN9HgMveiqOqVwiPpaeTpx1CPrFeJd UaRPQxr6mZBYmr7uT4IxKiepwTcw2m0FNblTxaShidtY3kNIUIgDztruzjUIyFZE wd/urtpsJk3ZETtpruG6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekgedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Apr 2023 07:12:44 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, and@gmx.com, Jiaxun Yang Subject: [PATCH 5/8] MIPS: mipsregs: Parse fp and sp register by name in parse_r Date: Tue, 11 Apr 2023 12:12:22 +0100 Message-Id: <20230411111225.55725-6-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230411111225.55725-1-jiaxun.yang@flygoat.com> References: <20230411111225.55725-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 parse_r helper is used to parse register number from oprand, it only handles oprand which use number to refer register before. However compiler may use $gp and $sp to reference register 29 and 30. Handle this situation by adding relevant match name. Fixes compilation error: {standard input}: Assembler messages: {standard input}:1937: Error: Unable to parse register name $fp Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/mipsregs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 9d928b952abf..7d2c1c90fa10 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -1277,11 +1277,13 @@ static inline int mm_insn_16bit(u16 insn) */ /* Match an individual register number and assign to \var */ -#define _IFC_REG(n) \ - ".ifc \\r, $" #n "\n\t" \ +#define _IFC_REG_NAME(name, n) \ + ".ifc \\r, $" #name "\n\t" \ "\\var = " #n "\n\t" \ ".endif\n\t" +#define _IFC_REG(n) _IFC_REG_NAME(n, n) + #define _ASM_SET_PARSE_R \ ".macro parse_r var r\n\t" \ "\\var = -1\n\t" \ @@ -1293,6 +1295,7 @@ static inline int mm_insn_16bit(u16 insn) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) \ _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) \ _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) \ + _IFC_REG_NAME(sp, 29) _IFC_REG_NAME(fp, 30) \ ".iflt \\var\n\t" \ ".error \"Unable to parse register name \\r\"\n\t" \ ".endif\n\t" \ -- 2.39.2 (Apple Git-143)