public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/33482]  New: Invalid operands for pshifts with -O1
@ 2007-09-18 20:54 dwarak dot rajagopal at amd dot com
  2007-09-19  6:20 ` [Bug target/33482] " ubizjak at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: dwarak dot rajagopal at amd dot com @ 2007-09-18 20:54 UTC (permalink / raw)
  To: gcc-bugs

Testcase (test1.c):

#include <emmintrin.h>
__m128i test_fn1(__m128i x)
{
  __m128i y;
  return _mm_srl_epi64(x,_mm_set_epi32(0,0,31,31));
}

gcc -O1 -c test1.c
/tmp/ccBc8BO7.s: Assembler messages:
/tmp/ccBc8BO7.s:7: Error: suffix or operands invalid for `psrlq'

gcc -O1 -S test1.s

test_fn1:
.LFB501:
        psrlq   $133143986207, %xmm0
        ret

As we can see that the operands are invalid for psrlq. Similar errors occur for
other pshifts instructions such as psra*, psrl*, and psll*.

A patch to fix this issue is as follows, basically having the right output
modifier for these insns in sse.md.

diff -purwN gcc-4.2.2-RC-20070909/gcc/config/i386/sse.md
gcc-4.2.2-RC-20070909-fix/gcc/config/i386/sse.md
--- gcc-4.2.2-RC-20070909/gcc/config/i386/sse.md        2007-09-01
10:28:30.000000000 -0500
+++ gcc-4.2.2-RC-20070909-fix/gcc/config/i386/sse.md    2007-09-17
16:33:26.790117000 -0500
@@ -2724,7 +2724,7 @@
   [(set (match_operand:SSEMODE24 0 "register_operand" "=x")
        (ashiftrt:SSEMODE24
          (match_operand:SSEMODE24 1 "register_operand" "0")
-         (match_operand:TI 2 "nonmemory_operand" "xn")))]
+         (match_operand:TI 2 "nonmemory_operand" "xN")))]
   "TARGET_SSE2"
   "psra<ssevecsize>\t{%2, %0|%0, %2}"
   [(set_attr "type" "sseishft")
@@ -2734,7 +2734,7 @@
   [(set (match_operand:SSEMODE248 0 "register_operand" "=x")
        (lshiftrt:SSEMODE248
          (match_operand:SSEMODE248 1 "register_operand" "0")
-         (match_operand:TI 2 "nonmemory_operand" "xn")))]
+         (match_operand:TI 2 "nonmemory_operand" "xN")))]
   "TARGET_SSE2"
   "psrl<ssevecsize>\t{%2, %0|%0, %2}"
   [(set_attr "type" "sseishft")
@@ -2744,7 +2744,7 @@
   [(set (match_operand:SSEMODE248 0 "register_operand" "=x")
        (ashift:SSEMODE248
          (match_operand:SSEMODE248 1 "register_operand" "0")
-         (match_operand:TI 2 "nonmemory_operand" "xn")))]
+         (match_operand:TI 2 "nonmemory_operand" "xN")))]
   "TARGET_SSE2"
   "psll<ssevecsize>\t{%2, %0|%0, %2}"
   [(set_attr "type" "sseishft")

Is this ok?

- Dwarak


-- 
           Summary: Invalid operands for pshifts with -O1
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dwarak dot rajagopal at amd dot com
 GCC build triplet: i686-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu


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


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

* [Bug target/33482] Invalid operands for pshifts with -O1
  2007-09-18 20:54 [Bug rtl-optimization/33482] New: Invalid operands for pshifts with -O1 dwarak dot rajagopal at amd dot com
@ 2007-09-19  6:20 ` ubizjak at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ubizjak at gmail dot com @ 2007-09-19  6:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ubizjak at gmail dot com  2007-09-19 06:20 -------
I'll backport http://gcc.gnu.org/viewcvs?view=rev&revision=128328 from PR
target/33369 to fix this issue.

*** This bug has been marked as a duplicate of 33369 ***


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2007-09-19  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-18 20:54 [Bug rtl-optimization/33482] New: Invalid operands for pshifts with -O1 dwarak dot rajagopal at amd dot com
2007-09-19  6:20 ` [Bug target/33482] " 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).