From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMMPO-0002y6-Uz for qemu-devel@nongnu.org; Tue, 17 May 2011 11:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMMPO-0005X3-2Q for qemu-devel@nongnu.org; Tue, 17 May 2011 11:42:06 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:44371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMMPN-0005Wz-V3 for qemu-devel@nongnu.org; Tue, 17 May 2011 11:42:06 -0400 Received: by gwb19 with SMTP id 19so228231gwb.4 for ; Tue, 17 May 2011 08:42:05 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DD29745.5060002@twiddle.net> Date: Tue, 17 May 2011 08:41:57 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1305468801-6015-1-git-send-email-aurelien@aurel32.net> <1305468801-6015-12-git-send-email-aurelien@aurel32.net> In-Reply-To: <1305468801-6015-12-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/11] target-i386: use floatx80_log2() to implement helper_fyl2x*() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 05/15/2011 07:13 AM, Aurelien Jarno wrote: > + temp = floatx80_add(ST0, floatx80_one, &env->fp_status); > + if (!floatx80_is_neg(temp)) { > + temp = floatx80_add(ST0, floatx80_one, &env->fp_status); > + temp = floatx80_log2(temp, &env->fp_status); > + ST1 = floatx80_mul(ST1, temp, &env->fp_status); While this is probably better than the existing code, you really should be using a different series expansion than for log2. This expansion will be wildly inaccurate for inputs near zero. r~