public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Torbjorn Granlund <tege@swox.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/6162: gcc 3.0.4: certain i386 asm reloader ice
Date: Wed, 30 Oct 2002 14:56:00 -0000	[thread overview]
Message-ID: <20021030225600.30439.qmail@sources.redhat.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3497 bytes --]

The following reply was made to PR optimization/6162; it has been noted by GNATS.

From: Torbjorn Granlund <tege@swox.com>
To: Michael Matz <matz@suse.de>
Cc: Kevin Ryde <user42@zip.com.au>,
	Nathanael Nerode <neroden@twcny.rr.com>, <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>, <gcc@gcc.gnu.org>
Subject: Re: optimization/6162: gcc 3.0.4: certain i386 asm reloader ice
Date: 30 Oct 2002 23:55:08 +0100

 Michael Matz <matz@suse.de> writes:
 
   
   Wow.  Indeed. Some of them even have such funny things like:
   __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2"           \
                : "=r" ((USItype) (sh)),                                   \
                  "=&r" ((USItype) (sl))                                   \
                : "%r" ((USItype) (ah)),                                   \
                  "%r" ((USItype) (al)),                                   \
                  "rI" ((USItype) (bl)));
   
   which obviously is broken, or
 
 Fixed in gmp's longlong.h:
 
 2002-01-21  Torbjorn Granlund  <tege@swox.com>
 
         * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
         declaration.
 
   __asm__ ("addu.co %1,%r4,%r5\n\taddu.ci %0,%r2,%r3"                   \
              : "=r" ((USItype) (sh)),                                     \
                "=&r" ((USItype) (sl))                                     \
              : "%rJ" ((USItype) (ah)),                                    \
                "rJ" ((USItype) (bh)),                                     \
                "%rJ" ((USItype) (al)),                                    \
                "rJ" ((USItype) (bl)))
   
   which is useless (they have the same constraints, so commutativity doesn't
   matter at all).  
 
 Well, we put commutativity declarations where they apply for
 consistency.
 
   Some of them probably are just lucky, like:
 
   __asm__ ("add.f       %1, %4, %5\n\tadc       %0, %2, %3"             \
              : "=r" ((USItype) (sh)),                                     \
                "=&r" ((USItype) (sl))                                     \
              : "%r" ((USItype) (ah)),                                     \
                "rIJ" ((USItype) (bh)),                                    \
                "%r" ((USItype) (al)),                                     \
                "rIJ" ((USItype) (bl)))
   
   If called with only variables, or constants already in the right operands,
   the swapping also doesn't take place.  But if then also operand matching
   comes into play (like some asms in longlong and also your example) the
   chance of getting unlucky is even higher.  Anyway given that longlong.h
   uses it I again looked into reload, and no, it simply can't handle
   correctly more than one pair which needs swapping.  It keeps track of only
   one operand which is commutative (the 'commutative' variable), and it only
   tries each alternative twice at most (once normally and once with the last
   pair swapped).  Therefore I think longlong.h is broken, but I wonder why
   this never popped up.
 
 In GCC, I doubt immediate values will be used for add_ssaaaa.  In GMP
 immediates are used, but by conventions they are used for the 2nd
 operand.
 
 There are a couple of other packages that use longlong.h as well, but
 they don't use immediates.
 
 I suggest that we don't touch longlong.h, since it is not really a
 problem.  Who knows, one day GCC might get this right.
 
 -- 
 Torbjörn


             reply	other threads:[~2002-10-30 22:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-30 14:56 Torbjorn Granlund [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-01 13:46 Kevin Ryde
2002-10-31 10:26 Joe Buck
2002-10-30 15:06 Michael Matz
2002-10-30 14:46 Michael Matz
2002-10-30 14:26 Kevin Ryde
2002-10-30 14:16 Michael Matz
2002-10-30 13:36 Kevin Ryde
2002-10-30 12:36 Nathanael Nerode
2002-10-24 22:46 Andreas Jaeger
2002-10-24 22:39 aj
2002-10-24 17:06 Kevin Ryde
2002-10-10 11:06 hubicka
2002-08-02 16:06 Kevin Ryde
2002-04-03 16:26 Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021030225600.30439.qmail@sources.redhat.com \
    --to=tege@swox.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).