public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/34283]  New: Non-optimal reload register used
@ 2007-11-29  7:27 ubizjak at gmail dot com
  2009-06-22 22:18 ` [Bug rtl-optimization/34283] " steven at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2007-11-29  7:27 UTC (permalink / raw)
  To: gcc-bugs

Following testcase:

--cut here--
typedef long long __m128i __attribute__ ((__vector_size__ (16),
__may_alias__));
typedef long long __v2di __attribute__ ((__vector_size__ (16)));


__m128i _mm_set_epi64x (long long __q1, long long __q0)
{
  return __extension__ (__m128i)(__v2di){ __q0, __q1 };
}
--cut here--

compiles using -O2 -msse2 into:

_mm_set_epi64x:
        movq    12(%esp), %xmm1
        movhps  4(%esp), %xmm1
(1)     movdqa  %xmm1, %xmm0
        ret

insn (1) is not needed.

Before reload, we have:

(insn:HI 12 7 18 2 epi.c:8 (set (reg/i:V2DI 21 xmm0 [ <result> ])
        (vec_concat:V2DI (mem/c/i:DI (plus:SI (reg/f:SI 16 argp)
                    (const_int 8 [0x8])) [2 __q0+0 S8 A32])
            (mem/c/i:DI (reg/f:SI 16 argp) [2 __q1+0 S8 A32]))) 1039
{vec_concatv2di} (nil))

(insn:HI 18 12 0 2 epi.c:8 (use (reg/i:V2DI 21 xmm0 [ <result> ])) -1 (nil))


For some reason reload isn't satisfied with %xmm0:

Reload 0: reload_in (DI) = (mem/c/i:DI (plus:SI (reg/f:SI 7 sp)
                                                        (const_int 12 [0xc]))
[2 __q0+0 S8 A32])
        reload_out (V2DI) = (reg/i:V2DI 21 xmm0 [ <result> ])
        SSE_REGS, RELOAD_OTHER (opnum = 0)
        reload_in_reg: (mem/c/i:DI (plus:SI (reg/f:SI 7 sp)
                                                        (const_int 12 [0xc]))
[2 __q0+0 S8 A32])
        reload_out_reg: (reg/i:V2DI 21 xmm0 [ <result> ])
        reload_reg_rtx: (reg:V2DI 22 xmm1)


The insn pattern is:

  [(set (match_operand:V2DI 0 "register_operand"     "=Y2,?Y2,Y2,x,x,x")
        (vec_concat:V2DI
          (match_operand:DI 1 "nonimmediate_operand" "  m,*y ,0 ,0,0,m")
          (match_operand:DI 2 "vector_move_operand"  "  C,  C,Y2,x,m,0")))]

So, reload should take into account that operand 1 should match operand 0, so
%xmm0 should be used.


-- 
           Summary: Non-optimal reload register used
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        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


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


^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <bug-34283-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-10-27  7:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29  7:27 [Bug rtl-optimization/34283] New: Non-optimal reload register used ubizjak at gmail dot com
2009-06-22 22:18 ` [Bug rtl-optimization/34283] " steven at gcc dot gnu dot org
2009-06-23 12:09 ` ubizjak at gmail dot com
2009-10-03  8:36 ` ubizjak at gmail dot com
     [not found] <bug-34283-4@http.gcc.gnu.org/bugzilla/>
2012-01-20 10:34 ` ubizjak at gmail dot com
2012-10-23 18:33 ` glisse at gcc dot gnu.org
2012-10-27  7:34 ` ubizjak at gmail dot com
2012-10-27  7:49 ` uros at gcc dot gnu.org
2012-10-27  7:53 ` 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).