x86: FPU_MAX, FPU_MIN incorrect 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. misprint: spec sphinx3 test data 482.sphinx3: http://www.spec.org/cpu2006/CFP2006/ 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). Hello! Can I commit this patch (in development branch), and close this bug... Or you must do it? Your patch is broken, as I said before. Yes, but you patch is correct... May be commit you patch 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) The patch mentioned in comment #5 has been included here: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a4d1f142542935b90d2e