From patchwork Fri Nov 4 10:54:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 15471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp319091wru; Fri, 4 Nov 2022 03:56:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6AggFPry11dPVnAQmpSNRtSS0cE71aLb66hzjt3pYOXgvGabtMArnP8FNGdWT8ehxeUlA8 X-Received: by 2002:a17:907:2bd2:b0:7ad:9ada:a6ca with SMTP id gv18-20020a1709072bd200b007ad9adaa6camr32962236ejc.637.1667559374955; Fri, 04 Nov 2022 03:56:14 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e17-20020a17090658d100b00791a67e4c00si4828363ejs.835.2022.11.04.03.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 03:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=X7st5+r9; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15F6F3858419 for ; Fri, 4 Nov 2022 10:55:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15F6F3858419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667559358; bh=4Y3QRxI9Th/gtOvR8Jc+EbNoI1oUUhvs3u/4FbI14MM=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=X7st5+r9ji1qE4GcfxLxWMUmtvmMplQXtpGuoICTXw+o/43sNnT7IVmg5MfQBwiZ3 kmOEE50+6VdGQrxPyxOvcNHP2pfUh2VtCR+zqEGgkiD/D8WQBfHmWpBhkCBmMtdvp4 fBJAXK3lhk7txhOM/fbSGRY3cGjzOzerqkaIRal8= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60053.outbound.protection.outlook.com [40.107.6.53]) by sourceware.org (Postfix) with ESMTPS id BC3713857C58 for ; Fri, 4 Nov 2022 10:54:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC3713857C58 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnekcqCACeyEV1inoy7bIKIYfWNS+I72KEy13QqGqLE4O3NPRoJiN3aVXoNbCmE/85KEb2SO+GOvD3ESBoCFLOwkT/1Jxs2DaKPm0y6KC5ZR3KQW9rAIed+62Aape5ECHMqSBrkj9znnRk/2USNwydQ+IuMpL/i11ux99ynFr1/YTHMEzehQoHnfLRpwOIVgTM0/PIVDvcN1MPLAxKXf5/UuNWv+/PJwFEtK/2az10Xtk9k0WFaMZO2MU+kBLrX49P5yFdtDgt0mwMex176Sx3wQvy59pRgGfd2XzrPVeGSBmfsS0woi7cP9ESYyXS4KGa78Ztn/ijODUOs+gfOxHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=4Y3QRxI9Th/gtOvR8Jc+EbNoI1oUUhvs3u/4FbI14MM=; b=N6SXpIx+BiLCuUyFHoIrHALvey9johnCKT2WV6Bhfi9wr6g+40xQUnPofnl3Qtt5RD5OfU2QmT7gvy5zuRNeuKZW0ANzQvMqLXjF/OR3igKc1YGPiXoRSrN+l9UFj9l8zFqE5mQDluR5C3xt4Tpbiv7ctmCAb9YK3lsBxWwx9j2TMCOcDRgReOVV8UfJnvxejs3pv4UFGSbIQIdheDMoicBK66IPJgmveWUmnKLSxPRYOsD33ZzYvC1Bv50H3ohAU7a1Up2OQ+uXOuzKGLNjo4cfAs/1TbnMKApqFcc+2N50tlzhJ9MLynHvc6D/TwAzcH7MCKDpp3S6dLgI3ZdKVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AS8PR04MB8881.eurprd04.prod.outlook.com (2603:10a6:20b:42c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20; Fri, 4 Nov 2022 10:54:32 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5791.022; Fri, 4 Nov 2022 10:54:32 +0000 Message-ID: <2baf6a9d-c1bf-660d-bbca-99b1604f5478@suse.com> Date: Fri, 4 Nov 2022 11:54:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: [PATCH v6 7/7] x86: further re-work insn/suffix recognition to also cover MOVSX Content-Language: en-US To: Binutils References: <6d71dc80-91c8-7bc8-c57f-4f771ca59fab@suse.com> In-Reply-To: <6d71dc80-91c8-7bc8-c57f-4f771ca59fab@suse.com> X-ClientProxiedBy: AM6PR0202CA0068.eurprd02.prod.outlook.com (2603:10a6:20b:3a::45) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB8881:EE_ X-MS-Office365-Filtering-Correlation-Id: 02fcd7ff-509b-4c3c-8591-08dabe52f423 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TSA5K18C/QwLpZUNZB610gIAFtHPU/8JAlRYQsI3ddg7njXlHZiDS0ESlfQfDtsXETQJfem+e2M02PUbphHOAShTmLIA8a0i/a84mqwFd2dMYvZANsSUZWDJQseEBUBv4z9Snlcd6fa5WY+gJTD8mPNO92FiXBe+MWrD60YOpL6flYEPqf+1m37V4wDUjR3evh4NSkCnrnnCt6OhRbgMyA3SiA4pIHbL396cTd7+zkEN5z4/fLJW4JiDyHEbOV2QZHj+1CCf6rlqOz5GJ7/uNCRaLGVEO1OS0AHKOusWuRJ9IaEuyc7QY5BCjaPjCivkB72ysW3Xjss0vHN/teStPxH4DuF6MLrtmsBAmNwiUcoqStBOxyX5+OAI6NabzYW8GhFK7LSDnT0CLoD+7860POY4+cdFQVJ4J2Xr8svplRHT/nTtbaziTA405pJesO9qqKSa1GChaG2Wyz9UEYNsp/mhmXJ7jOFFf7bgANxBM0XSMRVTpb2HN7sIk1oMH4PDjHEf9UcZDiVJUhR46FrYZJdAY2I7WOuPKUifTzvRcZMM7NHrOEwUuvHw0/sPywRaX84Kdgjc6peMjXqShpASHEORGxwcwDO5TZr+uzODLIXxn3tuZwPiYUX0Cy90Nw/eYnBqCUBmUzKOewfKOi6mtdAGPvLnmdtvq9ggu7SG/HE5B6b1LsYlmXxXsujaxaU7ZrBXY4J6yu+1IzJeKzRdDdEypmNsJvFH4F3Ad8s25KfR3WZPieh6QWgaG3eqf9SH+VOYFciABPB2qV3V0e2TKWmm8CRrM91pzlHJfpSYMjQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(316002)(8676002)(6916009)(30864003)(86362001)(5660300002)(2906002)(38100700002)(31696002)(66476007)(66946007)(186003)(66556008)(2616005)(4326008)(36756003)(8936002)(41300700001)(66899015)(6486002)(31686004)(6512007)(26005)(6506007)(478600001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?aYv0lRgFqhSzpEXsQDyaOwtgT6ah?= =?utf-8?q?bxyUxrVQJ5DU+WucSSdug//ZUVvnToqpd6Ag+XEmuC+dgy8tYZP1CpX8IAYi84Xb7?= =?utf-8?q?+j/PQ24CUBHf6aOp1ZmxLiY8weRzDM6qB8FqRqJj/lyLwLRZhdrMXy2r/1ytfo9V3?= =?utf-8?q?iot3BBgC6aa8x6HNCalolTP8VxNvaUoU8UTop/5t28SAJHOBWHQamyf/Vr4nNd13U?= =?utf-8?q?aoPb67ueGe9QvXeH5AI22f/dPaaI0FlskOpIoaEIuoovxQ1u+Wy4nchiiQRZEDgLp?= =?utf-8?q?IP4Lg13ZhjDh6rt9OsbIM4dKMzfap4pHuQJ/MjuRAf2n2asjBv2GgRM9/ZtmPdWpI?= =?utf-8?q?lLZ3yclk6y2JSxHG7/XOXmVGLDqyUxcRBrro3DKSlIrRWlJM7gWsE02Rm7k/AURq5?= =?utf-8?q?rfoQVZM3rbZpzqZh0aN698knl8o96xTh1fEukzGOuMS/5ilseKc3iNcucHPiPl5oX?= =?utf-8?q?yc5mNjKtvarOco87gOlJ3+69loxejGbJ5iiojMzdzoHPYxAPgManX+GZyCg+L1omp?= =?utf-8?q?rzobZ8nHIgUSUQKtFuvFisFNviXxyLmR7Gbob3Ae7CfbDLXYVxSEHBeJ3gzi+GDGt?= =?utf-8?q?7dNd8GAd6VioTmUajR0R0ySs2YaQvCWHem6uonKEqsras6ME8CSK/WqXmxL6FxSMP?= =?utf-8?q?HkN6n0PGDTpQ8KhWrk+qWHHkrf3F3UsW/cecCiW0v4zf19DxNpZVi5Rb3JXcbEpNQ?= =?utf-8?q?OTo/G9wT/zUqcCK7uRIixXQVdHnX+DsTMX3llH8z9BoHlY+20XnVA8ZdNah4hsNLj?= =?utf-8?q?6XcQ/f+dnDNtAhoBP2+txXOYNGn6oJnQiY1asssgZhRHAoBZyck+e+DXYPnvERQHE?= =?utf-8?q?LiQODBiuOCyVmA/+RnJ6YAw+vRh6Qn/1uiM+9YaeksGzzDhwz9mb8rdkntUOiG8S/?= =?utf-8?q?f5GxMmCAAe9zm2Dej8w88229LlOajnuFN4UNrpGw7AMNdTSHuCAkmD821t9ZjdhSJ?= =?utf-8?q?rUNAr6FjLDx7aC8j/+6CEyv65PpXp5tb5xsI4jNsuOosQCkSjO3M6hWUGxQEevjPO?= =?utf-8?q?GHwbKwp8ouNerN+LAy+nY4sKSYI3ErdfRGUSBAaz3ZIBdcE44aNB3ffJWxYsWRXX6?= =?utf-8?q?dIHG7bX2iCEkzAlQaOq7kQR16z8r2csfVTO7clIWBp9ksqhIPfBt/VI4J64xqv2LG?= =?utf-8?q?jfTUi941iGlSohbjpDlchXjfGOlOxfTZ0q3QIKY6ZzrDjeaVIKuXA3cZyOp5eQhc1?= =?utf-8?q?bBU006XXYRxyqQltSuOVdgD7cncTM/feK4tlC4uZSsB+uhYZbW6RqvboB8OBYBLxm?= =?utf-8?q?r5mAGsWg0p85JkXmBRzMgvRZNmkz+toPie+PPg8LrNT8Ydj0DF7TAEBmzGCM9C//b?= =?utf-8?q?ViREdmPSX4PpHGq9EPfXZiKzwTUdgXhDUjWNhvSIr7Bhe+AUXatk2Id70DDodkCh7?= =?utf-8?q?B5ZvRavYsV0TJJxQ9FkXnGDYxlwznfx649W1mBCW0najcLWzOghjRTZr3RlSWw1Za?= =?utf-8?q?qvanxzpUylYRoaG2ooyipS+GfEY6aey/7+XlM8EEt9Ccni4GQ0rV9qsQobqwSoz/J?= =?utf-8?q?Dz+QuiMNffxs?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02fcd7ff-509b-4c3c-8591-08dabe52f423 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 10:54:32.0785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gTMysYzzjyeLiEwFk0u23t2c52nw/a8HnTqO+H+onVBZi6gyLgtBipD5NsHX7YEIGXdGTp8jht48tKpiBV6AoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8881 X-Spam-Status: No, score=-3029.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748562739481970023?= X-GMAIL-MSGID: =?utf-8?q?1748562739481970023?= PR gas/29524 Having templates with a suffix explicitly present has always been quirky. After prior adjustment all that's left to also eliminate the anomaly from move-with-sign-extend is to consolidate the insn templates (and extend testsuite coverage) and to make may_need_pass2() cope. --- v6: Re-base over dropping of Pass2 attribute. v5: Split off from earlier patch, merged with prior patch dealing with just x86-64's MOVSL. --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4846,7 +4846,11 @@ static INLINE bool may_need_pass2 (const { return t->opcode_modifier.sse2avx /* Note that all SSE2AVX templates have at least one operand. */ - && t->operand_types[t->operands - 1].bitfield.class == RegSIMD; + ? t->operand_types[t->operands - 1].bitfield.class == RegSIMD + : (t->opcode_modifier.opcodespace == SPACE_0F + && (t->base_opcode | 1) == 0xbf) + || (t->opcode_modifier.opcodespace == SPACE_BASE + && t->base_opcode == 0x63); } /* This is the guts of the machine-dependent assembler. LINE points to a --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -73,6 +73,7 @@ if [gas_32_check] then { run_dump_test "amd" run_dump_test "katmai" run_dump_test "jump" + run_dump_test "movs32" run_dump_test "movz32" run_dump_test "relax-1" run_dump_test "relax-2" @@ -815,6 +816,7 @@ if [gas_64_check] then { run_dump_test "x86-64-segovr" run_list_test "x86-64-inval-seg" "-al" run_dump_test "x86-64-branch" + run_dump_test "movs64" run_dump_test "movz64" run_dump_test "x86-64-relax-1" run_dump_test "svme64" --- /dev/null +++ b/gas/testsuite/gas/i386/movs.s @@ -0,0 +1,39 @@ + .text +movs: + movsb %al,%ax + movsb (%eax),%ax + movsb %al,%eax + movsb (%eax),%eax +.ifdef x86_64 + movsb %al,%rax + movsb (%rax),%rax +.endif + + movsbw %al,%ax + movsbw (%eax),%ax + movsbl %al,%eax + movsbl (%eax),%eax +.ifdef x86_64 + movsbq %al,%rax + movsbq (%rax),%rax +.endif + + movsw %ax,%eax + movsw (%eax),%eax +.ifdef x86_64 + movsw %ax,%rax + movsw (%rax),%rax +.endif + + movswl %ax,%eax + movswl (%eax),%eax +.ifdef x86_64 + movswq %ax,%rax + movswq (%rax),%rax + + movsl %eax,%rax + movsl (%rax),%rax + + movslq %eax,%rax + movslq (%rax),%rax +.endif --- /dev/null +++ b/gas/testsuite/gas/i386/movs32.d @@ -0,0 +1,22 @@ +#objdump: -dw +#source: movs.s +#name: x86 mov with sign-extend (32-bit object) + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 66 0f be c0 * movsbw %al,%ax +[ ]*[a-f0-9]+: 66 0f be 00 * movsbw \(%eax\),%ax +[ ]*[a-f0-9]+: 0f be c0 * movsbl %al,%eax +[ ]*[a-f0-9]+: 0f be 00 * movsbl \(%eax\),%eax +[ ]*[a-f0-9]+: 66 0f be c0 * movsbw %al,%ax +[ ]*[a-f0-9]+: 66 0f be 00 * movsbw \(%eax\),%ax +[ ]*[a-f0-9]+: 0f be c0 * movsbl %al,%eax +[ ]*[a-f0-9]+: 0f be 00 * movsbl \(%eax\),%eax +[ ]*[a-f0-9]+: 0f bf c0 * movswl %ax,%eax +[ ]*[a-f0-9]+: 0f bf 00 * movswl \(%eax\),%eax +[ ]*[a-f0-9]+: 0f bf c0 * movswl %ax,%eax +[ ]*[a-f0-9]+: 0f bf 00 * movswl \(%eax\),%eax +#pass --- /dev/null +++ b/gas/testsuite/gas/i386/movs64.d @@ -0,0 +1,30 @@ +#objdump: -dw +#source: movs.s +#name: x86 mov with sign-extend (64-bit object) + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 66 0f be c0 * movsbw %al,%ax +[ ]*[a-f0-9]+: 67 66 0f be 00 * movsbw \(%eax\),%ax +[ ]*[a-f0-9]+: 0f be c0 * movsbl %al,%eax +[ ]*[a-f0-9]+: 67 0f be 00 * movsbl \(%eax\),%eax +[ ]*[a-f0-9]+: 48 0f be c0 * movsbq %al,%rax +[ ]*[a-f0-9]+: 48 0f be 00 * movsbq \(%rax\),%rax +[ ]*[a-f0-9]+: 66 0f be c0 * movsbw %al,%ax +[ ]*[a-f0-9]+: 67 66 0f be 00 * movsbw \(%eax\),%ax +[ ]*[a-f0-9]+: 0f be c0 * movsbl %al,%eax +[ ]*[a-f0-9]+: 67 0f be 00 * movsbl \(%eax\),%eax +[ ]*[a-f0-9]+: 48 0f be c0 * movsbq %al,%rax +[ ]*[a-f0-9]+: 48 0f be 00 * movsbq \(%rax\),%rax +[ ]*[a-f0-9]+: 0f bf c0 * movswl %ax,%eax +[ ]*[a-f0-9]+: 67 0f bf 00 * movswl \(%eax\),%eax +[ ]*[a-f0-9]+: 48 0f bf c0 * movswq %ax,%rax +[ ]*[a-f0-9]+: 48 0f bf 00 * movswq \(%rax\),%rax +[ ]*[a-f0-9]+: 0f bf c0 * movswl %ax,%eax +[ ]*[a-f0-9]+: 67 0f bf 00 * movswl \(%eax\),%eax +[ ]*[a-f0-9]+: 48 0f bf c0 * movswq %ax,%rax +[ ]*[a-f0-9]+: 48 0f bf 00 * movswq \(%rax\),%rax +#pass --- a/gas/testsuite/gas/i386/movx16.l +++ b/gas/testsuite/gas/i386/movx16.l @@ -41,11 +41,11 @@ [ ]*[1-9][0-9]*[ ]+movsb %ax, %cl [ ]*[1-9][0-9]*[ ]+movsb %eax, %cl [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %cx +[ ]*[1-9][0-9]* \?\?\?\? 0FBEC8[ ]+movsb %al, %cx [ ]*[1-9][0-9]*[ ]+movsb %ax, %cx [ ]*[1-9][0-9]*[ ]+movsb %eax, %cx [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 660FBEC8[ ]+movsb %al, %ecx [ ]*[1-9][0-9]*[ ]+movsb %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsb %eax, %ecx [ ]*[1-9][0-9]*[ ]* @@ -82,7 +82,7 @@ [ ]*[1-9][0-9]*[ ]+movsw %eax, %cx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movsw %al, %ecx -[ ]*[1-9][0-9]*[ ]+movsw %ax, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 660FBFC8[ ]+movsw %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsw %eax, %ecx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movswl %al, %cl --- a/gas/testsuite/gas/i386/movx32.l +++ b/gas/testsuite/gas/i386/movx32.l @@ -41,11 +41,11 @@ [ ]*[1-9][0-9]*[ ]+movsb %ax, %cl [ ]*[1-9][0-9]*[ ]+movsb %eax, %cl [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %cx +[ ]*[1-9][0-9]* \?\?\?\? 660FBEC8[ ]+movsb %al, %cx [ ]*[1-9][0-9]*[ ]+movsb %ax, %cx [ ]*[1-9][0-9]*[ ]+movsb %eax, %cx [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 0FBEC8[ ]+movsb %al, %ecx [ ]*[1-9][0-9]*[ ]+movsb %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsb %eax, %ecx [ ]*[1-9][0-9]*[ ]* @@ -82,7 +82,7 @@ [ ]*[1-9][0-9]*[ ]+movsw %eax, %cx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movsw %al, %ecx -[ ]*[1-9][0-9]*[ ]+movsw %ax, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 0FBFC8[ ]+movsw %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsw %eax, %ecx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movswl %al, %cl --- a/gas/testsuite/gas/i386/movx64.l +++ b/gas/testsuite/gas/i386/movx64.l @@ -106,17 +106,17 @@ [ ]*[1-9][0-9]*[ ]+movsb %eax, %cl [ ]*[1-9][0-9]*[ ]+movsb %rax, %cl [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %cx +[ ]*[1-9][0-9]* \?\?\?\? 660FBEC8[ ]+movsb %al, %cx [ ]*[1-9][0-9]*[ ]+movsb %ax, %cx [ ]*[1-9][0-9]*[ ]+movsb %eax, %cx [ ]*[1-9][0-9]*[ ]+movsb %rax, %cx [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 0FBEC8[ ]+movsb %al, %ecx [ ]*[1-9][0-9]*[ ]+movsb %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsb %eax, %ecx [ ]*[1-9][0-9]*[ ]+movsb %rax, %ecx [ ]*[1-9][0-9]*[ ]* -[ ]*[1-9][0-9]*[ ]+movsb %al, %rcx +[ ]*[1-9][0-9]* \?\?\?\? 480FBEC8[ ]+movsb %al, %rcx [ ]*[1-9][0-9]*[ ]+movsb %ax, %rcx [ ]*[1-9][0-9]*[ ]+movsb %eax, %rcx [ ]*[1-9][0-9]*[ ]+movsb %rax, %rcx @@ -192,12 +192,12 @@ [ ]*[1-9][0-9]*[ ]+movsw %rax, %cx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movsw %al, %ecx -[ ]*[1-9][0-9]*[ ]+movsw %ax, %ecx +[ ]*[1-9][0-9]* \?\?\?\? 0FBFC8[ ]+movsw %ax, %ecx [ ]*[1-9][0-9]*[ ]+movsw %eax, %ecx [ ]*[1-9][0-9]*[ ]+movsw %rax, %ecx [ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movsw %al, %rcx -[ ]*[1-9][0-9]*[ ]+movsw %ax, %rcx +[ ]*[1-9][0-9]* \?\?\?\? 480FBFC8[ ]+movsw %ax, %rcx [ ]*[1-9][0-9]*[ ]+movsw %eax, %rcx [ ]*[1-9][0-9]*[ ]+movsw %rax, %rcx [ ]*[1-9][0-9]*[ ]* @@ -241,6 +241,46 @@ [ ]*[1-9][0-9]*[ ]+movswq %eax, %rcx [ ]*[1-9][0-9]*[ ]+movswq %rax, %rcx [ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movsl %al, %cl +[ ]*[1-9][0-9]*[ ]+movsl %ax, %cl +[ ]*[1-9][0-9]*[ ]+movsl %eax, %cl +[ ]*[1-9][0-9]*[ ]+movsl %rax, %cl +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movsl %al, %cx +[ ]*[1-9][0-9]*[ ]+movsl %ax, %cx +[ ]*[1-9][0-9]*[ ]+movsl %eax, %cx +[ ]*[1-9][0-9]*[ ]+movsl %rax, %cx +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movsl %al, %ecx +[ ]*[1-9][0-9]*[ ]+movsl %ax, %ecx +[ ]*[1-9][0-9]*[ ]+movsl %eax, %ecx +[ ]*[1-9][0-9]*[ ]+movsl %rax, %ecx +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movsl %al, %rcx +[ ]*[1-9][0-9]*[ ]+movsl %ax, %rcx +[ ]*[1-9][0-9]* \?\?\?\? 4863C8[ ]+movsl %eax, %rcx +[ ]*[1-9][0-9]*[ ]+movsl %rax, %rcx +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movslq %al, %cl +[ ]*[1-9][0-9]*[ ]+movslq %ax, %cl +[ ]*[1-9][0-9]*[ ]+movslq %eax, %cl +[ ]*[1-9][0-9]*[ ]+movslq %rax, %cl +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movslq %al, %cx +[ ]*[1-9][0-9]*[ ]+movslq %ax, %cx +[ ]*[1-9][0-9]*[ ]+movslq %eax, %cx +[ ]*[1-9][0-9]*[ ]+movslq %rax, %cx +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movslq %al, %ecx +[ ]*[1-9][0-9]*[ ]+movslq %ax, %ecx +[ ]*[1-9][0-9]*[ ]+movslq %eax, %ecx +[ ]*[1-9][0-9]*[ ]+movslq %rax, %ecx +[ ]*[1-9][0-9]*[ ]* +[ ]*[1-9][0-9]*[ ]+movslq %al, %rcx +[ ]*[1-9][0-9]*[ ]+movslq %ax, %rcx +[ ]*[1-9][0-9]* \?\?\?\? 4863C8[ ]+movslq %eax, %rcx +[ ]*[1-9][0-9]*[ ]+movslq %rax, %rcx +[ ]*[1-9][0-9]*[ ]* [ ]*[1-9][0-9]*[ ]+movzx: [ ]*[1-9][0-9]*[ ]+movzx %al, %cl [ ]*[1-9][0-9]*[ ]+movzx %ax, %cl --- a/gas/testsuite/gas/i386/movx64.s +++ b/gas/testsuite/gas/i386/movx64.s @@ -241,6 +241,46 @@ movsx: movswq %eax, %rcx movswq %rax, %rcx + movsl %al, %cl + movsl %ax, %cl + movsl %eax, %cl + movsl %rax, %cl + + movsl %al, %cx + movsl %ax, %cx + movsl %eax, %cx + movsl %rax, %cx + + movsl %al, %ecx + movsl %ax, %ecx + movsl %eax, %ecx + movsl %rax, %ecx + + movsl %al, %rcx + movsl %ax, %rcx + movsl %eax, %rcx + movsl %rax, %rcx + + movslq %al, %cl + movslq %ax, %cl + movslq %eax, %cl + movslq %rax, %cl + + movslq %al, %cx + movslq %ax, %cx + movslq %eax, %cx + movslq %rax, %cx + + movslq %al, %ecx + movslq %ax, %ecx + movslq %eax, %ecx + movslq %rax, %ecx + + movslq %al, %rcx + movslq %ax, %rcx + movslq %eax, %rcx + movslq %rax, %rcx + movzx: movzx %al, %cl movzx %ax, %cl --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -162,14 +162,9 @@ mov, 0xf24, None, Cpu386|CpuNo64, D|RegM movbe, 0x0f38f0, None, CpuMovbe, D|Modrm|No_bSuf|No_sSuf|No_ldSuf, { Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } // Move with sign extend. -// "movsbl" & "movsbw" must not be unified into "movsb" to avoid -// conflict with the "movs" string move instruction. -movsbl, 0xfbe, None, Cpu386, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg8|Byte|Unspecified|BaseIndex, Reg32 } -movsbw, 0xfbe, None, Cpu386, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg8|Byte|Unspecified|BaseIndex, Reg16 } -movswl, 0xfbf, None, Cpu386, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg16|Word|Unspecified|BaseIndex, Reg32 } -movsbq, 0xfbe, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Size64, { Reg8|Byte|Unspecified|BaseIndex, Reg64 } -movswq, 0xfbf, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Size64, { Reg16|Word|Unspecified|BaseIndex, Reg64 } -movslq, 0x63, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|Size64, { Reg32|Dword|Unspecified|BaseIndex, Reg64 } +movsb, 0xfbe, None, Cpu386, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +movsw, 0xfbf, None, Cpu386, Modrm|No_bSuf|No_wSuf|No_sSuf|No_ldSuf, { Reg16|Unspecified|BaseIndex, Reg32|Reg64 } +movsl, 0x63, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_ldSuf, { Reg32|Unspecified|BaseIndex, Reg64 } movsx, 0xfbe, None, Cpu386, W|Modrm|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg8|Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } movsx, 0x63, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32|Unspecified|BaseIndex, Reg32|Reg64 } movsxd, 0x63, None, Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32|Unspecified|BaseIndex, Reg32|Reg64 }