Skip to contentSkip to conversation

x86: FPU_MAX, FPU_MIN incorrect

Qemu-devel Daniil Troshkov 2 participants 12 messages Nov 11, 2011 – Sep 13, 2016

lore
Share & tools
lore
#0 lore raw

Public bug reported:

Dear All,

Bug was found in qemu.git.
Now (0.15, 1.0) all fpu is softfpu.
See target-i386/ops_sse.h:
#define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
#define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32). And if we have signed operands we get error...

There is a test with this error (spec shinx3 test data, results diffs on machine and qemu (linux)) and fixed patch. See attach.

Daniil.

** Affects: qemu
Importance: Undecided
Status: New

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#1 lore raw

** Attachment added: "patch"
https://bugs.launchpad.net/qemu/+bug/889053/+attachment/2593058/+files/patch

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#2 lore raw
In reply to Daniil Troshkov

482.sphinx3: http://www.spec.org/cpu2006/CFP2006/

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#3 lore raw
In reply to Daniil Troshkov

** Patch added: "test.useprof.exe"
https://bugs.launchpad.net/bugs/889053/+attachment/2593057/+files/test.useprof.exe

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#4 lore raw
In reply to Daniil Troshkov

misprint:
spec sphinx3 test data

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#5 lore raw
In reply to Daniil Troshkov

The attached patch is incorrect (using the softfloat _min/_max functions will give wrong answers for some special cases). The correct macros are #define FPU_MIN(size, a, b) float ## size ## _lt(a, b, &env->sse_status) ? (a) : (b)
#define FPU_MAX(size, a, b) float ## size ## _lt(b, a, &env->sse_status) ? (a) : (b)

(see recent discussion on the qemu-devel list).

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#6 lore raw
In reply to Daniil Troshkov

Hello!
Can I commit this patch (in development branch), and close this bug... Or you must do it?

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#7 lore raw
In reply to Daniil Troshkov

Your patch is broken, as I said before.

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#8 lore raw
In reply to Daniil Troshkov

Yes, but you patch is correct...

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#9 lore raw
In reply to Daniil Troshkov

May be commit you patch

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
#10 lore raw
In reply to Daniil Troshkov

I say about
#define FPU_MIN(size, a, b) float ## size ## _lt(a, b, &env->sse_status) ? (a) : (b) #define FPU_MAX(size, a, b) float ## size ## _lt(b, a, &env->sse_status) ? (b) : (a)

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  New

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/889053/+subscriptions
author
#11 lore raw
In reply to Daniil Troshkov

The patch mentioned in comment #5 has been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4d1f142542935b90d2e

** Changed in: qemu
Status: New => Fix Released

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

Title:
  x86: FPU_MAX, FPU_MIN incorrect

Status in QEMU:
  Fix Released

Bug description:
  Dear All,

  Bug was found in qemu.git.
  Now (0.15, 1.0) all fpu is softfpu.
  See target-i386/ops_sse.h:
  #define FPU_MIN(size, a, b) (a) < (b) ? (a) : (b)
  #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
  It is incorrect now, becouse float64 (or 32) is (typedef) uint64_t (or 32).
  And if we have signed operands we get error...

  There is a test with this error (spec shinx3 test data, results diffs
  on machine and qemu (linux)) and fixed patch. See attach.

  Daniil.

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