From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27634 invoked by alias); 27 Apr 2009 18:03:46 -0000 Received: (qmail 27507 invoked by uid 22791); 27 Apr 2009 18:03:44 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_51,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Apr 2009 18:03:39 +0000 Received: by fg-out-1718.google.com with SMTP id 13so25530fge.5 for ; Mon, 27 Apr 2009 11:03:36 -0700 (PDT) Received: by 10.86.74.4 with SMTP id w4mr470692fga.11.1240855416780; Mon, 27 Apr 2009 11:03:36 -0700 (PDT) Received: from 93-103-18-160.static.t-2.net (93-103-18-160.static.t-2.net [93.103.18.160]) by mx.google.com with ESMTPS id d4sm6128996fga.19.2009.04.27.11.03.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Apr 2009 11:03:35 -0700 (PDT) Message-ID: <49F5F376.5000502@gmail.com> Date: Mon, 27 Apr 2009 19:04:00 -0000 From: Uros Bizjak User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: "H.J. Lu" CC: Paolo Bonzini , "gcc-patches@gcc.gnu.org" , Jakub Jelinek Subject: Re: PATCH: PR target/39911: The 'z' suffix doesn't work with 16bit integer insn References: <6dc9ffc80904261334o28321850r6c0317db8cc8eada@mail.gmail.com> <49F59EC0.6050400@gmail.com> <6dc9ffc80904270652re18e99fq1d0989ed83adaebb@mail.gmail.com> <49F5BA12.3080005@gnu.org> <6dc9ffc80904270715u11fd24c3h25c3dc81f8897768@mail.gmail.com> <49F5CCC2.3090901@gnu.org> <6dc9ffc80904270924n3769911g507112687a85d91e@mail.gmail.com> In-Reply-To: <6dc9ffc80904270924n3769911g507112687a85d91e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg02163.txt.bz2 H.J. Lu wrote: >>>> In fact, operand modifiers are not documented at all except ia64 `%Pn'. >>>> >>> I saw >>> >>> `m' >>> Memory operand. Remember that `m' allows postincrement and >>> postdecrement which require printing with `%Pn' on IA-64. >>> Use `S' to disallow postincrement and postdecrement. >>> >>> Can you tell how to use it from above? I have to find an example for it. >>> Guess where I can find such examples? >>> >> I see your point, but if one looks for %z in config/i386/i386.md he gets >> >> ;; 'z' mov%z1 would be movl, movw, or movb depending on the mode of >> ;; operands[1]. >> >> which is exactly the definition that Uros is pushing. >> > > There are several problems: > > 1. It is still the part of gcc source. It isn't the user documentation. > Given some out-of-date comments and actual usages in gcc source, > I will take actual usages over some out-of-date comments. > 2. %z is fully implemented and used for x87 insns. > 3. "movq" isn't mentioned. > 4. "movw/movq" never worked on memory operand. > My reasoning for fixing "%z" are: - users found %z in the comment from i386.md and used it exactly in the way as shown there. - %z with x87 doesn not give the suffix as mentioned in the comment above. - there were separate bugreports for ICEs in print_operand with QImode operands and DImode operands. There were reports for wrong HImode suffix for memory operands as well as DImode memory operands. Actually, everything that could go wrong went wrong and these bugreports shows the pattern of uses for %z - also for DImode, even if "movq" is not mentioned. Users are expecting %z to give "q,l,w,b" consistently for register and memory operands. Regarding x87, not even glibc took the opportunity to use fistp%z in mathinline.h [1]. The decision to "break" (?) existing code for x87 was done on these usage patterns. %z modifier was always PITA, so let's give users what they want and let's document the correct usage. And that is %z for all integer and %Z for FP insns. [1] http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu/bits/mathinline.h?rev=1.62&content-type=text/x-cvsweb-markup&cvsroot=glibc Uros.