public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
@ 2012-08-08 23:59 Roland McGrath
  2012-08-09 11:16 ` Joseph S. Myers
  2012-08-09 15:17 ` Richard Henderson
  0 siblings, 2 replies; 9+ messages in thread
From: Roland McGrath @ 2012-08-08 23:59 UTC (permalink / raw)
  To: libc-ports

AIUI there is nothing like HWCAP bits defined by the ARM hardware or
generic ABI specs.  So the set of HWCAP_ARM_* bits and their values is
purely a Linuxism.  Hence, it does not belong in any libc code outside
of sysdeps/.../linux/ directories.

This is the first step at abstracting out the Linux-specific HWCAP checks
used in sysdeps/arm/ code.  It makes the C code testing HWCAP_ARM_VFP
use a macro ARM_HAVE_VFP instead.  A Linux-specific header defines this
to the check used now, (GLRO (dl_hwcap) & HWCAP_ARM_VFP).

IMHO, the natural place for ARM_HAVE_VFP would be sysdep.h.  But since
the Linux definition needs GLRO, that would mean sysdep.h including
ldsodefs.h, and when I tried that I got into include order hell that
didn't seem worth fighting.  And it seemed utterly wrong for each file
using ARM_HAVE_VFP to include ldsodefs.h just because that macro's
linux/arm/sysdep.h definition happens to need it, when the including
file doesn't itself actually use any ldsodefs.h symbols.  So instead I
just put the macro in ldsodefs.h, odd a place as that is for something
called ARM_HAVE_VFP in the abstract.  The other obvious alternative is
just to create a new header dedicated to this sort of thing, e.g.
<arm-features.h>.  I'm glad to do that instead if you prefer.

This change is not quite just a a no-op abstraction of the existing
logic.  I also made the generic sysdeps/arm/ code define ARM_HAVE_VFP to
a constant when __VFP_FP__ is predefined.  My rationale is that if the
compiler building libc is allowed to generate VFP instructions, then
we're already implicitly presuming the hardware exists at runtime and so
we might as well skip the explicit runtime checks in libc too.

I did a basic compile test on arm-linux-gnueabi (cross).
I only used a compiler that does predefine __VFP_FP__, but
I did verify the build with the #if test of that diked out.

Ok?


Thanks,
Roland


ports/ChangeLog.arm
	* sysdeps/arm/ldsodefs.h [__VFP_FP__] (ARM_HAVE_VFP): New macro.
	* sysdeps/unix/sysv/linux/arm/ldsodefs.h
	[!__VFP_FP__ && !__ASSEMBLER__] (ARM_HAVE_VFP): New macro.
	* sysdeps/arm/fclrexcpt.c: Use ARM_HAVE_VFP instead of hwcap bits.
	* sysdeps/arm/fedisblxcpt.c: Likewise.
	* sysdeps/arm/feenablxcpt.c: Likewise.
	* sysdeps/arm/fegetenv.c: Likewise.
	* sysdeps/arm/fegetexcept.c: Likewise.
	* sysdeps/arm/fegetround.c: Likewise.
	* sysdeps/arm/feholdexcpt.c: Likewise.
	* sysdeps/arm/fesetenv.c: Likewise.
	* sysdeps/arm/fesetround.c: Likewise.
	* sysdeps/arm/feupdateenv.c: Likewise.
	* sysdeps/arm/fgetexcptflg.c: Likewise.
	* sysdeps/arm/fraiseexcpt.c: Likewise.
	* sysdeps/arm/fsetexcptflg.c: Likewise.
	* sysdeps/arm/ftestexcept.c: Likewise.
	* sysdeps/arm/setfpucw.c: Likewise.


