This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/49257] -mfpmath=sse generates x87 instructions on 32 bits OS


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

--- Comment #11 from Uros Bizjak <ubizjak at gmail dot com> 2011-06-07 08:38:45 UTC ---
Patched gcc fails following testcase:

--cut here--
#include <stdio.h>

float
__attribute__((noinline))
ll2f (long long i)
{
  return i;
}

long long
__attribute__((noinline))
f2ll (float f)
{
  return f;
}

int main ()
{
  static volatile long long ll = 0x4000004000000001ll;
  static volatile float f;
  static volatile long long o;

  f = ll2f (ll);
  o = f2ll (f);

  printf ("%#llx %f %#llx\n", ll, f, o);
  return 0;
}
--cut here--

gcc -m32 -O2 -msse2 -mfpmath=sse:
0x4000004000000001 4611686018427387904.000000 0x4000000000000000

gcc -m32 -O2 -msse2 -mfpmath=387:
0x4000004000000001 4611686568183201792.000000 0x4000008000000000

A bit has been lost...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]