public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "uros at kss-loka dot si" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/22076] New: Strange code for MMX register moves
Date: Wed, 15 Jun 2005 12:40:00 -0000	[thread overview]
Message-ID: <20050615123954.22076.uros@kss-loka.si> (raw)

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


             reply	other threads:[~2005-06-15 12:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-15 12:40 uros at kss-loka dot si [this message]
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

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=20050615123954.22076.uros@kss-loka.si \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).