diff --git a/ports/sysdeps/arm/fclrexcpt.c b/ports/sysdeps/arm/fclrexcpt.c
index ddedc35..c9914d6 100644
--- a/ports/sysdeps/arm/fclrexcpt.c
+++ b/ports/sysdeps/arm/fclrexcpt.c
@@ -1,5 +1,5 @@
 /* Clear given exceptions in current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feclearexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fedisblxcpt.c b/ports/sysdeps/arm/fedisblxcpt.c
index c9c62a4..ef6edc7 100644
--- a/ports/sysdeps/arm/fedisblxcpt.c
+++ b/ports/sysdeps/arm/fedisblxcpt.c
@@ -1,5 +1,5 @@
 /* Disable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fedisableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c
index 3b2b934..6e9a952 100644
--- a/ports/sysdeps/arm/feenablxcpt.c
+++ b/ports/sysdeps/arm/feenablxcpt.c
@@ -1,5 +1,5 @@
 /* Enable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
 #include <sysdep.h>
 
 int
 feenableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/fegetenv.c b/ports/sysdeps/arm/fegetenv.c
index c638635..45613ed 100644
--- a/ports/sysdeps/arm/fegetenv.c
+++ b/ports/sysdeps/arm/fegetenv.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,10 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fegetenv (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
       _FPU_GETCW (temp);
diff --git a/ports/sysdeps/arm/fegetexcept.c b/ports/sysdeps/arm/fegetexcept.c
index 929d6c5..9c4c221 100644
--- a/ports/sysdeps/arm/fegetexcept.c
+++ b/ports/sysdeps/arm/fegetexcept.c
@@ -1,5 +1,5 @@
 /* Get floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001
 
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetexcept (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fegetround.c b/ports/sysdeps/arm/fegetround.c
index df10497..4a7a476 100644
--- a/ports/sysdeps/arm/fegetround.c
+++ b/ports/sysdeps/arm/fegetround.c
@@ -1,5 +1,5 @@
 /* Return current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetround (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/feholdexcpt.c b/ports/sysdeps/arm/feholdexcpt.c
index 4aed48b..74602a8 100644
--- a/ports/sysdeps/arm/feholdexcpt.c
+++ b/ports/sysdeps/arm/feholdexcpt.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feholdexcept (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 6137032..474a9b4 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fesetround.c b/ports/sysdeps/arm/fesetround.c
index 997bd98..99034aa 100644
--- a/ports/sysdeps/arm/fesetround.c
+++ b/ports/sysdeps/arm/fesetround.c
@@ -1,5 +1,5 @@
 /* Set current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fesetround (int round)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t temp;
 
diff --git a/ports/sysdeps/arm/feupdateenv.c b/ports/sysdeps/arm/feupdateenv.c
index 98f2654..3b7a239 100644
--- a/ports/sysdeps/arm/feupdateenv.c
+++ b/ports/sysdeps/arm/feupdateenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment and raise exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feupdateenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fgetexcptflg.c b/ports/sysdeps/arm/fgetexcptflg.c
index 41661a2..4e1b74e 100644
--- a/ports/sysdeps/arm/fgetexcptflg.c
+++ b/ports/sysdeps/arm/fgetexcptflg.c
@@ -1,5 +1,5 @@
 /* Store current representation for exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
 #include <sysdep.h>
 
 int
 __fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fraiseexcpt.c b/ports/sysdeps/arm/fraiseexcpt.c
index 0a43688..6e56343 100644
--- a/ports/sysdeps/arm/fraiseexcpt.c
+++ b/ports/sysdeps/arm/fraiseexcpt.c
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,15 +20,12 @@
 #include <fenv.h>
 #include <float.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feraiseexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       int fpscr;
       const float fp_zero = 0.0, fp_one = 1.0, fp_max = FLT_MAX,
diff --git a/ports/sysdeps/arm/fsetexcptflg.c b/ports/sysdeps/arm/fsetexcptflg.c
index bee51a9..690724a 100644
--- a/ports/sysdeps/arm/fsetexcptflg.c
+++ b/ports/sysdeps/arm/fsetexcptflg.c
@@ -1,5 +1,5 @@
 /* Set floating-point environment exception handling.
-   Copyright (C) 1997,98,99,2000,01,05,08,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,15 +20,12 @@
 #include <math.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetexceptflag (const fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/ftestexcept.c b/ports/sysdeps/arm/ftestexcept.c
index 06817d2..1219ec2 100644
--- a/ports/sysdeps/arm/ftestexcept.c
+++ b/ports/sysdeps/arm/ftestexcept.c
@@ -1,5 +1,5 @@
 /* Test exception in current environment.
-   Copyright (C) 1997, 1998, 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <fenv.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fetestexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/ldsodefs.h b/ports/sysdeps/arm/ldsodefs.h
index 73375b6..199a2e3 100644
--- a/ports/sysdeps/arm/ldsodefs.h
+++ b/ports/sysdeps/arm/ldsodefs.h
@@ -35,6 +35,23 @@ struct La_arm_retval;
 				   uintptr_t *, const struct La_arm_regs *,  \
 				   struct La_arm_retval *, const char *)
 
+/* This makes more sense in sysdep.h, but since OS-specific definitions
+   will want to use GLRO (dl_hwcap), using this macro will necessitate an
+   #include <ldsodefs.h> and include order makes doing that inside sysdep.h
+   infeasible.  So instead we require users of this macro to do an
+   #include <ldsodefs.h> just to facilitate such OS-specific definitions.
+
+   If we don't define it here, an OS-specific ldsodefs.h file should define
+   ARM_HAVE_VFP to an appropriate expression for testing at runtime whether
+   the VFP hardware is present.  */
+
+#ifdef __VFP_FP__
+/* The compiler is generating VFP instructions, so we're already
+   assuming the hardware exists.  */
+# undef ARM_HAVE_VFP
+# define ARM_HAVE_VFP	1
+#endif
+
 #include_next <ldsodefs.h>
 
 #endif
