This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix up long double fphex
- From: Ulrich Drepper <drepper at gmail dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 6 Mar 2012 18:00:13 -0500
- Subject: Re: [PATCH] Fix up long double fphex
- Authentication-results: mr.google.com; spf=pass (google.com: domain of drepper@gmail.com designates 10.60.12.230 as permitted sender) smtp.mail=drepper@gmail.com; dkim=pass header.i=drepper@gmail.com
- References: <20120304204257.GA4667@redhat.com>
On Sun, Mar 4, 2012 at 15:42, Marek Polacek <polacek@redhat.com> wrote:
> + Âwchar_t a[16 * sizeof (wchar_t)];
> + Âswprintf (a, 16 * sizeof (wchar_t), L"%La\n", x);
> + Âwchar_t A[16 * sizeof (wchar_t)];
> + Âswprintf (A, 16 * sizeof (wchar_t), L"%LA\n", x);
> +
> + Âreturn (wmemcmp (a, L"0xc.4p+1", 8) != 0
> + Â Â Â Â || wmemcmp (A, L"0XC.4P+1", 8) != 0);
These tests are not correct. The x86/x86-64 instruction uses four
bits for the first digit but that's not guaranteed. There can be four
different results and they all should be allowed.