public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/22076] New: Strange code for MMX register moves
@ 2005-06-15 12:40 uros at kss-loka dot si
  2005-06-15 12:57 ` [Bug target/22076] " falk at debian dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: uros at kss-loka dot si @ 2005-06-15 12:40 UTC (permalink / raw)
  To: gcc-bugs

This testcase:
#include <mmintrin.h>

__m64 test() {
   __m64 a;

   return a;
}

results in quite strange code when compiled with '-O2 -mmmx':

test:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	movl	%eax, -8(%ebp)   <<<<
	movl	%edx, -4(%ebp)   <<<<
	movq	-8(%ebp), %mm0
	leave
	ret

If xmm registers are used (change __m64 into __m128), asm code is OK.
It looks there are some problems with register costs, from _.22.lreg:

Pass 0

  Register 58 costs: AD_REGS:13000 Q_REGS:13000 NON_Q_REGS:13000 
INDEX_REGS:13000 LEGACY_REGS:13000 GENERAL_REGS:13000 MMX_REGS:24000 
FLOAT_INT_REGS:30000 INT_SSE_REGS:30000 FLOAT_INT_SSE_REGS:30000 ALL_REGS:30000 
MEM:20000

  Register 58 pref GENERAL_REGS or none


Pass 1

  Register 58 costs: AD_REGS:13000 Q_REGS:13000 NON_Q_REGS:13000 
INDEX_REGS:13000 LEGACY_REGS:13000 GENERAL_REGS:13000 MMX_REGS:24000 
FLOAT_INT_REGS:30000 INT_SSE_REGS:30000 FLOAT_INT_SSE_REGS:30000 ALL_REGS:30000 
MEM:20000

...

(insn:HI 16 28 22 1 (set (reg/i:V2SI 29 mm0 [ <result> ])
        (reg/v:V2SI 58 [ a ])) 768 {*movv2si_internal} (nil)
    (expr_list:REG_DEAD (reg/v:V2SI 58 [ a ])
        (nil)))
...

The instructions, marked with '<<<<' are then produced by reload.

-- 
           Summary: Strange code for MMX register moves
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ssemmx
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uros at kss-loka dot si
                CC: gcc-bugs at gcc dot gnu dot org
 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=22076


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

end of thread, other threads:[~2005-08-31 20:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-15 12:40 [Bug target/22076] New: Strange code for MMX register moves uros at kss-loka dot si
2005-06-15 12:57 ` [Bug target/22076] " falk at debian dot org
2005-06-15 17:35 ` pinskia at gcc dot gnu dot org
2005-06-21 12:04 ` uros at kss-loka dot si
2005-06-21 13:06 ` pinskia at gcc dot gnu dot org
2005-06-22 20:27 ` pinskia at gcc dot gnu dot org
2005-06-22 20:29 ` pinskia at gcc dot gnu dot org
2005-08-31 19:18 ` pinskia at gcc dot gnu dot org
2005-08-31 20:42 ` bangerth at dealii dot org

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