From nobody Tue Apr 25 20:23:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q5YNq3jvkz46g4k; Tue, 25 Apr 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q5YNq2jmkz3F02; Tue, 25 Apr 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682454219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hXZ4056Ol8zypeBGfCvPK8K2L698L2MTT76Wkw4cGe0=; b=wRpu9k4zrCXGReDfQUjWG+er6xz4BLaqHavOqVCrf42LyCR+z0xZI8X9UCAeuSYMQl+pU7 AXEXT8th7cFxbTlkvGnr6DAGKCo3OVNnwdmkzJlhcDCqwYligi/FmPsdgPCw5eh7g2IbmT nUPs2MLH5oP7n+SvMY4z3FyVrGFWDuzrBAZHF4Y3W+DnSag7ECF+p6HmDtNgaI4SmsS8BU JrR0hO8oxg/ezctW6xCbOACQg5Sz9kRxYwZms/iRKoo0LfMxo6OIxh75wKvRmdPKXDAjrm RMz10H4bgAPl9H2XK35cKfFqfpm7gm2GkCTI5Z05M6uXcMrbXQjtXzXGtj2zGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682454219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hXZ4056Ol8zypeBGfCvPK8K2L698L2MTT76Wkw4cGe0=; b=PSOKw63lRfjh3uikM01bWcqzOfM2SLgG8kR1Uu0CZPyp+MAD76C9Mx/K0Dpg/aLAK4Zc1G mPDyLpPgoLDSpyWHtW0GPYZuiEmnZXy7D+3LoZg8VhwCv0dknpijJzIeCHx5npuVsefkZF tLwiE86BU5XNrkPCBIZgAbhJZQ6n0YNGY9co8YbQpyYT2g70wnVH1D0uxVUKcHslJT/n7r /TIb6tQFsuMhHQfT/WefWwrK2LWH3sn5feC3mkldCnk4AXjJISrwYyJBXh3M63NRifhdoQ UqIEDLTjO1V0yXBu3Fm+30N9TvflZszTUNb6orsF6tJr5F3nzKg7+zMofrm6JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682454219; a=rsa-sha256; cv=none; b=XzqiqWaZi/wEIwvZiPRFFSPUQAS4JiInBUQ1D589DRlPWqpHFiJwQTlxewXHx4L8itHRrI nAbP4Q85rMtIGtcbqVG+ZcqhlG3gclbYoRt4fTGuRpV1o7sDSgv9NGw2dvZq+i45/PXsZM +2gm8fuwYJLUGouPcBji4NbRs1TPTGj1dUFKFYHuf0oYpszuEIwBNh9dMjea4C4BBPsGJt od1aAgyGce7d72+Q8IZmYn8xCoenocohhGiTZDm6IthlwcDqnJlZj1q6EvyZWOr0owF51/ avXSSnvjlXmeqRwBAQE61GsX4G2DeuCDCSJSx/zK6K9PBCO+NDTdqx6GYCugXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q5YNq1nBSz1LSQ; Tue, 25 Apr 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33PKNdca025554; Tue, 25 Apr 2023 20:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33PKNd1U025553; Tue, 25 Apr 2023 20:23:39 GMT (envelope-from git) Date: Tue, 25 Apr 2023 20:23:39 GMT Message-Id: <202304252023.33PKNd1U025553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: cb923f03faa0 - main - arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb923f03faa068f0c8ed5ffa7c3485ad7918be10 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=cb923f03faa068f0c8ed5ffa7c3485ad7918be10 commit cb923f03faa068f0c8ed5ffa7c3485ad7918be10 Author: Mykola Hohsadze AuthorDate: 2023-04-18 15:50:58 +0000 Commit: Mitchell Horne CommitDate: 2023-04-25 20:23:15 +0000 arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02 The current implementation is wrong, since it unconditionally sets the amount equal to the field of the instruction. However, when the bit (scale) is not set, it must be zero. Also fix a typo, sxts to sxtx, according to the Arm64 documentation. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39334 --- sys/arm64/arm64/disassem.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 681164011b40..90ae51c5740c 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -503,9 +503,13 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) arm64_reg(sf, rt), arm64_reg(1, rn), arm64_reg(option & 1, rm)); - /* Calculate amount, it's op(31:30) */ - amount = (insn >> ARM_INSN_SIZE_OFFSET) & - ARM_INSN_SIZE_MASK; + if (scale == 0) + amount = 0; + else { + /* Calculate amount, it's op(31:30) */ + amount = (insn >> ARM_INSN_SIZE_OFFSET) & + ARM_INSN_SIZE_MASK; + } switch (option) { case 0x2: @@ -519,7 +523,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) di->di_printf(", sxtw #%d", amount); break; case 0x7: - di->di_printf(", sxts #%d", amount); + di->di_printf(", sxtx #%d", amount); break; default: di->di_printf(", RSVD");