public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/19250] New: minss/maxss SSE insn not generated for -mfpmath=sse
@ 2005-01-04  8:10 uros at kss-loka dot si
  2005-01-04  8:27 ` [Bug target/19250] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2005-01-04  8:10 UTC (permalink / raw)
  To: gcc-bugs

This testcase should generate min{s,d}s, max{s,d}s SSE insn. It looks that
min?f, max?f pattern is converted to equivalent i387 insn sequence, because the
output is expected in FP reg. However, the result of min/max should be _moved_
from SSE to FP reg.

Testcase:

float minf(float a, float b) {
  return a <= b ? a : b;
}

when compiled with 'gcc -O2 -ffast-math -march=pentium4 -mfpmath=sse
-fomit-frame-pointer':

minf:
        subl    $4, %esp
        flds    8(%esp)
        movss   12(%esp), %xmm0
        movss   %xmm0, (%esp)
        flds    (%esp)
        fcomi   %st(1), %st
        fcmovnb %st(1), %st
        fstp    %st(1)
        addl    $4, %esp
        ret

Equivalent code could be something like:
minf:
	subl	$4, %esp
	movss	8(%esp), %xmm0
	minss	%xmm0, 12(%esp)
	movss	%xmm0, (%esp)
	flds	(%esp)
	addl	$4, %esp
	ret

Uros.

-- 
           Summary: minss/maxss SSE insn not generated for -mfpmath=sse
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          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=19250


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

end of thread, other threads:[~2005-01-18 12:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04  8:10 [Bug target/19250] New: minss/maxss SSE insn not generated for -mfpmath=sse uros at kss-loka dot si
2005-01-04  8:27 ` [Bug target/19250] " pinskia at gcc dot gnu dot org
2005-01-04  9:05 ` aj at gcc dot gnu dot org
2005-01-07 11:15 ` uros at kss-loka dot si
2005-01-12  2:48 ` rth at gcc dot gnu dot org
2005-01-14  0:34 ` cvs-commit at gcc dot gnu dot org
2005-01-14  1:03 ` rth at gcc dot gnu dot org
2005-01-14  1:05 ` pinskia at gcc dot gnu dot org
2005-01-14  6:37 ` uros at kss-loka dot si
2005-01-18 12:38 ` uros at kss-loka dot si

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