public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
@ 2010-10-30  1:06 Jing Yu
       [not found] ` <AANLkTinGLSX0U2PR0oM753NhFM8Poygx6qf3E-iSgM=a@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Jing Yu @ 2010-10-30  1:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: hjl.tools, Lu, Hongjiu, ubizjak, David Turner, Maxim Kuvyrkov

sincos() (including sincos(), sincosf(), sincosl()) has been added to
Bionic and will be included in the coming Android NDK release.

Thanks,
Jing

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
       [not found] ` <AANLkTinGLSX0U2PR0oM753NhFM8Poygx6qf3E-iSgM=a@mail.gmail.com>
@ 2010-10-31 23:03   ` Maxim Kuvyrkov
  0 siblings, 0 replies; 8+ messages in thread
From: Maxim Kuvyrkov @ 2010-10-31 23:03 UTC (permalink / raw)
  To: David Turner; +Cc: Jing Yu, gcc-patches, hjl.tools, Lu, Hongjiu, ubizjak

On 10/31/2010 07:48 AM, David Turner wrote:
>
>
> On Fri, Oct 29, 2010 at 2:09 PM, Jing Yu <jingyu@google.com
> <mailto:jingyu@google.com>> wrote:
>
>     sincos() (including sincos(), sincosf(), sincosl()) has been added to
>     Bionic and will be included in the coming Android NDK release.

Great!  We can leave the default setting for TARGET_HAS_SINCOS in GCC 
4.6 as (OPTION_GLIBC || OPTION_BIONIC).

> Last time we talked about it, the plan was to provide this through a
> local patch.

I agree that this is the right way to support previous version of Android.

Thanks,

-- 
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
  2010-09-05  7:21     ` t66667
@ 2010-09-05  8:21       ` H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 2010-09-05  8:21 UTC (permalink / raw)
  To: t66667; +Cc: gcc-patches

On Sat, Sep 4, 2010 at 9:01 PM, t66667@gmail.com <t66667@gmail.com> wrote:
> Hello:
> On 31/08/2010 1:53 AM, H.J. Lu wrote:
>>
>> On Mon, Aug 30, 2010 at 7:57 AM, Richard Guenther
>> <richard.guenther@gmail.com>  wrote:
>>>
>>> On Mon, Aug 30, 2010 at 4:40 PM, H.J. Lu<hongjiu.lu@intel.com>  wrote:
>>>>
>>>> Hi,
>>>>
>>>> On x86, sincos is always available if x87 FPU fsincos is available.
>>>> This patch enables TARGET_HAS_SINCOS for -ffast-math and x87 FPU.  Also
>>>> x86 Bionic C library doesn't provide sincos and we shouldn't enable
>>>> TARGET_HAS_SINCOS with OPTION_BIONIC on x86.  OK for trunk?
>>>
>>> Hm.  Shouldn't it be conditional on USE_FANCY_MATH_387
>>> &&  !NO_FANCY_MATH_387 as well?
>>
>> You are right.  Here is the updated patch.
>>
> For your info, I used revision 163859, is this patch applied?

My patch only fixes x86, not ARM.

> I get link error for the target arm-linux-androideabi: (sincos isn't used in
> the source)
> imdct.c:(.text+0x27ac): undefined reference to `sincos'
> imdct.c:(.text+0x281c): undefined reference to `sincos'
> imdct.c:(.text+0x2894): undefined reference to `sincos'
> imdct.c:(.text+0x2910): undefined reference to `sincos'
> imdct.c:(.text+0x2980): undefined reference to `sincos'
> Does this mean that gcc is deliberately looking for sincos?

Gcc uses sincos if TARGET_HAS_SINCOS  is true.



-- 
H.J.

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
  2010-08-30 16:17   ` H.J. Lu
@ 2010-09-05  7:21     ` t66667
  2010-09-05  8:21       ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: t66667 @ 2010-09-05  7:21 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

