From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 4DD7D3858D20 for ; Sat, 3 Dec 2022 04:13:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DD7D3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62c.google.com with SMTP id b21so6356941plc.9 for ; Fri, 02 Dec 2022 20:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1fgehwB2/cut+3c2xKTVDxht0XnA0h+xY51X7+WUiD4=; b=WKCVvoBCuaN50I+FcP4CQapePaxw6Rgsu7kb6UTLvqdYPNZm4S/9i9B+7s6OXbZD0O ldNBvhMZMruG01t7iciBUqENsV909xdS8Rru7Lgf6QKtPQqQTo7szbMJ0FxUSBO/qpMU gebDlwmFHCqrH8XkCuGeS78i7xMNGkPfjIat1yrUjSu8zdXk0obhCYtUu6bPaWpOiUOA fa7NJrI6+2CU+6+59fQNkOeUcvdDeQ0oX7pCuKHYMxRl3g9Ot7I5C+kWh+UDUhpZOKaO RMvVfyjwRpBXxVrR7mUjb3hkypjzs0dI19xbApf8m8AZeKfFuU3Ys8ISLkz6Dd1tFN1F YU3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1fgehwB2/cut+3c2xKTVDxht0XnA0h+xY51X7+WUiD4=; b=fhrNkQaqpL8X9+ZVfRHLK6baFDTViREE+sH3dXRX83nzo5iJK+6988QOgb7Oe4lMzq 8IXvQ4PjNeIdi8WDcgf3xmLw6WeO45JAarJb2n9mhv+zsvjLDgERj5EsD6IV4rnUp7pS 1hXKPtnSOVEvmr9e1MxVpkuTbHxhH+cdOS+iO73MFRaVRzuSMseQNFMOMnvDykKy0wpT cVa2hjjF1MAMUmAfvYIffd0toak0m3x0zg1pYBYWEGRlUXS4yPGlkRlroIsoPtGKywN4 MLc9xreyPaog8jNhDNQCnFMkiewC6xmLtqo1/kNGGk5rbmG/G4njzfUQTiNVePiAfLZ0 7EBw== X-Gm-Message-State: ANoB5pkw6Jh+6Bys1vk/Fwmo3t0vMG6OkM71Z/arLRryaqZNTUIy6Xs2 EFZUChYjPKAdFlf6h3ukiPJ7D/3WeW4= X-Google-Smtp-Source: AA0mqf4CWV1DsVT5uCYK2ypFCiR73Du2d2cTb8u3AgQLTlwz/uNEaDI49XqQkLswq9UTYdscYl772Q== X-Received: by 2002:a05:6a20:9c8f:b0:a2:17a6:3e86 with SMTP id mj15-20020a056a209c8f00b000a217a63e86mr157498pzb.55.1670040789536; Fri, 02 Dec 2022 20:13:09 -0800 (PST) Received: from gnu-tgl-2.localdomain ([172.56.30.207]) by smtp.gmail.com with ESMTPSA id t10-20020a63eb0a000000b004702eca61fcsm4798233pgh.36.2022.12.02.20.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 20:13:09 -0800 (PST) Received: from gnu-tgl-2.. (localhost [IPv6:::1]) by gnu-tgl-2.localdomain (Postfix) with ESMTP id 857FA300B25; Fri, 2 Dec 2022 20:13:07 -0800 (PST) From: "H.J. Lu" To: binutils@sourceware.org Cc: Jan Beulich Subject: [PATCH] x86: Allow 16-bit register source for LAR and LSL Date: Fri, 2 Dec 2022 20:13:07 -0800 Message-Id: <20221203041307.34407-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3022.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SCC_10_SHORT_WORD_LINES,SCC_20_SHORT_WORD_LINES,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Since LAR and LSL only access 16 bits of the source operand, regardless of operand size, allow 16-bit register source for LAR and LSL, and always disassemble LAR and LSL with 16-bit source operand. gas/ PR gas/29844 * testsuite/gas/i386/i386.s: Add tests for LAR and LSL. * testsuite/gas/i386/x86_64.s: Likewise. * testsuite/gas/i386/intelbad.s: Remove "lar/lsl eax, ax". * testsuite/gas/i386/i386-intel.d: Updated. * testsuite/gas/i386/i386.d: Likewise. * testsuite/gas/i386/intel-intel.d: Likewise. * testsuite/gas/i386/intel.d: Likewise. * testsuite/gas/i386/intelbad.l: Likewise. * testsuite/gas/i386/x86_64-intel.d: Likewise. * testsuite/gas/i386/x86_64.d: Likewise. opcodes/ PR gas/29844 * i386-dis.c (MOD_0F02): Removed. (MOD_0F03): Likewise. (dis386_twobyte): Restore larS and lslS. (mod_table): Remove MOD_0F02 and MOD_0F03. * i386-opc.tbl: Allow 16-bit register source for LAR and LSL. * i386-tbl.h: Regenerated. --- gas/testsuite/gas/i386/i386-intel.d | 20 +++++++++++++++ gas/testsuite/gas/i386/i386.d | 20 +++++++++++++++ gas/testsuite/gas/i386/i386.s | 24 ++++++++++++++++++ gas/testsuite/gas/i386/intel-intel.d | 4 +-- gas/testsuite/gas/i386/intel.d | 4 +-- gas/testsuite/gas/i386/intelbad.l | 2 -- gas/testsuite/gas/i386/intelbad.s | 4 +-- gas/testsuite/gas/i386/x86_64-intel.d | 32 ++++++++++++++++++++++++ gas/testsuite/gas/i386/x86_64.d | 32 ++++++++++++++++++++++++ gas/testsuite/gas/i386/x86_64.s | 36 +++++++++++++++++++++++++++ opcodes/i386-dis.c | 16 ++---------- opcodes/i386-opc.tbl | 4 +-- opcodes/i386-tbl.h | 4 +-- 13 files changed, 176 insertions(+), 26 deletions(-) diff --git a/gas/testsuite/gas/i386/i386-intel.d b/gas/testsuite/gas/i386/i386-intel.d index 28025ca237a..42f86692d60 100644 --- a/gas/testsuite/gas/i386/i386-intel.d +++ b/gas/testsuite/gas/i386/i386-intel.d @@ -62,4 +62,24 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f b6 00 movzx eax,BYTE PTR \[eax\] [ ]*[a-f0-9]+: 0f b7 00 movzx eax,WORD PTR \[eax\] [ ]*[a-f0-9]+: 0f c3 00 movnti DWORD PTR \[eax\],eax +[ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[edx\] +[ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[edx\] #pass diff --git a/gas/testsuite/gas/i386/i386.d b/gas/testsuite/gas/i386/i386.d index 6863bb51618..b5a5565adf6 100644 --- a/gas/testsuite/gas/i386/i386.d +++ b/gas/testsuite/gas/i386/i386.d @@ -61,4 +61,24 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f b6 00 movzbl \(%eax\),%eax [ ]*[a-f0-9]+: 0f b7 00 movzwl \(%eax\),%eax [ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%eax\) +[ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 66 0f 02 12 lar \(%edx\),%dx +[ ]*[a-f0-9]+: 0f 02 12 lar \(%edx\),%edx +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%edx\),%dx +[ ]*[a-f0-9]+: 0f 03 12 lsl \(%edx\),%edx +[ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 66 0f 02 12 lar \(%edx\),%dx +[ ]*[a-f0-9]+: 0f 02 12 lar \(%edx\),%edx +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%edx\),%dx +[ ]*[a-f0-9]+: 0f 03 12 lsl \(%edx\),%edx #pass diff --git a/gas/testsuite/gas/i386/i386.s b/gas/testsuite/gas/i386/i386.s index 97bb1a4e3b4..a42eafb8958 100644 --- a/gas/testsuite/gas/i386/i386.s +++ b/gas/testsuite/gas/i386/i386.s @@ -66,3 +66,27 @@ movzx eax, byte ptr [eax] movzx eax, word ptr [eax] movnti dword ptr [eax], eax + + .att_syntax + lar %dx,%dx + lar %dx,%edx + lar %edx,%edx + lar (%edx),%dx + lar (%edx),%edx + lsl %dx,%dx + lsl %dx,%edx + lsl %edx,%edx + lsl (%edx),%dx + lsl (%edx),%edx + + .intel_syntax noprefix + lar dx,dx + lar edx,dx + lar edx,edx + lar dx,WORD PTR [edx] + lar edx,WORD PTR [edx] + lsl dx,dx + lsl edx,dx + lsl edx,edx + lsl dx,WORD PTR [edx] + lsl edx,WORD PTR [edx] diff --git a/gas/testsuite/gas/i386/intel-intel.d b/gas/testsuite/gas/i386/intel-intel.d index 73fbdf89c1c..609781f3f78 100644 --- a/gas/testsuite/gas/i386/intel-intel.d +++ b/gas/testsuite/gas/i386/intel-intel.d @@ -699,11 +699,11 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 4b 90 90 90 90 90 cmovnp edx,DWORD PTR \[eax-0x6f6f6f70\] [ ]*[a-f0-9]+: 66 0f 4a 90 90 90 90 90 cmovp dx,WORD PTR \[eax-0x6f6f6f70\] [ ]*[a-f0-9]+: 66 0f 4b 90 90 90 90 90 cmovnp dx,WORD PTR \[eax-0x6f6f6f70\] -[ ]*[a-f0-9]+: 0f 02 c0 + lar eax,eax +[ ]*[a-f0-9]+: 0f 02 c0 + lar eax,ax [ ]*[a-f0-9]+: 66 0f 02 c0 + lar ax,ax [ ]*[a-f0-9]+: 0f 02 00 + lar eax,WORD PTR \[eax\] [ ]*[a-f0-9]+: 66 0f 02 00 + lar ax,WORD PTR \[eax\] -[ ]*[a-f0-9]+: 0f 03 c0 + lsl eax,eax +[ ]*[a-f0-9]+: 0f 03 c0 + lsl eax,ax [ ]*[a-f0-9]+: 66 0f 03 c0 + lsl ax,ax [ ]*[a-f0-9]+: 0f 03 00 + lsl eax,WORD PTR \[eax\] [ ]*[a-f0-9]+: 66 0f 03 00 + lsl ax,WORD PTR \[eax\] diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d index 374f8753396..65e79e6ebde 100644 --- a/gas/testsuite/gas/i386/intel.d +++ b/gas/testsuite/gas/i386/intel.d @@ -698,11 +698,11 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 4b 90 90 90 90 90 cmovnp -0x6f6f6f70\(%eax\),%edx [ ]*[a-f0-9]+: 66 0f 4a 90 90 90 90 90 cmovp -0x6f6f6f70\(%eax\),%dx [ ]*[a-f0-9]+: 66 0f 4b 90 90 90 90 90 cmovnp -0x6f6f6f70\(%eax\),%dx -[ ]*[a-f0-9]+: 0f 02 c0 lar %eax,%eax +[ ]*[a-f0-9]+: 0f 02 c0 lar %ax,%eax [ ]*[a-f0-9]+: 66 0f 02 c0 lar %ax,%ax [ ]*[a-f0-9]+: 0f 02 00 lar \(%eax\),%eax [ ]*[a-f0-9]+: 66 0f 02 00 lar \(%eax\),%ax -[ ]*[a-f0-9]+: 0f 03 c0 lsl %eax,%eax +[ ]*[a-f0-9]+: 0f 03 c0 lsl %ax,%eax [ ]*[a-f0-9]+: 66 0f 03 c0 lsl %ax,%ax [ ]*[a-f0-9]+: 0f 03 00 lsl \(%eax\),%eax [ ]*[a-f0-9]+: 66 0f 03 00 lsl \(%eax\),%ax diff --git a/gas/testsuite/gas/i386/intelbad.l b/gas/testsuite/gas/i386/intelbad.l index 8f6341d150f..4d45dda36f7 100644 --- a/gas/testsuite/gas/i386/intelbad.l +++ b/gas/testsuite/gas/i386/intelbad.l @@ -161,11 +161,9 @@ .*:181: Error: .* .*:183: Error: .* .*:184: Error: .* -.*:186: Error: .* .*:187: Error: .* .*:188: Error: .* .*:189: Error: .* -.*:191: Error: .* .*:192: Error: .* .*:193: Error: .* .*:194: Error: .* diff --git a/gas/testsuite/gas/i386/intelbad.s b/gas/testsuite/gas/i386/intelbad.s index 77375579a47..3a9bcde47fa 100644 --- a/gas/testsuite/gas/i386/intelbad.s +++ b/gas/testsuite/gas/i386/intelbad.s @@ -183,12 +183,12 @@ start: fild far ptr [ebx] fist near ptr [ebx] - lar eax, ax + lar ax, eax lar eax, dword ptr [eax] lar ax, dword ptr [eax] - lsl eax, ax + lsl ax, eax lsl eax, dword ptr [eax] lsl ax, dword ptr [eax] diff --git a/gas/testsuite/gas/i386/x86_64-intel.d b/gas/testsuite/gas/i386/x86_64-intel.d index e40a2e56f9e..b919dc0e851 100644 --- a/gas/testsuite/gas/i386/x86_64-intel.d +++ b/gas/testsuite/gas/i386/x86_64-intel.d @@ -258,4 +258,36 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 48 0f c3 00 movnti QWORD PTR \[rax\],rax [ ]*[a-f0-9]+: 8b 04 25 00 00 00 00 mov eax,DWORD PTR (ds:)?0x0 [ ]*[a-f0-9]+: 48 89 0c 25 00 00 00 00 mov QWORD PTR (ds:)?0x0,rcx +[ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar rdx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar rdx,dx +[ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 48 0f 02 12 lar rdx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl rdx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl rdx,dx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 48 0f 03 12 lsl rdx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar rdx,dx +[ ]*[a-f0-9]+: 0f 02 d2 lar edx,dx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar rdx,dx +[ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 48 0f 02 12 lar rdx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl rdx,dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl edx,dx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl rdx,dx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] +[ ]*[a-f0-9]+: 48 0f 03 12 lsl rdx,WORD PTR \[rdx\] #pass diff --git a/gas/testsuite/gas/i386/x86_64.d b/gas/testsuite/gas/i386/x86_64.d index 73c687350b7..398d2aa4b9e 100644 --- a/gas/testsuite/gas/i386/x86_64.d +++ b/gas/testsuite/gas/i386/x86_64.d @@ -258,4 +258,36 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\) [ ]*[a-f0-9]+: 8b 04 25 00 00 00 00 mov 0x0,%eax [ ]*[a-f0-9]+: 48 89 0c 25 00 00 00 00 mov %rcx,0x0 +[ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar %dx,%rdx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar %dx,%rdx +[ ]*[a-f0-9]+: 66 0f 02 12 lar \(%rdx\),%dx +[ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx +[ ]*[a-f0-9]+: 48 0f 02 12 lar \(%rdx\),%rdx +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl %dx,%rdx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl %dx,%rdx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%rdx\),%dx +[ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx +[ ]*[a-f0-9]+: 48 0f 03 12 lsl \(%rdx\),%rdx +[ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar %dx,%rdx +[ ]*[a-f0-9]+: 0f 02 d2 lar %dx,%edx +[ ]*[a-f0-9]+: 48 0f 02 d2 lar %dx,%rdx +[ ]*[a-f0-9]+: 66 0f 02 12 lar \(%rdx\),%dx +[ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx +[ ]*[a-f0-9]+: 48 0f 02 12 lar \(%rdx\),%rdx +[ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl %dx,%rdx +[ ]*[a-f0-9]+: 0f 03 d2 lsl %dx,%edx +[ ]*[a-f0-9]+: 48 0f 03 d2 lsl %dx,%rdx +[ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%rdx\),%dx +[ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx +[ ]*[a-f0-9]+: 48 0f 03 12 lsl \(%rdx\),%rdx #pass diff --git a/gas/testsuite/gas/i386/x86_64.s b/gas/testsuite/gas/i386/x86_64.s index e050b14be36..7f58e161770 100644 --- a/gas/testsuite/gas/i386/x86_64.s +++ b/gas/testsuite/gas/i386/x86_64.s @@ -310,3 +310,39 @@ movnti qword ptr [rax], rax mov eax, tr1 mov tr0, rcx + + .att_syntax + lar %dx,%dx + lar %dx,%edx + lar %dx,%rdx + lar %edx,%edx + lar %rdx,%rdx + lar (%rdx),%dx + lar (%rdx),%edx + lar (%rdx),%rdx + lsl %dx,%dx + lsl %dx,%edx + lsl %dx,%rdx + lsl %edx,%edx + lsl %rdx,%rdx + lsl (%rdx),%dx + lsl (%rdx),%edx + lsl (%rdx),%rdx + + .intel_syntax noprefix + lar dx,dx + lar edx,dx + lar rdx,dx + lar edx,edx + lar rdx,rdx + lar dx,WORD PTR [rdx] + lar edx,WORD PTR [rdx] + lar rdx,WORD PTR [rdx] + lsl dx,dx + lsl edx,dx + lsl rdx,dx + lsl edx,edx + lsl rdx,rdx + lsl dx,WORD PTR [rdx] + lsl edx,WORD PTR [rdx] + lsl rdx,WORD PTR [rdx] diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index edc2ce96765..e43666af841 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -833,8 +833,6 @@ enum MOD_0F01_REG_3, MOD_0F01_REG_5, MOD_0F01_REG_7, - MOD_0F02, - MOD_0F03, MOD_0F12_PREFIX_0, MOD_0F12_PREFIX_2, MOD_0F13, @@ -2117,8 +2115,8 @@ static const struct dis386 dis386_twobyte[] = { /* 00 */ { REG_TABLE (REG_0F00 ) }, { REG_TABLE (REG_0F01 ) }, - { MOD_TABLE (MOD_0F02) }, - { MOD_TABLE (MOD_0F03) }, + { "larS", { Gv, Ew }, 0 }, + { "lslS", { Gv, Ew }, 0 }, { Bad_Opcode }, { "syscall", { XX }, 0 }, { "clts", { XX }, 0 }, @@ -8199,16 +8197,6 @@ static const struct dis386 mod_table[][2] = { { "invlpg", { Mb }, 0 }, { RM_TABLE (RM_0F01_REG_7_MOD_3) }, }, - { - /* MOD_0F02 */ - { "larS", { Gv, Mw }, 0 }, - { "larS", { Gv, Ev }, 0 }, - }, - { - /* MOD_0F03 */ - { "lslS", { Gv, Mw }, 0 }, - { "lslS", { Gv, Ev }, 0 }, - }, { /* MOD_0F12_PREFIX_0 */ { "movlpX", { XM, EXq }, 0 }, diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index 3766f32fd5f..8c13f85708b 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -572,7 +572,7 @@ nop, 0x90, None, 0, NoSuf|RepPrefixOk, {} // Protection control. arpl, 0x63, None, Cpu286|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16, Reg16|Word|Unspecified|BaseIndex } lar, 0xf02, None, Cpu286, Modrm|CheckRegSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } -lar, 0xf02, None, Cpu286, Modrm|No_bSuf|No_sSuf, { Word|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +lar, 0xf02, None, Cpu286, Modrm|No_bSuf|No_sSuf, { Reg16|Word|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } lgdt, 0xf01, 2, Cpu286|CpuNo64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } lgdt, 0xf01, 2, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } lidt, 0xf01, 3, Cpu286|CpuNo64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } @@ -580,7 +580,7 @@ lidt, 0xf01, 3, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Un lldt, 0xf00, 2, Cpu286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Word|Unspecified|BaseIndex } lmsw, 0xf01, 6, Cpu286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Word|Unspecified|BaseIndex } lsl, 0xf03, None, Cpu286, Modrm|CheckRegSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } -lsl, 0xf03, None, Cpu286, Modrm|No_bSuf|No_sSuf, { Word|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +lsl, 0xf03, None, Cpu286, Modrm|No_bSuf|No_sSuf, { Reg16|Word|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ltr, 0xf00, 3, Cpu286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Word|Unspecified|BaseIndex } sgdt, 0xf01, 0, Cpu286|CpuNo64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index e77addf5658..82861459eef 100644 --- a/opcodes/i386-tbl.h +++ b/opcodes/i386-tbl.h @@ -5344,7 +5344,7 @@ const insn_template i386_optab[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, - { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, + { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0 } } } }, @@ -5452,7 +5452,7 @@ const insn_template i386_optab[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, - { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, + { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 } }, { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0 } } } }, -- 2.38.1