From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.15634.1656530073009232279 for ; Wed, 29 Jun 2022 12:14:33 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5CF6152B; Wed, 29 Jun 2022 12:14:32 -0700 (PDT) Received: from pierre123.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1D7F73F792; Wed, 29 Jun 2022 12:14:30 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Edward Pickup Subject: [PATCH RESEND v1 2/7] ArmPkg/ArmDisassemblerLib: Replace RotateRight() Date: Wed, 29 Jun 2022 21:13:50 +0200 Message-Id: <20220629191355.2618844-3-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220629191355.2618844-1-Pierre.Gondois@arm.com> References: <20220629191355.2618844-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois A local RotateRight() function is defined. The RRotU32() function available in the MdePkg/BaseLib does the same. Prefer the generic function and remove the local RotateRight(). Signed-off-by: Pierre Gondois --- ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c b/ArmPkg= /Library/ArmDisassemblerLib/ArmDisassembler.c index 0e09062957b4..24a317a9c9f4 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c @@ -128,15 +128,6 @@ FieldMask ( return ""; } =20 -UINT32 -RotateRight ( - IN UINT32 Op, - IN UINT32 Shift - ) -{ - return (Op >> Shift) | (Op << (32 - Shift)); -} - /** Place a disassembly of **OpCodePtr into buffer, and update OpCodePtr t= o point to next instruction. @@ -409,7 +400,7 @@ DisassembleArmInstruction ( // A4.1.38 MSR{} CPSR_, # MSR{} CPSR_= , if (Imm) { // MSR{} CPSR_, # - AsciiSPrint (Buf, Size, "MRS%a %a_%a, #0x%x", COND (OpCode), Write= Back ? "SPSR" : "CPSR", FieldMask ((OpCode >> 16) & 0xf), RotateRight (Op= Code & 0xf, ((OpCode >> 8) & 0xf) *2)); + AsciiSPrint (Buf, Size, "MRS%a %a_%a, #0x%x", COND (OpCode), Write= Back ? "SPSR" : "CPSR", FieldMask ((OpCode >> 16) & 0xf), RRotU32 (OpCode= & 0xf, ((OpCode >> 8) & 0xf) *2)); } else { // MSR{} CPSR_, AsciiSPrint (Buf, Size, "MRS%a %a_%a, %a", COND (OpCode), WriteBac= k ? "SPSR" : "CPSR", gReg[Rd]); --=20 2.25.1