diff --git a/ports/sysdeps/arm/setfpucw.c b/ports/sysdeps/arm/setfpucw.c
index d0cea32..5933afe 100644
--- a/ports/sysdeps/arm/setfpucw.c
+++ b/ports/sysdeps/arm/setfpucw.c
@@ -1,5 +1,5 @@
 /* Set the FPU control word.
-   Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,12 @@
 #include <math.h>
 #include <fpu_control.h>
 
-#include <unistd.h>
 #include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 void
 __setfpucw (fpu_control_t set)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t cw;
 
diff --git a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
index 8980bb1..fc4e955 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
@@ -58,4 +58,12 @@
     [EI_OSABI] = EXTRA_OSABI				\
   }
 
+/* This might make more sense in sysdep.h, but since it uses GLRO
+   it necessitates an #include <ldsodefs.h> and include order makes
+   doing that inside sysdep.h infeasible.  */
+#ifndef __VFP_FP__
+# undef ARM_HAVE_VFP
+# define ARM_HAVE_VFP	(GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+#endif
+
 #endif

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-08 23:59 [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code Roland McGrath
@ 2012-08-09 11:16 ` Joseph S. Myers
  2012-08-09 17:10   ` Roland McGrath
  2012-08-09 15:17 ` Richard Henderson
  1 sibling, 1 reply; 9+ messages in thread
From: Joseph S. Myers @ 2012-08-09 11:16 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Wed, 8 Aug 2012, Roland McGrath wrote:

> This change is not quite just a a no-op abstraction of the existing
> logic.  I also made the generic sysdeps/arm/ code define ARM_HAVE_VFP to
> a constant when __VFP_FP__ is predefined.  My rationale is that if the
> compiler building libc is allowed to generate VFP instructions, then
> we're already implicitly presuming the hardware exists at runtime and so
> we might as well skip the explicit runtime checks in libc too.

__VFP_FP__ doesn't mean "generating VFP instructions", it means 
"floating-point types have VFP layout" (i.e. normal IEEE floating-point 
with the same byte ordering / endianness as integer types, as opposed to 
FPA format), which is always true for EABI.  The relevant test for 
"generating VFP instructions" is defined __VFP_FP__ && !defined __SOFTFP__ 
(which can be simplified to just !defined __SOFTFP__ given that EABI is 
assumed).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-08 23:59 [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code Roland McGrath
  2012-08-09 11:16 ` Joseph S. Myers
@ 2012-08-09 15:17 ` Richard Henderson
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2012-08-09 15:17 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On 08/08/2012 04:59 PM, Roland McGrath wrote:
> -#include <unistd.h>
>  #include <ldsodefs.h>
> -#include <dl-procinfo.h>
> -#include <sysdep.h>
>  
>  int
>  fedisableexcept (int excepts)
...
> -#include <unistd.h>
> -#include <ldsodefs.h>
> -#include <dl-procinfo.h>
>  #include <sysdep.h>
>  
>  int
>  feenableexcept (int excepts)

One of these things is not like the other.


r~

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 11:16 ` Joseph S. Myers
@ 2012-08-09 17:10   ` Roland McGrath
  2012-08-09 17:21     ` Carlos O'Donell
  2012-08-09 18:49     ` Joseph S. Myers
  0 siblings, 2 replies; 9+ messages in thread
From: Roland McGrath @ 2012-08-09 17:10 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

> __VFP_FP__ doesn't mean "generating VFP instructions", it means 
> "floating-point types have VFP layout" (i.e. normal IEEE floating-point 
> with the same byte ordering / endianness as integer types, as opposed to 
> FPA format), which is always true for EABI.  The relevant test for 
> "generating VFP instructions" is defined __VFP_FP__ && !defined __SOFTFP__ 
> (which can be simplified to just !defined __SOFTFP__ given that EABI is 
> assumed).

Thanks for the explanation.  I've changed the conditionals.  On further
reflection I also decided that using ldsodefs.h was just too ugly and I've
added an arm-features.h instead.

How does this look now?


Thanks,
Roland


ports/ChangeLog.arm
2012-08-09  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/arm/arm-features.h: New file.
	* sysdeps/unix/sysv/linux/arm/arm-features.h: New file.
	* sysdeps/arm/fclrexcpt.c: Use ARM_HAVE_VFP instead of hwcap bits.
	* sysdeps/arm/fedisblxcpt.c: Likewise.
	* sysdeps/arm/feenablxcpt.c: Likewise.
	* sysdeps/arm/fegetenv.c: Likewise.
	* sysdeps/arm/fegetexcept.c: Likewise.
	* sysdeps/arm/fegetround.c: Likewise.
	* sysdeps/arm/feholdexcpt.c: Likewise.
	* sysdeps/arm/fesetenv.c: Likewise.
	* sysdeps/arm/fesetround.c: Likewise.
	* sysdeps/arm/feupdateenv.c: Likewise.
	* sysdeps/arm/fgetexcptflg.c: Likewise.
	* sysdeps/arm/fraiseexcpt.c: Likewise.
	* sysdeps/arm/fsetexcptflg.c: Likewise.
	* sysdeps/arm/ftestexcept.c: Likewise.
	* sysdeps/arm/setfpucw.c: Likewise.


diff --git a/ports/sysdeps/arm/arm-features.h b/ports/sysdeps/arm/arm-features.h
new file mode 100644
index 0000000..0f99b3a
--- /dev/null
+++ b/ports/sysdeps/arm/arm-features.h
@@ -0,0 +1,34 @@
+/* Macros to test for CPU features on ARM.  Generic ARM version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _ARM_ARM_FEATURES_H
+#define _ARM_ARM_FEATURES_H 1
+
+/* An OS-specific arm-features.h file should define ARM_HAVE_VFP to
+   an appropriate expression for testing at runtime whether the VFP
+   hardware is present.  We'll then redefine it to a constant if we
+   know at compile time that we can assume VFP.  */
+
+#ifndef __SOFTFP__
+/* The compiler is generating VFP instructions, so we're already
+   assuming the hardware exists.  */
+# undef ARM_HAVE_VFP
+# define ARM_HAVE_VFP	1
+#endif
+
+#endif  /* arm-features.h */
diff --git a/ports/sysdeps/arm/fclrexcpt.c b/ports/sysdeps/arm/fclrexcpt.c
index ddedc35..23435fb 100644
--- a/ports/sysdeps/arm/fclrexcpt.c
+++ b/ports/sysdeps/arm/fclrexcpt.c
@@ -1,5 +1,5 @@
 /* Clear given exceptions in current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feclearexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fedisblxcpt.c b/ports/sysdeps/arm/fedisblxcpt.c
index c9c62a4..5b63d9a 100644
--- a/ports/sysdeps/arm/fedisblxcpt.c
+++ b/ports/sysdeps/arm/fedisblxcpt.c
@@ -1,5 +1,5 @@
 /* Disable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fedisableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c
index 3b2b934..c5f0630 100644
--- a/ports/sysdeps/arm/feenablxcpt.c
+++ b/ports/sysdeps/arm/feenablxcpt.c
@@ -1,5 +1,5 @@
 /* Enable floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feenableexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int new_exc, old_exc;
 
diff --git a/ports/sysdeps/arm/fegetenv.c b/ports/sysdeps/arm/fegetenv.c
index c638635..1e8063c 100644
--- a/ports/sysdeps/arm/fegetenv.c
+++ b/ports/sysdeps/arm/fegetenv.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment.
-   Copyright (C) 1997,98,99,2000,01,05,10 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fegetenv (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
       _FPU_GETCW (temp);
diff --git a/ports/sysdeps/arm/fegetexcept.c b/ports/sysdeps/arm/fegetexcept.c
index 929d6c5..a71e7da 100644
--- a/ports/sysdeps/arm/fegetexcept.c
+++ b/ports/sysdeps/arm/fegetexcept.c
@@ -1,5 +1,5 @@
 /* Get floating-point exceptions.
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <philb@gnu.org>, 2001
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetexcept (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fegetround.c b/ports/sysdeps/arm/fegetround.c
index df10497..0ed3dc9 100644
--- a/ports/sysdeps/arm/fegetround.c
+++ b/ports/sysdeps/arm/fegetround.c
@@ -1,5 +1,5 @@
 /* Return current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fegetround (void)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/feholdexcpt.c b/ports/sysdeps/arm/feholdexcpt.c
index 4aed48b..cfa11d7 100644
--- a/ports/sysdeps/arm/feholdexcpt.c
+++ b/ports/sysdeps/arm/feholdexcpt.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feholdexcept (fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long int temp;
 
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 6137032..2fad61d 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fesetround.c b/ports/sysdeps/arm/fesetround.c
index 997bd98..6de1644 100644
--- a/ports/sysdeps/arm/fesetround.c
+++ b/ports/sysdeps/arm/fesetround.c
@@ -1,5 +1,5 @@
 /* Set current rounding direction.
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fesetround (int round)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t temp;
 
diff --git a/ports/sysdeps/arm/feupdateenv.c b/ports/sysdeps/arm/feupdateenv.c
index 98f2654..c0ed06e 100644
--- a/ports/sysdeps/arm/feupdateenv.c
+++ b/ports/sysdeps/arm/feupdateenv.c
@@ -1,5 +1,5 @@
 /* Install given floating-point environment and raise exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __feupdateenv (const fenv_t *envp)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned int temp;
 
diff --git a/ports/sysdeps/arm/fgetexcptflg.c b/ports/sysdeps/arm/fgetexcptflg.c
index 41661a2..7b6d669 100644
--- a/ports/sysdeps/arm/fgetexcptflg.c
+++ b/ports/sysdeps/arm/fgetexcptflg.c
@@ -1,5 +1,5 @@
 /* Store current representation for exceptions.
-   Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -19,16 +19,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       unsigned long temp;
 
diff --git a/ports/sysdeps/arm/fraiseexcpt.c b/ports/sysdeps/arm/fraiseexcpt.c
index 0a43688..cb0f75c 100644
--- a/ports/sysdeps/arm/fraiseexcpt.c
+++ b/ports/sysdeps/arm/fraiseexcpt.c
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,16 +19,13 @@
 #include <fpu_control.h>
 #include <fenv.h>
 #include <float.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 feraiseexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       int fpscr;
       const float fp_zero = 0.0, fp_one = 1.0, fp_max = FLT_MAX,
diff --git a/ports/sysdeps/arm/fsetexcptflg.c b/ports/sysdeps/arm/fsetexcptflg.c
index bee51a9..f26268d 100644
--- a/ports/sysdeps/arm/fsetexcptflg.c
+++ b/ports/sysdeps/arm/fsetexcptflg.c
@@ -1,5 +1,5 @@
 /* Set floating-point environment exception handling.
-   Copyright (C) 1997,98,99,2000,01,05,08,11 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,16 +19,13 @@
 #include <fenv.h>
 #include <math.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 __fesetexceptflag (const fexcept_t *flagp, int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/ftestexcept.c b/ports/sysdeps/arm/ftestexcept.c
index 06817d2..8e37db1 100644
--- a/ports/sysdeps/arm/ftestexcept.c
+++ b/ports/sysdeps/arm/ftestexcept.c
@@ -1,5 +1,5 @@
 /* Test exception in current environment.
-   Copyright (C) 1997, 1998, 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <fenv.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 int
 fetestexcept (int excepts)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fexcept_t temp;
 
diff --git a/ports/sysdeps/arm/setfpucw.c b/ports/sysdeps/arm/setfpucw.c
index d0cea32..0947e27 100644
--- a/ports/sysdeps/arm/setfpucw.c
+++ b/ports/sysdeps/arm/setfpucw.c
@@ -1,5 +1,5 @@
 /* Set the FPU control word.
-   Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,16 +18,13 @@
 
 #include <math.h>
 #include <fpu_control.h>
+#include <arm-features.h>
 
-#include <unistd.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-#include <sysdep.h>
 
 void
 __setfpucw (fpu_control_t set)
 {
-  if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+  if (ARM_HAVE_VFP)
     {
       fpu_control_t cw;
 
diff --git a/ports/sysdeps/unix/sysv/linux/arm/arm-features.h b/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
new file mode 100644
index 0000000..f20a705
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/arm/arm-features.h
@@ -0,0 +1,30 @@
+/* Macros to test for CPU features on ARM.  Linux version.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LINUX_ARM_FEATURES_H
+#define _LINUX_ARM_FEATURES_H 1
+
+#ifndef __ASSEMBLER__
+# include <ldsodefs.h>
+
+# define ARM_HAVE_VFP	(GLRO (dl_hwcap) & HWCAP_ARM_VFP)
+#endif
+
+#include_next <arm-features.h>
+
+#endif  /* arm-features.h */

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 17:10   ` Roland McGrath
@ 2012-08-09 17:21     ` Carlos O'Donell
  2012-08-09 18:47       ` Joseph S. Myers
  2012-08-09 18:49     ` Joseph S. Myers
  1 sibling, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2012-08-09 17:21 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Joseph S. Myers, libc-ports

On 8/9/2012 1:10 PM, Roland McGrath wrote:
>> __VFP_FP__ doesn't mean "generating VFP instructions", it means 
>> "floating-point types have VFP layout" (i.e. normal IEEE floating-point 
>> with the same byte ordering / endianness as integer types, as opposed to 
>> FPA format), which is always true for EABI.  The relevant test for 
>> "generating VFP instructions" is defined __VFP_FP__ && !defined __SOFTFP__ 
>> (which can be simplified to just !defined __SOFTFP__ given that EABI is 
>> assumed).
> 
> Thanks for the explanation.  I've changed the conditionals.  On further
> reflection I also decided that using ldsodefs.h was just too ugly and I've
> added an arm-features.h instead.
> 
> How does this look now?
> 
> 
> Thanks,
> Roland
> 
> 
> ports/ChangeLog.arm
> 2012-08-09  Roland McGrath  <roland@hack.frob.com>
> 
> 	* sysdeps/arm/arm-features.h: New file.
> 	* sysdeps/unix/sysv/linux/arm/arm-features.h: New file.

If we are going to make a new internal header for this kind of thing
can you please add a "Internal Headers" section in the "Internals Documentation"
part of the wiki and mention briefly "*-features.h" and when and why you might
use it?

http://sourceware.org/glibc/wiki/HomePage#InternalsDocumentation

Alternatively add this to manual/maint.texi please :-)

Cheers,
Carlos.

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 17:21     ` Carlos O'Donell
@ 2012-08-09 18:47       ` Joseph S. Myers
  2012-08-09 18:50         ` Roland McGrath
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph S. Myers @ 2012-08-09 18:47 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Roland McGrath, libc-ports

On Thu, 9 Aug 2012, Carlos O'Donell wrote:

> If we are going to make a new internal header for this kind of thing
> can you please add a "Internal Headers" section in the "Internals Documentation"
> part of the wiki and mention briefly "*-features.h" and when and why you might
> use it?

There are loads of internal headers used for various purposes and I don't 
think we need to claim to invent a convention for the naming of a very 
small subset of them.  Each header is given whatever name seems most 
appropriately descriptive of its purpose.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 17:10   ` Roland McGrath
  2012-08-09 17:21     ` Carlos O'Donell
@ 2012-08-09 18:49     ` Joseph S. Myers
  2012-08-09 19:44       ` Roland McGrath
  1 sibling, 1 reply; 9+ messages in thread
From: Joseph S. Myers @ 2012-08-09 18:49 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-ports

On Thu, 9 Aug 2012, Roland McGrath wrote:

> > __VFP_FP__ doesn't mean "generating VFP instructions", it means 
> > "floating-point types have VFP layout" (i.e. normal IEEE floating-point 
> > with the same byte ordering / endianness as integer types, as opposed to 
> > FPA format), which is always true for EABI.  The relevant test for 
> > "generating VFP instructions" is defined __VFP_FP__ && !defined __SOFTFP__ 
> > (which can be simplified to just !defined __SOFTFP__ given that EABI is 
> > assumed).
> 
> Thanks for the explanation.  I've changed the conditionals.  On further
> reflection I also decided that using ldsodefs.h was just too ugly and I've
> added an arm-features.h instead.
> 
> How does this look now?

This version is OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 18:47       ` Joseph S. Myers
@ 2012-08-09 18:50         ` Roland McGrath
  0 siblings, 0 replies; 9+ messages in thread
From: Roland McGrath @ 2012-08-09 18:50 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Carlos O'Donell, libc-ports

> There are loads of internal headers used for various purposes and I don't 
> think we need to claim to invent a convention for the naming of a very 
> small subset of them.  Each header is given whatever name seems most 
> appropriately descriptive of its purpose.

I agree.

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

* Re: [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code
  2012-08-09 18:49     ` Joseph S. Myers
@ 2012-08-09 19:44       ` Roland McGrath
  0 siblings, 0 replies; 9+ messages in thread
From: Roland McGrath @ 2012-08-09 19:44 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

> This version is OK.

Thanks.  I've committed it.

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

end of thread, other threads:[~2012-08-09 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-08 23:59 [PATCH roland/arm-hwcap-vfp] don't use HWCAP_ARM_* in OS-independent code Roland McGrath
2012-08-09 11:16 ` Joseph S. Myers
2012-08-09 17:10   ` Roland McGrath
2012-08-09 17:21     ` Carlos O'Donell
2012-08-09 18:47       ` Joseph S. Myers
2012-08-09 18:50         ` Roland McGrath
2012-08-09 18:49     ` Joseph S. Myers
2012-08-09 19:44       ` Roland McGrath
2012-08-09 15:17 ` Richard Henderson

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).