public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16600] Glibc floating-point tests fail on VFPv4 platforms
  2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
@ 2014-02-18  7:16 ` y.gribov at samsung dot com
  2014-02-18 17:34 ` jsm28 at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: y.gribov at samsung dot com @ 2014-02-18  7:16 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Yury Gribov <y.gribov at samsung dot com> ---
Created attachment 7425
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7425&action=edit
Testcase for MAD differences

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms
@ 2014-02-18  7:16 y.gribov at samsung dot com
  2014-02-18  7:16 ` [Bug math/16600] " y.gribov at samsung dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: y.gribov at samsung dot com @ 2014-02-18  7:16 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16600
           Summary: Glibc floating-point tests fail on VFPv4 platforms
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: y.gribov at samsung dot com
                CC: jsm28 at gcc dot gnu.org, v.garbuzov at samsung dot com
            Target: arm*-*-*

Created attachment 7424
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7424&action=edit
Testcase for powf failure

I've recently tried rebuilding glibc trunk for Cortex-A15 with -mfpu=vfpv4
compiler flags
and ran into some issues with glibc regression tests. Attached testcase
illustrates the issue:

Glibc built for VFPv3 yields 0x1.477db2p+2:

 $ arm-v7a15-linux-gnueabi-gcc -O0 -fno-builtin powf_test.c -lm
 $ LD_LIBRARY_PATH=/vfpv3-master ./a.out
 powf(1.1875f, 9.5f) == 5.11705 0x1.477db2p+2
 pow(1.1875, 9.5)    == 5.11705 0x1.477db2p+2

but Glibc built for VFPv4 yields different result, 0x1.477dbp+2:

 $ LD_LIBRARY_PATH=/vfpv4-master ./a.out
 powf(1.1875f, 9.5f) == 5.11705 0x1.477dbp+2
 pow(1.1875, 9.5)    == 5.11705 0x1.477db2p+2

Note that for both versions double-precision result is 0x1.477db2p+2
(i.e. matching single-precision VFPv3).

After some investigation I discovered that differences are caused
by fused-multiply-add instructions (vfma and friends) in VFPv4.
Their results may be different from VFPv3's fmac family
(because of extra precision bits in fused instructions).
I have attached a trivial testcase which shows how x + y*z
gives different results on VFPv3 and VFPv4:

VFPv4 (vfma and unfused operations yield different results):
 $ arm-v7a15-linux-gnueabi-gcc -O2 -mfpu=vfpv4 mad.c
 $ ./a.out
 Multiply and add        : -0.118126 -0x1.e3d8p-4 3186748416
 Multiply and add (fused): -0.118126 -0x1.e3d80cp-4 3186748422
 Multiply and add (exact): -0.118126 -0x1.e3d80cp-4 3186748422

So in summary, trunk glibc built with -mfpu=vfpv4
returns unexpected results from standard math functions like powf.

Platform info:
1) I'm using trunk glibc (Feb 17 2014) and GCC (r207777).
2) Cross GCC VFPv3 was configured with
 $HOME/gcc/gcc-master/configure --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=arm-v7a15-linux-gnueabi
--prefix=/home/ygribov/install/gcc-master-arm-full-vfpv3
--with-sysroot=/home/ygribov/install/gcc-master-arm-full-vfpv3/arm-v7a15-linux-gnueabi/sys-root/
--disable-libmudflap --disable-libssp --disable-nls --disable-libstdcxx-pch
--with-interwork --with-mode=arm --with-fpu=vfpv3 --with-cpu=cortex-a15
--with-tune=cortex-a15 --with-float=softfp --enable-libgomp
--enable-poison-system-directories --enable-long-long --enable-threads
--enable-languages=c,c++ --enable-shared --with-gnu-as --with-gnu-ld
--with-build-time-tools=/home/ygribov/install/gcc-master-arm-full-vfpv3
3) Cross GCC VFPv4 is same but --with-fpu=vfpv4.
4) Glibc VFPv3 was configured with
 $ PATH=~/install/gcc-master-arm-full-vfpv3/bin:$PATH
~/src/glibc-master/configure --prefix=/usr
--with-headers=/home/ygribov/install/gcc-master-arm-full-vfpv4/arm-v7a15-linux-gnueabi/sys-root/./usr/include
--build=x86_64-pc-linux-gnu --host=arm-v7a15-linux-gnueabi --disable-profile
--without-gd --without-cvs --enable-kernel= --disable-multi-arch
5) Glibc VFPv4 is same but with VFPv4 cross-compiler.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug math/16600] Glibc floating-point tests fail on VFPv4 platforms
  2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
  2014-02-18  7:16 ` [Bug math/16600] " y.gribov at samsung dot com
