aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorUros Bizjak <uros@kss-loka.si>2004-04-06 21:34:33 +0200
committerRoger Sayle <sayle@gcc.gnu.org>2004-04-06 19:34:33 +0000
commit6c7cf1f021db7313abecc4351b973d521c75bcaa (patch)
tree154509061a748c219394d85b40f993c80d2f7670 /gcc/optabs.h
parent23bd1514c1a09dfb60b93640f2e70d311745b430 (diff)
downloadgcc-6c7cf1f021db7313abecc4351b973d521c75bcaa.zip
gcc-6c7cf1f021db7313abecc4351b973d521c75bcaa.tar.gz
gcc-6c7cf1f021db7313abecc4351b973d521c75bcaa.tar.bz2
builtins.c: Implement support for sincos function.
2004-04-06 Uros Bizjak <uros@kss-loka.si> * builtins.c: Implement support for sincos function. (expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and BUILT_IN_COS{,F,L}. (expand_builtin_mathfn_3): New function. (expand_builtin): Expand BUILT_IN_SIN{,F,L} and BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if flag_unsafe_math_optimization is set. * optabs.h (enum optab_index): Add new OTI_sincos. (sincos_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize sincos_optab. (expand_twoval_unop): New function. * genopinit.c (optabs): Implement sincos_optab using sincos?f3 patterns. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS and UNSPEC_SINCOS_SIN. * config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3, sincosxf3): New patterns to implement sincos, sincosf and sincosl built-ins as inline x87 intrinsics. Define splits for sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2, cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding sincos patterns. (sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2. (cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2. (UNSPEC_SINCOS_SIN, UNPEC_SINCOS_COS): New unspecs to represent x87's unspec insn. * gcc.dg/builtins-36.c: New test. From-SVN: r80463
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 765e169..524cb67 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -148,6 +148,8 @@ enum optab_index
OTI_parity,
/* Square root */
OTI_sqrt,
+ /* Sine-Cosine */
+ OTI_sincos,
/* Sine */
OTI_sin,
/* Cosine */
@@ -264,6 +266,7 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define popcount_optab (optab_table[OTI_popcount])
#define parity_optab (optab_table[OTI_parity])
#define sqrt_optab (optab_table[OTI_sqrt])
+#define sincos_optab (optab_table[OTI_sincos])
#define sin_optab (optab_table[OTI_sin])
#define cos_optab (optab_table[OTI_cos])
#define exp_optab (optab_table[OTI_exp])
@@ -386,6 +389,9 @@ extern rtx expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
extern rtx sign_expand_binop (enum machine_mode, optab, optab, rtx, rtx,
rtx, int, enum optab_methods);
+/* Generate code to perform an operation on one operand with two results. */
+extern int expand_twoval_unop (optab, rtx, rtx, rtx, int);
+
/* Generate code to perform an operation on two operands with two results. */
extern int expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int);