public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it
@ 2014-02-13 15:43 adrian at humboldt dot co.uk
  2014-02-13 17:32 ` [Bug math/16576] [powerpc] " jsm28 at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: adrian at humboldt dot co.uk @ 2014-02-13 15:43 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16576
           Summary: PowerPC: glibc attempts to use fsqrt instruction on
                    processors that do not implement it
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: adrian at humboldt dot co.uk

In sysdeps/powerpc/fpu/math_private.h, __CPU_HAS_FSQRT is set true on all 64
bit PowerPC processors. Recent 64-bit PowerPC processors (e5500 core) from
Freescale do not implement this instruction, causing any application using
sqrt() to fail.

  28 # if __WORDSIZE == 64 || defined _ARCH_PWR4
  29 #  define __CPU_HAS_FSQRT 1
  30 # else
  31 #  define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
  32 # endif

There is a patch for this in OpenEmbedded, but it provides a compile time fix
which is less useful for Linux distributions. A runtime probe for the existence
of the fsqrt instruction would be of wider use.

http://lists.openembedded.org/pipermail/openembedded-core/2012-September/068696.html

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


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

* [Bug math/16576] [powerpc] glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
@ 2014-02-13 17:32 ` jsm28 at gcc dot gnu.org
  2014-02-13 17:32 ` [Bug math/16576] PowerPC: " joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-13 17:32 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|                            |powerpc*-*-*
            Summary|PowerPC: glibc attempts to  |[powerpc] glibc attempts to
                   |use fsqrt instruction on    |use fsqrt instruction on
                   |processors that do not      |processors that do not
                   |implement it                |implement it

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


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

* [Bug math/16576] PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
  2014-02-13 17:32 ` [Bug math/16576] [powerpc] " jsm28 at gcc dot gnu.org
@ 2014-02-13 17:32 ` joseph at codesourcery dot com
  2014-02-13 19:59 ` [Bug math/16576] [powerpc] " adrian at humboldt dot co.uk
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: joseph at codesourcery dot com @ 2014-02-13 17:32 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
The correct compile-time test is _ARCH_PPCSQ (that's based on the same 
condition GCC uses to decide whether to generate fsqrt instructions 
itself).  Not __WORDSIZE == 64, not _ARCH_PWR4.

Has Freescale (or anyone else) added an HWCAP / HWCAP2 bit to the kernel 
to indicate whether fsqrt is available at runtime?  That's what's needed 
for any correct runtime probe (as opposed to the present incorrect probe 
based on PPC_FEATURE_64).

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


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

* [Bug math/16576] [powerpc] glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
  2014-02-13 17:32 ` [Bug math/16576] [powerpc] " jsm28 at gcc dot gnu.org
  2014-02-13 17:32 ` [Bug math/16576] PowerPC: " joseph at codesourcery dot com
@ 2014-02-13 19:59 ` adrian at humboldt dot co.uk
  2014-06-13  8:37 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: adrian at humboldt dot co.uk @ 2014-02-13 19:59 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Adrian Cox <adrian at humboldt dot co.uk> ---
Unfortunately there is no HWCAP bit for the presence (or absence) of fsqrt.

The best I can find in the kernel source is that fsqrt is available if
PPC_FEATURE_64 is set and PPC_FEATURE_BOOKE is not set.

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


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

* [Bug math/16576] [powerpc] glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
                   ` (2 preceding siblings ...)
  2014-02-13 19:59 ` [Bug math/16576] [powerpc] " adrian at humboldt dot co.uk
@ 2014-06-13  8:37 ` fweimer at redhat dot com
  2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
  2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  8:37 UTC (permalink / raw)
  To: glibc-bugs

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

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] 7+ messages in thread

* [Bug math/16576] [powerpc] glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
                   ` (3 preceding siblings ...)
  2014-06-13  8:37 ` fweimer at redhat dot com
@ 2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
  2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: azanella at linux dot vnet.ibm.com @ 2015-01-28 11:04 UTC (permalink / raw)
  To: glibc-bugs

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

Adhemerval Zanella Netto <azanella at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |azanella at linux dot vnet.ibm.com

--- Comment #3 from Adhemerval Zanella Netto <azanella at linux dot vnet.ibm.com> ---
Fixed upstream by 08cee2a464f614a6d4275b5af6c52481f1aa16e6.

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


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

* [Bug math/16576] [powerpc] glibc attempts to use fsqrt instruction on processors that do not implement it
  2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
                   ` (4 preceding siblings ...)
  2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
@ 2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: azanella at linux dot vnet.ibm.com @ 2015-01-28 11:04 UTC (permalink / raw)
  To: glibc-bugs

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

Adhemerval Zanella Netto <azanella at linux dot vnet.ibm.com> changed:

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

--- Comment #4 from Adhemerval Zanella Netto <azanella at linux dot vnet.ibm.com> ---
Fixed upstream by 08cee2a464f614a6d4275b5af6c52481f1aa16e6.

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


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

end of thread, other threads:[~2015-01-28 11:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 15:43 [Bug math/16576] New: PowerPC: glibc attempts to use fsqrt instruction on processors that do not implement it adrian at humboldt dot co.uk
2014-02-13 17:32 ` [Bug math/16576] [powerpc] " jsm28 at gcc dot gnu.org
2014-02-13 17:32 ` [Bug math/16576] PowerPC: " joseph at codesourcery dot com
2014-02-13 19:59 ` [Bug math/16576] [powerpc] " adrian at humboldt dot co.uk
2014-06-13  8:37 ` fweimer at redhat dot com
2015-01-28 11:04 ` azanella at linux dot vnet.ibm.com
2015-01-28 11:04 ` azanella at linux dot vnet.ibm.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).