qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1233225] [NEW] mips/mipsel linux user float division problem
@ 2013-09-30 15:09 Johannes Schauer
  2013-10-01 17:51 ` [Qemu-devel] [Bug 1233225] " Stefan Weil
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Johannes Schauer @ 2013-09-30 15:09 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Hi,

I tested the following with the qemu git HEAD as of 2013-09-30 on Debian
stable and testing. My host runs amd64 but I also tried this out inside
a i386 chroot with the same result. The problem occurs for mips and
mipsel. Given the following program:

#include <stdio.h>
int main(int argc, char **argv)
{
    int a = 1;
    double d = a/2.0;
    printf("%f\n", d);
    return 0;
}

Instead of printing 0.5, it will print 2.0 if executed in qemu user
mode.

$ mipsel-linux-gnu-gcc mipstest.c
$ ~/qemu/mipsel-linux-user/qemu-mipsel ./a.out
2.0

Expecting this to be a problem with my cross compiler (gcc-4.4 from
emdebian) I ran a fully emulated debian squeeze environment inside qemu.
There, I compiled the same program natively with gcc and as expected got
0.5 as the output. I also copied the cross compiled binary inside the
emulated environment and also got 0.5 when I ran it. So the same
mips/mipsel binary produces different output depending on whether it is
run in a fully emulated environment or qemu user mode.

Can anybody else reproduce this problem?

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1233225

Title:
  mips/mipsel linux user float division problem

Status in QEMU:
  New

Bug description:
  Hi,

  I tested the following with the qemu git HEAD as of 2013-09-30 on
  Debian stable and testing. My host runs amd64 but I also tried this
  out inside a i386 chroot with the same result. The problem occurs for
  mips and mipsel. Given the following program:

  #include <stdio.h>
  int main(int argc, char **argv)
  {
      int a = 1;
      double d = a/2.0;
      printf("%f\n", d);
      return 0;
  }

  Instead of printing 0.5, it will print 2.0 if executed in qemu user
  mode.

  $ mipsel-linux-gnu-gcc mipstest.c
  $ ~/qemu/mipsel-linux-user/qemu-mipsel ./a.out
  2.0

  Expecting this to be a problem with my cross compiler (gcc-4.4 from
  emdebian) I ran a fully emulated debian squeeze environment inside
  qemu. There, I compiled the same program natively with gcc and as
  expected got 0.5 as the output. I also copied the cross compiled
  binary inside the emulated environment and also got 0.5 when I ran it.
  So the same mips/mipsel binary produces different output depending on
  whether it is run in a fully emulated environment or qemu user mode.

  Can anybody else reproduce this problem?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1233225/+subscriptions

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

end of thread, other threads:[~2016-12-06 12:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-30 15:09 [Qemu-devel] [Bug 1233225] [NEW] mips/mipsel linux user float division problem Johannes Schauer
2013-10-01 17:51 ` [Qemu-devel] [Bug 1233225] " Stefan Weil
2013-10-02  1:39   ` Peter Maydell
2013-10-02  5:22     ` Stefan Weil
2013-10-02 12:58       ` Peter Maydell
2013-10-01 18:14 ` Stefan Weil
2013-10-01 20:43   ` Stefan Weil
2013-10-02 16:48 ` Johannes Schauer
2013-10-08  0:21 ` Petar Jovanovic
2016-12-06 11:43 ` Thomas Huth

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 NNTP newsgroup(s).