From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72607 invoked by alias); 11 Feb 2020 23:52:09 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 72598 invoked by uid 89); 11 Feb 2020 23:52:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:4Rc_5a5, H*f:sk:4Rc_5a5 X-HELO: mail-ot1-f66.google.com Received: from mail-ot1-f66.google.com (HELO mail-ot1-f66.google.com) (209.85.210.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Feb 2020 23:52:06 +0000 Received: by mail-ot1-f66.google.com with SMTP id i6so102267otr.7 for ; Tue, 11 Feb 2020 15:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EKmu+OH3PMJslKYmor0Y3igb0s40OGZF+JkbsxBI2Rg=; b=sQqQPWlI1FcXk4Ld6ILdnP2/olVpUG+6SJrCv0pI5Z1ns6TXWaeyExUd7MF1sBr0Dv KvpY9pjPUMYQSwolKMeta+kh9KWkMi0qnwgv55r2KTVeP2V14uhdV2DD12frowqdurvF iGF0HLGIxDCccS7za6acnFs2IeI+zKzMm8wSUfx0dpTo5bVtnZ2TOnDTLJpZt0hX+Oqt Q9VzUqqxWz+OeEGMQ5P47MyDoqeJEjNZgZndEGmBUZW8QwLGqrY4ZQkE5MEkeTzcF9O4 aqLQ7+Z/tmH5RakAWkAo2ZfA6FY44xWg55XFEWx8djSbn0rRdVTUDJf/deRSzauL9c0v 1JXw== MIME-Version: 1.0 References: <1e1b8eba-93ff-39ed-460a-a922d12af27e@suse.com> <74b85fa8-3b1a-d673-d26e-7baaadc69ee6@suse.com> <17a5be6c-a904-1405-5be1-cc4987b7d024@suse.com> <891e9e3a-0e39-b3fd-a06a-d89bedaa8ec1@suse.com> <416bb4a2-c02f-7591-7aa1-55874844fc39@suse.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 11 Feb 2020 23:52:00 -0000 Message-ID: Subject: Re: [PATCH] x86: Remove movsx/movzx with memory operand from AT&T syntax To: Jan Beulich Cc: "binutils@sourceware.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00201.txt.bz2 On Tue, Feb 11, 2020 at 3:34 PM H.J. Lu wrote: > > On Tue, Feb 11, 2020 at 12:11 PM H.J. Lu wrote: > > > > On Tue, Feb 11, 2020 at 9:04 AM H.J. Lu wrote: > > > > > > On Tue, Feb 11, 2020 at 8:45 AM Jan Beulich wrote: > > > > > > > > On 11.02.2020 14:07, H.J. Lu wrote: > > > > > On Tue, Feb 11, 2020 at 5:04 AM Jan Beulich wrote: > > > > >> > > > > >> On 11.02.2020 14:01, H.J. Lu wrote: > > > > >>> On Tue, Feb 11, 2020 at 4:58 AM Jan Beulich wrote: > > > > >>>> > > > > >>>> On 11.02.2020 13:19, H.J. Lu wrote: > > > > >>>>> On Tue, Feb 11, 2020 at 3:55 AM Jan Beulich wrote: > > > > >>>>>> > > > > >>>>>> On 11.02.2020 12:42, H.J. Lu wrote: > > > > >>>>>>> On Tue, Feb 11, 2020 at 2:25 AM Jan Beulich wrote: > > > > >>>>>>>> > > > > >>>>>>>> Some encodings are about to gain a warning - move them from test cases > > > > >>>>>>>> not expecting any diagnostics to the new, dedicated ones, to allow > > > > >>>>>>>> better focus on the actual changes in the subsequent patch. > > > > >>>>>>>> > > > > >>>>>>>> The new tests added have some wrong expectations right now, which will > > > > >>>>>>>> be corrected by the next patch. The test is being added here to make > > > > >>>>>>>> more visible which cases actually were wrong (and hence get changed), > > > > >>>>>>>> besides demonstrating that in the vast majority of cases the subsequent > > > > >>>>>>>> change doesn't alter generated code. > > > > >>>>>>>> > > > > >>>>>>>> gas/ > > > > >>>>>>>> 2020-02-XX Jan Beulich > > > > >>>>>>>> > > > > >>>>>>>> * testsuite/gas/i386/i386.s, testsuite/gas/i386/iamcu-1.s, > > > > >>>>>>>> testsuite/gas/i386/ilp32/x86-64.s: Move ambiguous operand size > > > > >>>>>>>> tests ... > > > > >>>>>>>> * testsuite/gas/i386/noreg16.s, testsuite/gas/i386/noreg32.s, > > > > >>>>>>>> testsuite/gas/i386/noreg64.s, testsuite/gas/i386/x86_64.s: ... > > > > >>>>>>>> here. > > > > >>>>>>>> * testsuite/gas/i386/i386.d, testsuite/gas/i386/i386-intel.d > > > > >>>>>>>> testsuite/gas/i386/iamcu-1.d, testsuite/gas/i386/ilp32/x86-64.d, > > > > >>>>>>>> testsuite/gas/i386/k1om.d, testsuite/gas/i386/l1om.d, > > > > >>>>>>>> testsuite/gas/i386/noreg16.d, testsuite/gas/i386/noreg32.d, > > > > >>>>>>>> testsuite/gas/i386/noreg64.d, testsuite/gas/i386/x86_64-intel.d, > > > > >>>>>>>> testsuite/gas/i386/x86_64.d: Adjust expectations. > > > > >>>>>>>> * testsuite/gas/i386/movx16.s, testsuite/gas/i386/movx16.l, > > > > >>>>>>>> testsuite/gas/i386/movx32.s, testsuite/gas/i386/movx32.l, > > > > >>>>>>>> testsuite/gas/i386/movx64.s, testsuite/gas/i386/movx64.l: New. > > > > >>>>>>>> * testsuite/gas/i386/i386.exp: Run new tests. > > > > >>>>>>> > > > > >>>>>>> Please make a separate patch to address MOVSX/MOVZX. > > > > >>>>>> > > > > >>>>>> I don't understand what you mean here. This patch simply documents the > > > > >>>>>> status quo, to make it (much) easier to see what the next patch > > > > >>>>>> actually adjusts. It doesn't "address" anything. If, for the purpose > > > > >>>>>> of committing, you'd like to see both patches folded - fine by me. But > > > > >>>>>> only then, not any earlier. > > > > >>>>>> > > > > >>>>>>> MOVSX and MOVZX > > > > >>>>>>> should take no suffixes. AT&T syntax is supported if there is no > > > > >>>>>>> ambiguity. AT&T > > > > >>>>>>> syntax also supports movsXY and movzXY. > > > > >>>>>> > > > > >>>>>> Please could you clarify what specifically you'd like to see changed, > > > > >>>>>> at the very least by pointing out one case each where you think I'm > > > > >>>>>> moving in the wrong direction (presumably in the next patch really)? > > > > >>>>>> I'm afraid your response isn't such that I can derive from it what > > > > >>>>>> exactly you want. > > > > >>>>> > > > > >>>>> We support > > > > >>>>> > > > > >>>>> movsx %ax, %ecx > > > > >>>>> movzx %ax, %ecx > > > > >>>>> movswl %ax, %ecx > > > > >>>>> movzwl %ax, %ecx > > > > >>>>> > > > > >>>>> We disallow > > > > >>>>> > > > > >>>>> movsxw %ax, %ecx > > > > >>>>> movzxw %ax, %ecx > > > > >>>> > > > > >>>> We don't (as this patch demonstrates, along with pre-existing tests, > > > > >>>> unless you mean once again to have an inconsistency between insns > > > > >>>> with all register operands and similar ones with e memory source), > > > > >>>> and if you want it to be this way, then please do so yourself, but > > > > >>> > > > > >>> I will do it. > > > > >>> > > > > >>>> please also only on top of my changes, so I won't need to re-base > > > > >>> > > > > >>> Which changes of yours are you referring to? > > > > >> > > > > >> This patch and the subsequent one. > > > > >> > > > > > > > > > > Both changes won't be necessary after my changes. > > > > > > > > I'm confused. What you want to deal with is - afaict - orthogonal to > > > > what the next patch in the series here does. > > > > > > > > > > You will see what I mean when I post my patch for review. > > > > > > > AT&T syntax requires suffix to specify memory operand size. Since > > movsx and movzx can have different memory operand sizes with the same > > destination register, this patch removes movsx and movzx with memory > > operand from AT&T syntax. Since AT&T syntax uses different mnemonics > > for movsx and movzx, this change should have little impact on assembly > > sources. Tested with Linux kernel 5.5.3 for x86-64 and glibc 2.31 for > > i686 and x86-64. > > > > Updated patch to add more testcases and allow register operand with > mov[sz]x[bwl]. > I found usage of movzx 4(%edx), %eax We also need to support: movsx 4(%edx), %eax I will update my patch. -- H.J.