public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: tbp <tbptbp@gmail.com>
To: gcc@gcc.gnu.org
Subject: multiple problems with SSE / cmpunordps, QNaNs and -ffast-math
Date: Sat, 11 Dec 2004 10:49:00 -0000	[thread overview]
Message-ID: <4fc48eb1041211024878d72b6a@mail.gmail.com> (raw)

I know that the fast-math flag implies finite-math-only but howerver
you take it something is wrong in what is best described by this:

#include <xmmintrin.h>

// $? should be 15, but with -ffast-math -> $? = 0 
// if you don't get an ICE first
int main() {
	__m128
		a = _mm_set1_ps(1.f/0.f),
		b = _mm_set1_ps(0),
		c = _mm_mul_ps(a,b),
		comp = _mm_cmpunord_ps(c,c);

	return _mm_movemask_ps(comp);
}

[all of that on cygwin with ie -march=k8 or -march=pentium4]
With -ffast-math, the cmpunordps is simply not emited at all:  3.3.3
(cygwin special), 4.0.0 20041205 (and that's not related to the
comparison being against the same vector).
That's when you don't get an ICE along the way: ICEd on 3.4.1
20040625,  3.5.0 20040620, 4.0.0 20041017
I had no ancient or more regular builds to check against.

Anyway, if you follow the logic that i'm not supposed to generate any
NaN and therefore not allowed to check for them, a warning would be in
order when the cmpunordps is supressed (could have saved me some time
:)).

I sincerely hope that's an oversight, i would really hate to have to
abandon fast-math to be abble to check for quiet NaNs on SSE (where i
control pretty much every aspects).

tbp.

PS: recents gcc really rock at scheduling SSE, it's a real pleasure; a
cheerful thank you is more than deserved.

             reply	other threads:[~2004-12-11 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-11 10:49 tbp [this message]
2004-12-11 11:08 ` tbp
2004-12-12 17:34   ` tbp

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=4fc48eb1041211024878d72b6a@mail.gmail.com \
    --to=tbptbp@gmail.com \
    --cc=gcc@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).