public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/32201]  New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn
@ 2007-06-04  6:51 ubizjak at gmail dot com
  2007-06-04  7:22 ` [Bug target/32201] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-04  6:51 UTC (permalink / raw)
  To: gcc-bugs

Currently, it is not possible to use SSE 4.1 variable blend instructions in asm
statements. These instructions require the third argument to be in %xmm0, but
gcc fails to allocate correct register even when (new) "z" constraint is used.

--cut here--
typedef float V4SFmode __attribute__((vector_size(16)));

V4SFmode t (V4SFmode a, V4SFmode b, V4SFmode c)
{
  V4SFmode ret;

  asm ("blenvdps %0, %2, %3" : "=x" (ret) : "0" (a), "x" (b), "z" (c));
  return ret;
}
--cut here--

gcc -O1 -msse

prxxx.c: In function 't':
prxxx.c:7: error: can't find a register in class 'SSE_FIRST_REG' while
reloading 'asm'
prxxx.c:7: error: 'asm' operand has impossible constraints


-- 
           Summary: [4.3 Regression] Can not allocate %xmm0 register for
                    variable blend insn
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ssemmx, ra
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ubizjak at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
OtherBugsDependingO 32189
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
@ 2007-06-04  7:22 ` pinskia at gcc dot gnu dot org
  2007-06-04  7:39 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-04  7:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-06-04 07:22 -------
How can this be a regression if the constraint is new?
Also it seems like you could use register asm("xmm0") to get the correct
register to be used.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3 Regression] Can not    |Can not allocate %xmm0
                   |allocate %xmm0 register for |register for variable blend
                   |variable blend insn         |insn


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
  2007-06-04  7:22 ` [Bug target/32201] " pinskia at gcc dot gnu dot org
@ 2007-06-04  7:39 ` ubizjak at gmail dot com
  2007-06-04  7:51 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-04  7:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ubizjak at gmail dot com  2007-06-04 07:39 -------
(In reply to comment #1)
> How can this be a regression if the constraint is new?

This is the same failure as PR32189, and that one is marked as a regression.

> Also it seems like you could use register asm("xmm0") to get the correct
> register to be used.

But please note that "c" argument is passed to the function via xmm2.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
  2007-06-04  7:22 ` [Bug target/32201] " pinskia at gcc dot gnu dot org
  2007-06-04  7:39 ` ubizjak at gmail dot com
@ 2007-06-04  7:51 ` pinskia at gcc dot gnu dot org
  2007-06-04  7:58 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-04  7:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-06-04 07:50 -------
> > Also it seems like you could use register asm("xmm0") to get the correct
> > register to be used.
> But please note that "c" argument is passed to the function via xmm2.
So this is why GCC has register asm() extension is to get the correct register
to be used.  The code would look like:
typedef float V4SFmode __attribute__((vector_size(16)));

V4SFmode t (V4SFmode a, V4SFmode b, V4SFmode c)
{
 V4SFmode ret;
 register V4SFmode c1 asm("xmm0");
 c1 = c;

 asm ("blenvdps %0, %2, %3" : "=x" (ret) : "0" (a), "x" (b), "x" (c1));
 return ret;
}

Since c1 is already in xmm0, the register allocator knows it cannot use a as
xmm0 so there is still a move before the other move and after the asm.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
                   ` (2 preceding siblings ...)
  2007-06-04  7:51 ` pinskia at gcc dot gnu dot org
@ 2007-06-04  7:58 ` pinskia at gcc dot gnu dot org
  2007-06-04  8:07 ` ubizjak at gmail dot com
  2007-06-14 19:12 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-04  7:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-06-04 07:58 -------
Note local allocate should be able to figure the "z" constraint is only one
register and assign it to that pesdu-register.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
                   ` (3 preceding siblings ...)
  2007-06-04  7:58 ` pinskia at gcc dot gnu dot org
@ 2007-06-04  8:07 ` ubizjak at gmail dot com
  2007-06-14 19:12 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-04  8:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ubizjak at gmail dot com  2007-06-04 08:06 -------
Created an attachment (id=13655)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13655&action=view)
Local alloc RTL dump

RTL dump of .c.163r.lreg


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/32201] Can not allocate %xmm0 register for variable blend insn
  2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
                   ` (4 preceding siblings ...)
  2007-06-04  8:07 ` ubizjak at gmail dot com
@ 2007-06-14 19:12 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2007-06-14 19:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ubizjak at gmail dot com  2007-06-14 19:11 -------
Fixed in mainline.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-14 19:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-04  6:51 [Bug target/32201] New: [4.3 Regression] Can not allocate %xmm0 register for variable blend insn ubizjak at gmail dot com
2007-06-04  7:22 ` [Bug target/32201] " pinskia at gcc dot gnu dot org
2007-06-04  7:39 ` ubizjak at gmail dot com
2007-06-04  7:51 ` pinskia at gcc dot gnu dot org
2007-06-04  7:58 ` pinskia at gcc dot gnu dot org
2007-06-04  8:07 ` ubizjak at gmail dot com
2007-06-14 19:12 ` ubizjak at gmail dot com

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).