This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Include SSE state in i386 fenv_t (bug 16064)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 9 May 2014 09:51:33 -0700
- Subject: Re: Include SSE state in i386 fenv_t (bug 16064)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1405082300140 dot 12485 at digraph dot polyomino dot org dot uk> <CAMe9rOo6x37VNp161KzF1pTEMFs++uEVgHfO=+8O9wdmg6sHTg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1405091210550 dot 8692 at digraph dot polyomino dot org dot uk> <CAMe9rOq8Q4FWGd=qSjLxjvHXb-GGcAVhLER7QTYaqm8vGJrHdw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1405091549060 dot 14073 at digraph dot polyomino dot org dot uk> <CAMe9rOroBEfqa6S-uPHANa2b35EwwZe_1ZGHK4g_PmEz_bopjw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1405091605170 dot 14073 at digraph dot polyomino dot org dot uk> <CAMe9rOojq+FT5m4AfDyeX_EbxzbUjqp-bU-7CeLW+0qb9JL2TQ at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1405091644060 dot 14073 at digraph dot polyomino dot org dot uk>
On Fri, May 9, 2014 at 9:45 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Fri, 9 May 2014, H.J. Lu wrote:
>
>> When loading load x87 fenv_t, we should either not to
>> change __eip or set it to 0 together with other fields,
>> similar to other code paths in __fesetenv, to avoid any
>> potential issues.
>
> This patch sets all those fields to 0 unconditionally.
>
> 2014-05-09 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #16064]
> * sysdeps/i386/fpu/fegetenv.c: Include <unistd.h>, <ldsodefs.h>
> and <dl-procinfo.h>.
> (__fegetenv): Save SSE state in envp->__eip if supported.
> * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Save SSE state in
> envp->__eip if supported.
> * sysdeps/i386/fpu/fesetenv.c: Include <unistd.h>, <ldsodefs.h>
> and <dl-procinfo.h>.
> (__fesetenv): Always set __eip, __cs_selector, __opcode,
> __data_offset and __data_selector in environment to 0. Set SSE
> state if supported.
> * sysdeps/x86/fpu/Makefile [$(subdir) = math] (tests): Add
> test-fenv-sse.
> [$(subdir) = math] (CFLAGS-test-fenv-sse.c): Add -msse2
> -mfpmath=sse.
> * sysdeps/x86/fpu/test-fenv-sse.c: New file.
>
Looks good to me.
Thanks.
--
H.J.