From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNmvd-0003nF-VE for qemu-devel@nongnu.org; Tue, 08 Nov 2011 09:45:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNmvX-0000Gi-U6 for qemu-devel@nongnu.org; Tue, 08 Nov 2011 09:45:33 -0500 Received: from mail.windriver.com ([147.11.1.11]:44082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNmvX-0000GU-Jj for qemu-devel@nongnu.org; Tue, 08 Nov 2011 09:45:27 -0500 Message-ID: <4EB94080.7080806@windriver.com> Date: Tue, 8 Nov 2011 08:45:20 -0600 From: Jason Wessel MIME-Version: 1.0 References: <1320757252-29290-1-git-send-email-jason.wessel@windriver.com> <4EB93B29.9070204@windriver.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-i386: Fix regression with maxsd SSE2 instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Laurent Desnogues , qemu-devel@nongnu.org On 11/08/2011 08:40 AM, Peter Maydell wrote: > On 8 November 2011 14:22, Jason Wessel wrote: >> +#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) > This will give the wrong answers for special cases involving +0, -0 > and NaNs. Check the intel architecture manual which says how these > should work. > > (You can't use float*_min() and float*_max() either, as those have > sane semantics and you need to implement the Intel ones here.) Anyone out there know how to fix this the right way? I do not have a point of reference as to how to properly implement this, I just stumbled on the fact it was completely broken since the switch from hardfloat to softfloat between qemu 0.14 and 0.15. It certainly appears there is more to this problem than meets the eye. :-) Jason.