From nobody Mon Jul 31 12:59:01 2023 X-Original-To: dev-commits-src-branches@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 4RDyx83Y2Qz4q6YH; Mon, 31 Jul 2023 12:59:02 +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 4RDyx212gFz40wy; Mon, 31 Jul 2023 12:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690808342; 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=jZhKMVCHTCa03UOtTf92l+ycg8Q2ygg7EB4ClropLPo=; b=VK70TQRyMW6spU8IZmtkJkwZh1G3bdM35/cf3aOPYSZiWLUtHbd1N5Odn/mtatjg50fUF3 vglz9lhJnzkIi1KXm421JVwUvsJiQwn338i4kqxDSid4X5Qi7NRSRKHetO1eTSI67r5oCr yvigX41Ijno2zF7ZvS8JGR26Va2JHG0AF2Jjrjm3dyskiE6OfUfZLKA+p8CUfk3ZtJx9c4 bq6uleQypbzTWahjnPAI4pmIcVvPxdLx/CFKa0D3jmgb1c+jYTI0zyqP2xDxDYPYJSFatk D5PxGgbo3Jw99rsGvYhL3baEjMxKfYH9ISx1G1WKYp1d9BGlmhObhtXJboTtoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690808342; 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=jZhKMVCHTCa03UOtTf92l+ycg8Q2ygg7EB4ClropLPo=; b=RcfKaiBVc7iYD3bLhL3l5l9pW7ycdMb0bMc1Ek+2PNiYcJnd4CmP6PVX9k6f3lsU1ltWvi yZSASMlfRNh243YowtWCXx+xzpTEd0hXUoLeQAhVbEw9o/OYyjHtpQ6YJbPIOYUO6+bzhr IKR4gadJa9sB868DdLzcoNNiU6iy+bIMVKkSp1Z083LkIli5ewvRFyF8aQZ6CHi2DBl33+ RlLBFU2uKHaUOTmYBKwBD/aoyskkkKmX80kbl5gD6TPBEEMifdRF/smbSY/AF/pi8Shfuu QBWUTmmsEfLqHIBs5r/V41SKctqIXpBGuRSHNv8lDr+HsBfVdjNOzEt6dfRk6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690808342; a=rsa-sha256; cv=none; b=wmvJEbuBinDPqjQQuojIfB96aJ0EcjuYBkZhvZAj3cW8iMSAu/Iw9x29fkOSUiXGf1qTJ1 we8ylYi+BHERGhM3OrnC0+B57fEo/oShK2AxSFvNHVJ+GYIg7ZaOnuYWblO3qItsrWa4YV na71dqv2VZgh8eQFfx3phTD9sPjTe3ngV1wRJ4iyJe2VCRIvrdSPxcMz6sRm+Vk0m0vhdr NCw5Bz9WwW/s6XuD92khDXbFMbItK1+et7WZlSanNFFi6O5zkepceFaNchF2Vr5C2WbX7j w96HzhKbIoXIPznzS6X9sUzEXPNqg40jBwinG7J0FzQDn46hcGW8j3j288POhA== 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 4RDyx16wy0zx12; Mon, 31 Jul 2023 12:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36VCx1RT093860; Mon, 31 Jul 2023 12:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36VCx1HP093859; Mon, 31 Jul 2023 12:59:01 GMT (envelope-from git) Date: Mon, 31 Jul 2023 12:59:01 GMT Message-Id: <202307311259.36VCx1HP093859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: c3c6cedc0ab4 - stable/13 - arm64/disassem.c: remove redundant OP_RN_SP for TYPE_02 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c3c6cedc0ab487d168789e21a0902b28aacec26a Auto-Submitted: auto-generated The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c3c6cedc0ab487d168789e21a0902b28aacec26a commit c3c6cedc0ab487d168789e21a0902b28aacec26a Author: Mykola Hohsadze AuthorDate: 2023-07-24 20:47:17 +0000 Commit: Mitchell Horne CommitDate: 2023-07-31 12:54:01 +0000 arm64/disassem.c: remove redundant OP_RN_SP for TYPE_02 Removed redundant OP_RN_SP for TYPE_02, since these addressing modes always use the SP register, never XZR. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40588 (cherry picked from commit e57b86266b80e1eed266a8287ae51c941c591b9d) --- sys/arm64/arm64/disassem.c | 78 +++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 5dc0bf5100ef..c1e38266a2e0 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -98,9 +98,10 @@ enum arm64_format_type { TYPE_01, /* - * OP , [, #]{!} SF32/64 - * OP , [], #{!} SF32/64 - * OP , , {, EXTEND AMOUNT } + * OP , [, #]! + * OP , [], # + * OP , [ {, # }] + * OP , [, {, EXTEND AMOUNT }] */ TYPE_02, @@ -159,69 +160,73 @@ static struct arm64_insn arm64_i[] = { { "adds", "SF(1)|0101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", TYPE_01, 0 }, /* adds shifted register */ { "ldr", "1|SF(1)|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldr immediate post/pre index */ + TYPE_02, OP_SIGN_EXT }, + /* ldr immediate post/pre index */ { "ldr", "1|SF(1)|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* ldr immediate unsigned */ + TYPE_02, 0 }, /* ldr immediate unsigned */ { "ldr", "1|SF(1)|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* ldr register */ + TYPE_02, 0 }, /* ldr register */ { "ldr", "0|SF(1)|011000|IMM(19)|RT(5)", TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldr literal */ { "ldrb", "00|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, + TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* ldrb immediate post/pre index */ { "ldrb", "00|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrb immediate unsigned */ + TYPE_02, OP_SF32 }, /* ldrb immediate unsigned */ { "ldrb", "00|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrb register */ + TYPE_02, OP_SF32 }, /* ldrb register */ { "ldrh", "01|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", TYPE_02, - OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, /* ldrh immediate post/pre index */ + OP_SIGN_EXT | OP_SF32 }, + /* ldrh immediate post/pre index */ { "ldrh", "01|11100101|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrh immediate unsigned */ + TYPE_02, OP_SF32 }, /* ldrh immediate unsigned */ { "ldrh", "01|111000011|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* ldrh register */ + TYPE_02, OP_SF32 }, /* ldrh register */ { "ldrsb", "001110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF_INV | OP_RN_SP }, + TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsb immediate post/pre index */ { "ldrsb", "001110011|SF(1)|IMM(12)|RN(5)|RT(5)",\ - TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsb immediate unsigned */ + TYPE_02, OP_SF_INV }, /* ldrsb immediate unsigned */ { "ldrsb", "001110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsb register */ + TYPE_02, OP_SF_INV }, /* ldrsb register */ { "ldrsh", "011110001|SF(1)|0|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF_INV | OP_RN_SP }, + TYPE_02, OP_SIGN_EXT | OP_SF_INV }, /* ldrsh immediate post/pre index */ { "ldrsh", "011110011|SF(1)|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsh immediate unsigned */ + TYPE_02, OP_SF_INV }, /* ldrsh immediate unsigned */ { "ldrsh", "011110001|SF(1)|1|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF_INV | OP_RN_SP }, /* ldrsh register */ + TYPE_02, OP_SF_INV }, /* ldrsh register */ { "ldrsw", "10111000100|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldrsw immediate post/pre index */ + TYPE_02, OP_SIGN_EXT }, + /* ldrsw immediate post/pre index */ { "ldrsw", "1011100110|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* ldrsw immediate unsigned */ + TYPE_02, 0 }, /* ldrsw immediate unsigned */ { "ldrsw", "10111000101|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* ldrsw register */ + TYPE_02, 0 }, /* ldrsw register */ { "ldrsw", "10011000|IMM(19)|RT(5)", TYPE_03, OP_SIGN_EXT | OP_LITERAL | OP_MULT_4 }, /* ldrsw literal */ { "str", "1|SF(1)|111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* str immediate post/pre index */ + TYPE_02, OP_SIGN_EXT }, + /* str immediate post/pre index */ { "str", "1|SF(1)|11100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* str immediate unsigned */ + TYPE_02, 0 }, /* str immediate unsigned */ { "str", "1|SF(1)|111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_RN_SP }, /* str register */ + TYPE_02, 0 }, /* str register */ { "strb", "00111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SIGN_EXT | OP_SF32 | OP_RN_SP }, + TYPE_02, OP_SIGN_EXT | OP_SF32 }, /* strb immediate post/pre index */ { "strb", "0011100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* strb immediate unsigned */ + TYPE_02, OP_SF32 }, /* strb immediate unsigned */ { "strb", "00111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, /* strb register */ + TYPE_02, OP_SF32 }, /* strb register */ { "strh", "01111000000|IMM(9)|OPTION(2)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_SIGN_EXT | OP_RN_SP }, + TYPE_02, OP_SF32 | OP_SIGN_EXT }, /* strh immediate post/pre index */ { "strh", "0111100100|IMM(12)|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, + TYPE_02, OP_SF32 }, /* strh immediate unsigned */ { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", - TYPE_02, OP_SF32 | OP_RN_SP }, + TYPE_02, OP_SF32 }, /* strh register */ { "neg", "SF(1)|1001011|SHIFT(2)|0|RM(5)|IMM(6)|11111|RD(5)", TYPE_01, 0 }, /* neg shifted register */ @@ -547,9 +552,10 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) break; case TYPE_02: /* - * OP , [, #]{!}] SF32/64 - * OP , [], #{!} SF32/64 - * OP , , {, EXTEND AMOUNT } + * OP , [, #]! + * OP , [], # + * OP , [ {, # }] + * OP , [, {, EXTEND AMOUNT }] */ /* Mandatory tokens */ @@ -596,12 +602,12 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) di->di_printf("%s\t%s, ", i_ptr->name, arm64_reg(sf, rt, rt_sp)); if (inside != 0) { - di->di_printf("[%s", arm64_reg(1, rn, rn_sp)); + di->di_printf("[%s", arm64_x_reg(rn, 1)); if (imm != 0) di->di_printf(", #%d", imm); di->di_printf("]"); } else { - di->di_printf("[%s]", arm64_reg(1, rn, rn_sp)); + di->di_printf("[%s]", arm64_x_reg(rn, 1)); if (imm != 0) di->di_printf(", #%d", imm); } @@ -610,7 +616,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) } else { /* Last bit of option field determines 32/64 bit offset */ di->di_printf("%s\t%s, [%s, %s", i_ptr->name, - arm64_reg(sf, rt, rt_sp), arm64_reg(1, rn, rn_sp), + arm64_reg(sf, rt, rt_sp), arm64_x_reg(rn, 1), arm64_reg(option & 1, rm, rm_sp)); if (scale == 0)