From patchwork Tue Jul 13 14:11:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 58780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B7E6FB6F16 for ; Wed, 14 Jul 2010 00:10:18 +1000 (EST) Received: (qmail 19416 invoked by alias); 13 Jul 2010 14:10:13 -0000 Received: (qmail 19397 invoked by uid 22791); 13 Jul 2010 14:10:11 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Jul 2010 14:10:05 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6DEA3NN008412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Jul 2010 10:10:03 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6DEA0us010896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 13 Jul 2010 10:10:01 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o6DEBeUa023885 for ; Tue, 13 Jul 2010 16:11:40 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o6DEBeuI023883 for gcc-patches@gcc.gnu.org; Tue, 13 Jul 2010 16:11:40 +0200 Date: Tue, 13 Jul 2010 16:11:40 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix asm-es-2.c testcase and PowerPC/IA-64 "m"/"es"/"S" constrain documentation Message-ID: <20100713141140.GA20208@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! Some adjustments needed after the inline-asm side-effect changes. Ok for trunk? 2010-07-13 Jakub Jelinek PR testsuite/44701 * doc/md.texi: Clarify m and es constraints on PowerPC and m and S constraints on IA-64. * gcc.target/powerpc/asm-es-2.c (f2): Add <> constraints. Jakub --- gcc/testsuite/gcc.target/powerpc/asm-es-2.c.jj 2009-07-20 20:41:46.000000000 +0200 +++ gcc/testsuite/gcc.target/powerpc/asm-es-2.c 2010-07-13 13:22:13.000000000 +0200 @@ -11,7 +11,7 @@ f2 (int *p) while (1) { p += 4; - asm ("asm2%U0 %0" : "=m" (*p)); + asm ("asm2%U0 %0" : "=m<>" (*p)); } } --- gcc/doc/md.texi.jj 2010-06-28 15:36:03.000000000 +0200 +++ gcc/doc/md.texi 2010-07-13 13:31:31.000000000 +0200 @@ -1998,31 +1998,33 @@ Integer/Floating point constant that can three instructions @item m -Memory operand. Note that on PowerPC targets, @code{m} can include -addresses that update the base register. It is therefore only safe -to use @samp{m} in an @code{asm} statement if that @code{asm} statement +Memory operand. Note that on PowerPC targets, +Normally, @code{m} does not allow addresses that update the base register. +If @samp{<} or @samp{>} constraint is also used, they are allowed and +therefore on PowerPC targets in that case it is only safe +to use @samp{m<>} in an @code{asm} statement if that @code{asm} statement accesses the operand exactly once. The @code{asm} statement must also use @samp{%U@var{}} as a placeholder for the ``update'' flag in the corresponding load or store instruction. For example: @smallexample -asm ("st%U0 %1,%0" : "=m" (mem) : "r" (val)); +asm ("st%U0 %1,%0" : "=m<>" (mem) : "r" (val)); @end smallexample is correct but: @smallexample -asm ("st %1,%0" : "=m" (mem) : "r" (val)); +asm ("st %1,%0" : "=m<>" (mem) : "r" (val)); @end smallexample -is not. Use @code{es} rather than @code{m} if you don't want the -base register to be updated. +is not. @item es A ``stable'' memory operand; that is, one which does not include any -automodification of the base register. Unlike @samp{m}, this constraint -can be used in @code{asm} statements that might access the operand -several times, or that might not access it at all. +automodification of the base register. This used to be useful when +@samp{m} allowed automodification of the base register, but as those are now only +allowed when @samp{<} or @samp{>} is used, @samp{es} is basically the same +as @samp{m} without @samp{<} and @samp{>}. @item Q Memory operand that is an offset from a register (it is usually better @@ -2194,10 +2196,9 @@ Application register residing in I-unit Floating-point register @item m -Memory operand. -Remember that @samp{m} allows postincrement and postdecrement which +Memory operand. If used together with @samp{<} or @samp{>}, +the operand can have postincrement and postdecrement which require printing with @samp{%Pn} on IA-64. -Use @samp{S} to disallow postincrement and postdecrement. @item G Floating-point constant 0.0 or 1.0 @@ -2233,7 +2234,9 @@ Non-volatile memory for floating-point l Integer constant in the range 1 to 4 for @code{shladd} instruction @item S -Memory operand except postincrement and postdecrement +Memory operand except postincrement and postdecrement. This is +now roughly the same as @samp{m} when not used together with @samp{<} +or @samp{>}. @end table @item FRV---@file{config/frv/frv.h}