Hello:
On 31/08/2010 1:53 AM, H.J. Lu wrote:
> On Mon, Aug 30, 2010 at 7:57 AM, Richard Guenther
> <richard.guenther@gmail.com>  wrote:
>> On Mon, Aug 30, 2010 at 4:40 PM, H.J. Lu<hongjiu.lu@intel.com>  wrote:
>>> Hi,
>>>
>>> On x86, sincos is always available if x87 FPU fsincos is available.
>>> This patch enables TARGET_HAS_SINCOS for -ffast-math and x87 FPU.  Also
>>> x86 Bionic C library doesn't provide sincos and we shouldn't enable
>>> TARGET_HAS_SINCOS with OPTION_BIONIC on x86.  OK for trunk?
>>
>> Hm.  Shouldn't it be conditional on USE_FANCY_MATH_387
>> &&  !NO_FANCY_MATH_387 as well?
>
> You are right.  Here is the updated patch.
>
For your info, I used revision 163859, is this patch applied?
I get link error for the target arm-linux-androideabi: (sincos isn't 
used in the source)
imdct.c:(.text+0x27ac): undefined reference to `sincos'
imdct.c:(.text+0x281c): undefined reference to `sincos'
imdct.c:(.text+0x2894): undefined reference to `sincos'
imdct.c:(.text+0x2910): undefined reference to `sincos'
imdct.c:(.text+0x2980): undefined reference to `sincos'
Does this mean that gcc is deliberately looking for sincos?
>> Also a flag dependency breaks with the target/option attributes,
>
> The current target/option attributes have many problems.  It
> shouldn't prevent us from generating better codes.
>
>> so I'm not sure it is a good idea.  Does anyone care for FP
>> execution performance on 32bit anyway?
>>
>
> Intel cares FP execution performance on 32bit
>
> Thanks.
>
>

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
  2010-08-30 14:55 H.J. Lu
  2010-08-30 15:24 ` Richard Guenther
@ 2010-08-30 16:32 ` Maxim Kuvyrkov
  1 sibling, 0 replies; 8+ messages in thread
From: Maxim Kuvyrkov @ 2010-08-30 16:32 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu, gcc-patches, Uros Bizjak, David Turner

On 8/30/10 6:40 PM, H.J. Lu wrote:
> Hi,
>
>Also
> x86 Bionic C library doesn't provide sincos and we shouldn't enable
> TARGET_HAS_SINCOS with OPTION_BIONIC on x86.

To be more precise, Bionic doesn't currently implement sincos() for any 
of the architectures, not just x86.

When I was working on adding Bionic support to GCC, David Turner 
(Bionic's lead, CC'ed) planned on adding sincos() to Bionic in the near 
term specifically to enable GCC's sincos optimization.

David,

What are Bionic's plans on supporting sincos()?  Growing number of users 
are now trying out what will become GCC 4.6 and it is becoming important 
for GCC and Bionic to be on the same page regarding available features.

Thanks,

-- 
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
  2010-08-30 15:24 ` Richard Guenther
@ 2010-08-30 16:17   ` H.J. Lu
  2010-09-05  7:21     ` t66667
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2010-08-30 16:17 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, Uros Bizjak, Maxim Kuvyrkov

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

On Mon, Aug 30, 2010 at 7:57 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 4:40 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> Hi,
>>
>> On x86, sincos is always available if x87 FPU fsincos is available.
>> This patch enables TARGET_HAS_SINCOS for -ffast-math and x87 FPU.  Also
>> x86 Bionic C library doesn't provide sincos and we shouldn't enable
>> TARGET_HAS_SINCOS with OPTION_BIONIC on x86.  OK for trunk?
>
> Hm.  Shouldn't it be conditional on USE_FANCY_MATH_387
> && !NO_FANCY_MATH_387 as well?

You are right.  Here is the updated patch.

> Also a flag dependency breaks with the target/option attributes,

The current target/option attributes have many problems.  It
shouldn't prevent us from generating better codes.

