git: 6cc69b793bbd - stable/13 - arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 09 Jun 2023 19:57:56 UTC
The branch stable/13 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=6cc69b793bbd761ec04eee0b379392dd75f09351
commit 6cc69b793bbd761ec04eee0b379392dd75f09351
Author: Mykola Hohsadze <koliagogsadze@gmail.com>
AuthorDate: 2023-04-18 15:50:58 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-06-09 18:14:58 +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 <size> field of the instruction. However, when the
<S> 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
(cherry picked from commit cb923f03faa068f0c8ed5ffa7c3485ad7918be10)
---
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 ea6193655a5f..0f7b040e7b06 100644
--- a/sys/arm64/arm64/disassem.c
+++ b/sys/arm64/arm64/disassem.c
@@ -521,9 +521,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:
@@ -537,7 +541,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");