This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/20787] float_t is defined as float incorrectly on x86_64 even if __FLT_EVAL_METHOD__ is 2


https://sourceware.org/bugzilla/show_bug.cgi?id=20787

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  56ede9ed59684a5802cc88733055453901f1c2f0 (commit)
      from  c650aa612ff622d843c6b6e5eeb183aae1a17eaa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=56ede9ed59684a5802cc88733055453901f1c2f0

commit 56ede9ed59684a5802cc88733055453901f1c2f0
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Nov 23 17:56:31 2016 +0000

    Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787).

    Bug 20787 reports that, while float_t and double_t for 32-bit x86
    properly respect -mfpmath=sse, for x86_64 they fail to reflect
    -mfpmath=387, which is valid if unusual and results in FLT_EVAL_METHOD
    being 2.  This patch fixes the definitions to respect
    __FLT_EVAL_METHOD__ in that case, arranging for the test that the
    types correspond with FLT_EVAL_METHOD to be run with both -mfpmath=387
    and -mfpmath=sse.

    Note: this patch will also have the effect of making float_t and
    double_t be long double for x86_64 with -mfpmath=sse+387, when
    FLT_EVAL_METHOD is -1.  It seems reasonable for x86_64 to be
    consistent with 32-bit x86 in this case (and that definition is
    conservatively safe, in that it makes the types correspond to the
    widest evaluation format that might be used).

    Tested for x86-64 and x86.

        [BZ #20787]
        * sysdeps/x86/bits/mathdef.h (float_t): Do not define to float if
        [__x86_64__] when __FLT_EVAL_METHOD__ is nonzero.
        (double_t): Do not define to double if [__x86_64__] when
        __FLT_EVAL_METHOD__ is nonzero.
        * sysdeps/x86/fpu/test-flt-eval-method-387.c: New file.
        * sysdeps/x86/fpu/test-flt-eval-method-sse.c: Likewise.
        * sysdeps/x86/fpu/Makefile [$(subdir) = math] (tests): Add
        test-flt-eval-method-387 and test-flt-eval-method-sse.
        [$(subdir) = math] (CFLAGS-test-flt-eval-method-387.c): New
        variable.
        [$(subdir) = math] (CFLAGS-test-flt-eval-method-sse.c): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                  |   15 +++++++++++++++
 sysdeps/x86/bits/mathdef.h                 |    3 ++-
 sysdeps/x86/fpu/Makefile                   |    6 +++++-
 sysdeps/x86/fpu/test-flt-eval-method-387.c |    1 +
 sysdeps/x86/fpu/test-flt-eval-method-sse.c |    1 +
 5 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/x86/fpu/test-flt-eval-method-387.c
 create mode 100644 sysdeps/x86/fpu/test-flt-eval-method-sse.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]