public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28331]  New: Problem with floating point operations after calling __builtin_ia32_movntq
@ 2006-07-10 22:32 cedric dot augonnet at ens-lyon dot org
  2006-07-10 22:36 ` [Bug target/28331] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cedric dot augonnet at ens-lyon dot org @ 2006-07-10 22:32 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

Hi,
After calling __builtin_ia32_movntq, floating point operations do not seem to
work anymore : 

When compiling this with the msse flag :

------------------------------------------------------

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
        unsigned long long int a,b;
        a = 1ULL;
        b = 2ULL;

        __builtin_ia32_movntq(&a,b);

        printf("%f\n", ((float) (1*2)));
        return 0;

}

--------------------------------------------------------

It returns "nan" instead of 2 as we might have expected.

Regards, 
Cédric


-- 
           Summary: Problem with floating point operations after calling
                    __builtin_ia32_movntq
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cedric dot augonnet at ens-lyon dot org
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


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

* [Bug target/28331] Problem with floating point operations after calling __builtin_ia32_movntq
  2006-07-10 22:32 [Bug c/28331] New: Problem with floating point operations after calling __builtin_ia32_movntq cedric dot augonnet at ens-lyon dot org
@ 2006-07-10 22:36 ` pinskia at gcc dot gnu dot org
  2006-07-10 22:56 ` cedric dot augonnet at ens-lyon dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-10 22:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-10 22:36 -------
You forgot to flush the MMX/x87 registers since fp and MMX registers are the
same set and the hardware does not support them at the same time.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |target
         Resolution|                            |INVALID


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


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

* [Bug target/28331] Problem with floating point operations after calling __builtin_ia32_movntq
  2006-07-10 22:32 [Bug c/28331] New: Problem with floating point operations after calling __builtin_ia32_movntq cedric dot augonnet at ens-lyon dot org
  2006-07-10 22:36 ` [Bug target/28331] " pinskia at gcc dot gnu dot org
@ 2006-07-10 22:56 ` cedric dot augonnet at ens-lyon dot org
  2006-07-10 22:59 ` pinskia at gcc dot gnu dot org
  2006-07-10 23:17 ` cedric dot augonnet at ens-lyon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cedric dot augonnet at ens-lyon dot org @ 2006-07-10 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from cedric dot augonnet at ens-lyon dot org  2006-07-10 22:56 -------
(In reply to comment #1)
> You forgot to flush the MMX/x87 registers since fp and MMX registers are the
> same set and the hardware does not support them at the same time.
> 

Ok, i see that adding  __builtin_ia32_emms() solves the problem indeed, thanks!

Still, this does not seem to be documented yet, wouldn't it be a good thing to
change this ?
For instance it might have been notified in
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/X86-Built_002din-Functions.html#X86-Built_002din-Functions
?


-- 


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


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

* [Bug target/28331] Problem with floating point operations after calling __builtin_ia32_movntq
  2006-07-10 22:32 [Bug c/28331] New: Problem with floating point operations after calling __builtin_ia32_movntq cedric dot augonnet at ens-lyon dot org
  2006-07-10 22:36 ` [Bug target/28331] " pinskia at gcc dot gnu dot org
  2006-07-10 22:56 ` cedric dot augonnet at ens-lyon dot org
@ 2006-07-10 22:59 ` pinskia at gcc dot gnu dot org
  2006-07-10 23:17 ` cedric dot augonnet at ens-lyon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-10 22:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-07-10 22:59 -------
You should not be using the builtins directly anyways.  You should being the
intrincics which are source compatiable with Intel's intrincics.  Also this
problem is documented with any part of the ISA of mmx anyways which you should
read.


-- 


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


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

* [Bug target/28331] Problem with floating point operations after calling __builtin_ia32_movntq
  2006-07-10 22:32 [Bug c/28331] New: Problem with floating point operations after calling __builtin_ia32_movntq cedric dot augonnet at ens-lyon dot org
                   ` (2 preceding siblings ...)
  2006-07-10 22:59 ` pinskia at gcc dot gnu dot org
@ 2006-07-10 23:17 ` cedric dot augonnet at ens-lyon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cedric dot augonnet at ens-lyon dot org @ 2006-07-10 23:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from cedric dot augonnet at ens-lyon dot org  2006-07-10 23:17 -------
(In reply to comment #3)
> You should not be using the builtins directly anyways.  You should being the
> intrincics which are source compatiable with Intel's intrincics.  Also this
> problem is documented with any part of the ISA of mmx anyways which you should
> read.
> 

I should indeed read it more carefully. But my point was that
__builtin_ia32_emms() is never mentionned at all, only femms is. And actually
it was already mentionned in
http://gcc.gnu.org/ml/gcc-bugs/2003-05/msg00198.html. So this problem - with
documentation, not gcc itself - was in 3.3, it is still there in 4.1.


-- 


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


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

end of thread, other threads:[~2006-07-10 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-10 22:32 [Bug c/28331] New: Problem with floating point operations after calling __builtin_ia32_movntq cedric dot augonnet at ens-lyon dot org
2006-07-10 22:36 ` [Bug target/28331] " pinskia at gcc dot gnu dot org
2006-07-10 22:56 ` cedric dot augonnet at ens-lyon dot org
2006-07-10 22:59 ` pinskia at gcc dot gnu dot org
2006-07-10 23:17 ` cedric dot augonnet at ens-lyon 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).