@ 2014-02-18 17:34 ` jsm28 at gcc dot gnu.org
  2014-02-21 17:22 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-18 17:34 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Please run "make regen-ulps" and send the diffs to libc-alpha.  (It would be
helpful if you could then do this again during the freeze period of each
release cycle, after I've done the initial regeneration from scratch of ARM
ulps; in cases like this, we need people with different hardware to do "make
regen-ulps" during each release freeze so the ulps reflect all the known cases
by release time.)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug math/16600] Glibc floating-point tests fail on VFPv4 platforms
  2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
  2014-02-18  7:16 ` [Bug math/16600] " y.gribov at samsung dot com
  2014-02-18 17:34 ` jsm28 at gcc dot gnu.org
@ 2014-02-21 17:22 ` cvs-commit at gcc dot gnu.org
  2014-02-21 17:26 ` jsm28 at gcc dot gnu.org
  2014-06-13  8:13 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-02-21 17:22 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=16600

--- Comment #4 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  a5d82e4e34d627f6347b8dbd79046db7df5f93b6 (commit)
      from  9a80491d4931c9bc0f65887b7f67346f866cf1b9 (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=a5d82e4e34d627f6347b8dbd79046db7df5f93b6

commit a5d82e4e34d627f6347b8dbd79046db7df5f93b6
Author: Yury Gribov <y.gribov@samsung.com>
Date:   Fri Feb 21 17:21:13 2014 +0000

    Update ARM ulps for VFPv4 (bug 16600).

        [BZ #16600]
        * sysdeps/arm/libm-test-ulps: Update for VFPv4.

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

Summary of changes:
 ChangeLog                  |    5 +
 NEWS                       |    2 +-
 sysdeps/arm/libm-test-ulps |  367 +++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 351 insertions(+), 23 deletions(-)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug math/16600] Glibc floating-point tests fail on VFPv4 platforms
  2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
                   ` (2 preceding siblings ...)
  2014-02-21 17:22 ` cvs-commit at gcc dot gnu.org
@ 2014-02-21 17:26 ` jsm28 at gcc dot gnu.org
  2014-06-13  8:13 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-21 17:26 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Patch committed.  Such variations are expected when building with a fused
operation available to the compiler (they might also depend on the compiler
version).

Release freeze gets announced on libc-alpha (generally around the end of June
and December), after which I'll do the initial regeneration of libm-test-ulps
for ARM.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug math/16600] Glibc floating-point tests fail on VFPv4 platforms
  2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
                   ` (3 preceding siblings ...)
  2014-02-21 17:26 ` jsm28 at gcc dot gnu.org
@ 2014-06-13  8:13 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  8:13 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-13  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18  7:16 [Bug math/16600] New: Glibc floating-point tests fail on VFPv4 platforms y.gribov at samsung dot com
2014-02-18  7:16 ` [Bug math/16600] " y.gribov at samsung dot com
2014-02-18 17:34 ` jsm28 at gcc dot gnu.org
2014-02-21 17:22 ` cvs-commit at gcc dot gnu.org
2014-02-21 17:26 ` jsm28 at gcc dot gnu.org
2014-06-13  8:13 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).