> so I'm not sure it is a good idea.  Does anyone care for FP
> execution performance on 32bit anyway?
>

Intel cares FP execution performance on 32bit

Thanks.


-- 
H.J.

[-- Attachment #2: gcc-sincos-3.patch --]
[-- Type: text/plain, Size: 3216 bytes --]

2010-08-30  H.J. Lu  <hongjiu.lu@intel.com>

	* config/linux.h (TARGET_HAS_SINCOS): Define only if not
	defined.

	* config/i386/i386.h (TARGET_HAS_SINCOS): New.  Enabled if x87
	FPU fsincos is available.
	* config/i386/x86-64.h (TARGET_HAS_SINCOS): Likewise.
	* config/i386/linux.h (TARGET_HAS_SINCOS): Likewise.
	* config/i386/linux64.h (TARGET_HAS_SINCOS): Likewise.

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 5bae99d..16a17c4 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2492,6 +2492,13 @@ struct GTY(()) machine_function {
 #undef TARG_COND_NOT_TAKEN_BRANCH_COST
 #define TARG_COND_NOT_TAKEN_BRANCH_COST ix86_cost->cond_not_taken_branch_cost
 
+/* Use x87 FPU fsincos if it is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (TARGET_USE_FANCY_MATH_387				\
+   && flag_unsafe_math_optimizations	 		\
+   && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387))
+
 /*
 Local variables:
 version-control: t
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 2a31880..42db416 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -35,6 +35,16 @@ along with GCC; see the file COPYING3.  If not see
 #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
 #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
 
+/* Whether we have sincos that follows the GNU extension.  There is no
+   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
+   is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (OPTION_GLIBC						\
+   || (TARGET_USE_FANCY_MATH_387			\
+       && flag_unsafe_math_optimizations		\
+       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
+
 #undef ASM_COMMENT_START
 #define ASM_COMMENT_START "#"
 
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 867de59..7bc12b7 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -50,6 +50,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
 #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
 
+/* Whether we have sincos that follows the GNU extension.  There is no
+   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
+   is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (OPTION_GLIBC						\
+   || (TARGET_USE_FANCY_MATH_387			\
+       && flag_unsafe_math_optimizations		\
+       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
+
 /* Provide a LINK_SPEC.  Here we provide support for the special GCC
    options -static and -shared, which allow us to link things in one
    of these three modes by applying the appropriate combinations of
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index e283a9a..576a2ac 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -159,7 +159,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    is present in the runtime library.  */
 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
 
+#ifndef TARGET_HAS_SINCOS
 /* Whether we have sincos that follows the GNU extension.  */
 #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
+#endif
 
 #define TARGET_POSIX_IO

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

* Re: PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
  2010-08-30 14:55 H.J. Lu
@ 2010-08-30 15:24 ` Richard Guenther
  2010-08-30 16:17   ` H.J. Lu
  2010-08-30 16:32 ` Maxim Kuvyrkov
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Guenther @ 2010-08-30 15:24 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches, Uros Bizjak, Maxim Kuvyrkov

On Mon, Aug 30, 2010 at 4:40 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> On x86, sincos is always available if x87 FPU fsincos is available.
> This patch enables TARGET_HAS_SINCOS for -ffast-math and x87 FPU.  Also
> x86 Bionic C library doesn't provide sincos and we shouldn't enable
> TARGET_HAS_SINCOS with OPTION_BIONIC on x86.  OK for trunk?

Hm.  Shouldn't it be conditional on USE_FANCY_MATH_387
&& !NO_FANCY_MATH_387 as well?

Also a flag dependency breaks with the target/option attributes,
so I'm not sure it is a good idea.  Does anyone care for FP
execution performance on 32bit anyway?

Richard.

> Thanks.
>
>
> H.J.
> ---
> 2010-08-30  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * config/linux.h (TARGET_HAS_SINCOS): Define only if not
>        defined.
>
>        * config/i386/i386.h (TARGET_HAS_SINCOS): New.  Enabled if x87
>        FPU fsincos is available.
>        * config/i386/x86-64.h (TARGET_HAS_SINCOS): Likewise.
>        * config/i386/linux.h (TARGET_HAS_SINCOS): Likewise.
>        * config/i386/linux64.h (TARGET_HAS_SINCOS): Likewise.
>
> diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
> index 5bae99d..493b5d2 100644
> --- a/gcc/config/i386/i386.h
> +++ b/gcc/config/i386/i386.h
> @@ -2492,6 +2492,12 @@ struct GTY(()) machine_function {
>  #undef TARG_COND_NOT_TAKEN_BRANCH_COST
>  #define TARG_COND_NOT_TAKEN_BRANCH_COST ix86_cost->cond_not_taken_branch_cost
>
> +/* Use x87 FPU fsincos if it is available.  */
> +#undef TARGET_HAS_SINCOS
> +#define TARGET_HAS_SINCOS                              \
> +  (flag_unsafe_math_optimizations                      \
> +   && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387))
> +
>  /*
>  Local variables:
>  version-control: t
> diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
> index 2a31880..f466d6d 100644
> --- a/gcc/config/i386/linux.h
> +++ b/gcc/config/i386/linux.h
> @@ -35,6 +35,15 @@ along with GCC; see the file COPYING3.  If not see
>  #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
>  #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
>
> +/* Whether we have sincos that follows the GNU extension.  There is no
> +   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
> +   is available.  */
> +#undef TARGET_HAS_SINCOS
> +#define TARGET_HAS_SINCOS                              \
> +  (OPTION_GLIBC                                                \
> +   || (flag_unsafe_math_optimizations                  \
> +       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
> +
>  #undef ASM_COMMENT_START
>  #define ASM_COMMENT_START "#"
>
> diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
> index 867de59..9f38a57 100644
> --- a/gcc/config/i386/linux64.h
> +++ b/gcc/config/i386/linux64.h
> @@ -50,6 +50,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
>  #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
>
> +/* Whether we have sincos that follows the GNU extension.  There is no
> +   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
> +   is available.  */
> +#undef TARGET_HAS_SINCOS
> +#define TARGET_HAS_SINCOS                              \
> +  (OPTION_GLIBC                                                \
> +   || (flag_unsafe_math_optimizations                  \
> +       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
> +
>  /* Provide a LINK_SPEC.  Here we provide support for the special GCC
>    options -static and -shared, which allow us to link things in one
>    of these three modes by applying the appropriate combinations of
> diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
> index 1b64813..d18ec23 100644
> --- a/gcc/config/i386/x86-64.h
> +++ b/gcc/config/i386/x86-64.h
> @@ -107,3 +107,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>
>  #undef TARGET_ASM_UNIQUE_SECTION
>  #define TARGET_ASM_UNIQUE_SECTION  x86_64_elf_unique_section
> +
> +/* Use x87 FPU fsincos if it is available.  */
> +#undef TARGET_HAS_SINCOS
> +#define TARGET_HAS_SINCOS                              \
> +  (flag_unsafe_math_optimizations                      \
> +   && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387))
> diff --git a/gcc/config/linux.h b/gcc/config/linux.h
> index e283a9a..576a2ac 100644
> --- a/gcc/config/linux.h
> +++ b/gcc/config/linux.h
> @@ -159,7 +159,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>    is present in the runtime library.  */
>  #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
>
> +#ifndef TARGET_HAS_SINCOS
>  /* Whether we have sincos that follows the GNU extension.  */
>  #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
> +#endif
>
>  #define TARGET_POSIX_IO
>

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

* PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available
@ 2010-08-30 14:55 H.J. Lu
  2010-08-30 15:24 ` Richard Guenther
  2010-08-30 16:32 ` Maxim Kuvyrkov
  0 siblings, 2 replies; 8+ messages in thread
From: H.J. Lu @ 2010-08-30 14:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak, Maxim Kuvyrkov

Hi,

On x86, sincos is always available if x87 FPU fsincos is available.
This patch enables TARGET_HAS_SINCOS for -ffast-math and x87 FPU.  Also
x86 Bionic C library doesn't provide sincos and we shouldn't enable
TARGET_HAS_SINCOS with OPTION_BIONIC on x86.  OK for trunk?

Thanks.


H.J.
---
2010-08-30  H.J. Lu  <hongjiu.lu@intel.com>

	* config/linux.h (TARGET_HAS_SINCOS): Define only if not
	defined.

	* config/i386/i386.h (TARGET_HAS_SINCOS): New.  Enabled if x87
	FPU fsincos is available.
	* config/i386/x86-64.h (TARGET_HAS_SINCOS): Likewise.
	* config/i386/linux.h (TARGET_HAS_SINCOS): Likewise.
	* config/i386/linux64.h (TARGET_HAS_SINCOS): Likewise.

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 5bae99d..493b5d2 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2492,6 +2492,12 @@ struct GTY(()) machine_function {
 #undef TARG_COND_NOT_TAKEN_BRANCH_COST
 #define TARG_COND_NOT_TAKEN_BRANCH_COST ix86_cost->cond_not_taken_branch_cost
 
+/* Use x87 FPU fsincos if it is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (flag_unsafe_math_optimizations	 		\
+   && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387))
+
 /*
 Local variables:
 version-control: t
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 2a31880..f466d6d 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -35,6 +35,15 @@ along with GCC; see the file COPYING3.  If not see
 #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
 #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
 
+/* Whether we have sincos that follows the GNU extension.  There is no
+   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
+   is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (OPTION_GLIBC						\
+   || (flag_unsafe_math_optimizations	 		\
+       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
+
 #undef ASM_COMMENT_START
 #define ASM_COMMENT_START "#"
 
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 867de59..9f38a57 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -50,6 +50,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
 #define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
 
+/* Whether we have sincos that follows the GNU extension.  There is no
+   sincos in Bionic C library.  We can only use x87 FPU fsincos if it
+   is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (OPTION_GLIBC						\
+   || (flag_unsafe_math_optimizations	 		\
+       && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)))
+
 /* Provide a LINK_SPEC.  Here we provide support for the special GCC
    options -static and -shared, which allow us to link things in one
    of these three modes by applying the appropriate combinations of
diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
index 1b64813..d18ec23 100644
--- a/gcc/config/i386/x86-64.h
+++ b/gcc/config/i386/x86-64.h
@@ -107,3 +107,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #undef TARGET_ASM_UNIQUE_SECTION
 #define TARGET_ASM_UNIQUE_SECTION  x86_64_elf_unique_section
+
+/* Use x87 FPU fsincos if it is available.  */
+#undef TARGET_HAS_SINCOS
+#define TARGET_HAS_SINCOS				\
+  (flag_unsafe_math_optimizations	 		\
+   && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387))
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index e283a9a..576a2ac 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -159,7 +159,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    is present in the runtime library.  */
 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
 
+#ifndef TARGET_HAS_SINCOS
 /* Whether we have sincos that follows the GNU extension.  */
 #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
+#endif
 
 #define TARGET_POSIX_IO

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

end of thread, other threads:[~2010-10-31 19:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30  1:06 PATCH: Enable TARGET_HAS_SINCOS if x87 FPU fsincos is available Jing Yu
     [not found] ` <AANLkTinGLSX0U2PR0oM753NhFM8Poygx6qf3E-iSgM=a@mail.gmail.com>
2010-10-31 23:03   ` Maxim Kuvyrkov
  -- strict thread matches above, loose matches on Subject: below --
2010-08-30 14:55 H.J. Lu
2010-08-30 15:24 ` Richard Guenther
2010-08-30 16:17   ` H.J. Lu
2010-09-05  7:21     ` t66667
2010-09-05  8:21       ` H.J. Lu
2010-08-30 16:32 ` Maxim Kuvyrkov

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