From patchwork Tue Sep 29 18:30:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shenoy, Rohan Radhesh" X-Patchwork-Id: 144912 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD94D4BAE7CF for ; Tue, 29 Sep 2026 18:37:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD94D4BAE7CF Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=yrbpKckj X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azlp170120002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c007::2]) by sourceware.org (Postfix) with ESMTPS id 0B5994BB3BAE for ; Tue, 29 Sep 2026 18:32:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B5994BB3BAE Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0B5994BB3BAE Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c007::2 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790706754; cv=pass; b=fTSxpr04O4pK+cbY3fn3PWpdqItXJMYeaBPtkrjF8e/lgFeimIAlLjmVaXdFPoifHJ8shKT3lr6S7nTMUhcqe5BwDM3HtlAUf+jO/AoABNAeQ0+2PJLACBBmMNAXMuZ29s58v47Ik9PfV4aHa6RBjIF56vSsP6zutarrlTmJ5UA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790706754; c=relaxed/simple; bh=cNaJu/+bCMN/A97XCf/S3JxLI1t3SIQxz0FuP2QwLUg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kr2WMB0KRpuUncCuriTDl3GXfIrwe3uuUAPG+hedFwteNbGLpZKTw4ZMwzMcRO+SYb1M/9WU02zDJ8f8568gEjMXBunAn2GP4y7/lfJtjb0iFSadqBWuIKIIHpJ164YrSvDsviqzUTdPFO0Zgm+zs1i/t4O4A0Uis0LlnOuyfIU= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=yrbpKckj DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B5994BB3BAE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QF7KwulFFBUP8JX01sfCOMXbo9i8dB1OIb/O6r6G4CW6lPYtkX01HcLjalhFUOyqw7Uz2HbU9VO9rSdvFXUelnIMIq75KtwZOqpcRpd6HarYwk7hFlKf3B8xBHOlcRORED0rs6ESsGxuOaD8Wzsbtoj7uUo1jxtaPWmW0uStyZj5UC3+OL91gX4CBXMcIVIW7FKRPvzTRR3Jixgo/GLo275XSsZR4+Tf0+F1KX6j8nstq0dk7ZMCb+kH4AMyIDyO7udI/KlgjIugpUzE/76McMD6YwIyjq/Z/VRueYzVAPmEign8SA9rl2w8OVR5SFWo8lhY/GW7IawZyXPI6gw+0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5v9XuzZ12rILaM7ZO8yvgOJ+WEyhJVuI6MShhkqzKyo=; b=eBKzVL+/dSnPLtk9qJEk4K2DqnQQlTs99RXgcnscIWMjA+2MGJJ4g3FqUl20wh1Jv50iRk9DtZ2GXje1egc4YxnLIKK4nd/qbkKB2Ah1XXQY1nhiu0hOSwblBXG/Gh/jBLNE0Ci8+r5Jx1Wc98M6DmOeb+gwLvvMjjMIRzkSE5PKuFQIKrBwUfAXM+WeJCaQ8MFM6OHT3N4Yc+EToB3eZWjn4CIDOkf32BwxZ5s2Y0tp8dH+rt+q/IzBSQefotgJi45tPWNL84aUDEZ+0xJ0E20MotcIVwpM2zhcjXctUnhxmIF8vDu8NT/5oUAOh/azrLTO+qqvPSre8DRz+V3AiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5v9XuzZ12rILaM7ZO8yvgOJ+WEyhJVuI6MShhkqzKyo=; b=yrbpKckjOlODxrVoFi1TztnCDx5IRYiVXPDAbMHTCG/dfkr4Jnv90OOQjzKc93ynit1P5fQHYYuQYzH8leHpKuviBeNSXGLTCo2Mb7GUI77t280BvdP3xypoM5ND8eECUkIqEWQpEItPREGYZmfnP2EWVe8a6IO4zRGFzj3BH58= Received: from PH7P221CA0083.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:328::8) by DS0PR12MB6607.namprd12.prod.outlook.com (2603:10b6:8:d1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.24; Tue, 29 Sep 2026 18:32:21 +0000 Received: from SJ5PEPF00000209.namprd05.prod.outlook.com (2603:10b6:510:328:cafe::73) by PH7P221CA0083.outlook.office365.com (2603:10b6:510:328::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.23 via Frontend Transport; Tue, 29 Sep 2026 18:32:19 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ5PEPF00000209.mail.protection.outlook.com (10.167.244.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.472.14 via Frontend Transport; Tue, 29 Sep 2026 18:32:19 +0000 Received: from aocc-opt-zen4-7.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 29 Sep 2026 13:32:15 -0500 From: Rohan Shenoy To: CC: , , , , Subject: [PATCH v4 2/7] x86: decode EVEX 0F38 4B by length Date: Wed, 30 Sep 2026 00:00:10 +0530 Message-ID: <0ed0b87d09a08fe6f3093838df68d04491c42ce4.1790705096.git.RohanRadhesh.Shenoy@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF00000209:EE_|DS0PR12MB6607:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b4523dc-4fbc-4220-f882-08df1e57feb0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|376014|36860700016|1800799024|82310400026|10067099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: XSY+zFoSJEiAR3pHbnFIcyN3zf9epBAvszyinAt3+LuIPK3pg5L8Lvlac6wmEYIJdyTVo73chb+BT81QhDBj2Pzz+HjAV2JNrxeLGtOUCeVPFKjDS3agenPOTXKlKXmTxFiSCs9R/PiezHCxL+Me6PcPAsrI+rzTPz7OfQvDWdeDx7Yn1ulsBd53s4wyEdeivliFiJ7cc+rDkxVNV5mp9qQGKakaPoHjVYFr83CYgGWio42KIu7jUBPCWz5/XZzZ+FbEolPPw2wCoIHRzdyv5PM7KlFRUBSGF/H4x38qdABhdehwEy0hfEIoSiSZuf6mOkx/vWtYVKwiXrLPuq9JRwcS74M8MNs3S26Vva+FdSFJcL/hVRdC1lvGX37xP5b3mVY2POPhAWXdnnu77TnMUwR9ZGJkOy2txC9KgEvGXb0mG7Zdlm4ZDve8rGcbl2glAq2NewZpMbNpf8I5PguXkCpNp0q8rkL06IIKm76iardSU6eSiyvOOe1REMEUun10LKV+V6w3uuL4v81MMrh02LJNfaG8HfmmLWCJ/0oU7B1f1firxpT2qn6gn4rE2r+cuJBlrgDugrS7pq8yBI78L/MZfR3LxpZecl+Q/BkTLsIZX1DloLnChKaBLx94IFdbg58mM3KOdLDpk7pUrXyp/m4AOcK9rJCzVJPe/6GDwq8my/4DEUlP/QFF/99CrlIA2pVHUrz2umSpACGWUee/zw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(23010399003)(376014)(36860700016)(1800799024)(82310400026)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CLoUonAmpk0YNKl13v7rMbvDROFRDR0Edlo4MaC4qIMQfL9jXYmEo9O6QiAJ9qkO7dJBn2+UIQSKGLNtuq0zmR6w53A61dMIOr948i740b09Tkn72fWr+G7jLEwaMEZtnEja2oQ8WLqBn6BBuIz7e5cjcgH/vGYXfO+meeEjlYnV+1o5gg7En9PT3q4RRNEgZVFF4Kjh/oeY4n02lal5QazSLgaJn1rmvD2LbqNx34MGtjCfLPYV8o+nHARWFvQb/Vp2vn2TgDQn622ok1kt4i8gYwahU6ifg8Qz39RzaP5LXzyHRmT177kXRH07+455AAGSO1cpyPh0wTVK4X91x2hpcVihDR83WjqYxiKOFTRVh2hGFHcEZJdCKonklH1n3xfNQTXSH1MSHwM33/9ZvMZdRI4sVWEeUkhpxi/rXQXK960y+79dblpOFmDU1j0W X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2026 18:32:19.2616 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b4523dc-4fbc-4220-f882-08df1e57feb0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF00000209.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6607 X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LOCAL_AUTHENTICATION_FAIL_SPF, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Existing decode path ignores entries when L'L is non-zero. This is a prerequisite for ACE which needs decoding for non-zero L'L in this path. --- opcodes/i386-dis-evex-len.h | 5 +++++ opcodes/i386-dis-evex-x86-64.h | 5 +++++ opcodes/i386-dis-evex.h | 2 +- opcodes/i386-dis.c | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/opcodes/i386-dis-evex-len.h b/opcodes/i386-dis-evex-len.h index 370710915de..23e9487ec68 100644 --- a/opcodes/i386-dis-evex-len.h +++ b/opcodes/i386-dis-evex-len.h @@ -51,6 +51,11 @@ static const struct dis386 evex_len_table[][3] = { { PREFIX_TABLE (PREFIX_EVEX_0F384A_X86_64_W_0_L_2) }, }, + /* EVEX_LEN_0F384B_X86_64 */ + { + { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F384B_X86_64_L_0) }, + }, + /* EVEX_LEN_0F385A */ { { Bad_Opcode }, diff --git a/opcodes/i386-dis-evex-x86-64.h b/opcodes/i386-dis-evex-x86-64.h index 93acb0ba18d..8f8f5dfcd96 100644 --- a/opcodes/i386-dis-evex-x86-64.h +++ b/opcodes/i386-dis-evex-x86-64.h @@ -3,6 +3,11 @@ { Bad_Opcode }, { VEX_W_TABLE (EVEX_W_0F384A_X86_64) }, }, + /* X86_64_EVEX_0F384B */ + { + { Bad_Opcode }, + { EVEX_LEN_TABLE (EVEX_LEN_0F384B_X86_64) }, + }, /* X86_64_EVEX_0F386D */ { { Bad_Opcode }, diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h index fe515a01932..52bf0d798ac 100644 --- a/opcodes/i386-dis-evex.h +++ b/opcodes/i386-dis-evex.h @@ -377,7 +377,7 @@ static const struct dis386 evex_table[][256] = { { Bad_Opcode }, { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F3849_X86_64_L_0) }, { X86_64_TABLE (X86_64_EVEX_0F384A) }, - { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F384B_X86_64_L_0) }, + { X86_64_TABLE (X86_64_EVEX_0F384B) }, { "vrcp14p%XW", { XM, EXx }, PREFIX_DATA }, { "vrcp14s%XW", { XMScalar, VexScalar, EXdq }, PREFIX_DATA }, { "vrsqrt14p%XW", { XM, EXx }, 0 }, diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index f7ad933fdb9..95dbf96156f 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1404,6 +1404,7 @@ enum X86_64_VEX_MAP7_F8_L_0_W_0_R_0, X86_64_EVEX_0F384A, + X86_64_EVEX_0F384B, X86_64_EVEX_0F386D, X86_64_EVEX_0F3A07, X86_64_EVEX_0F3A77, @@ -1604,6 +1605,7 @@ enum EVEX_LEN_0F381B, EVEX_LEN_0F3836, EVEX_LEN_0F384A_X86_64_W_0, + EVEX_LEN_0F384B_X86_64, EVEX_LEN_0F385A, EVEX_LEN_0F385B, EVEX_LEN_0F386D_X86_64_W_0,