fold-const.c (fold_unary): Test for availability of BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS.
* fold-const.c (fold_unary) <REAL_PART>: Test for availability of BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS. <IMAG_PART>: Likewise, check for availability of BUILT_IN_SIN. * builtins.c (fold_builtin_sincos): Check for TARGET_C99_FUNCTIONS before canonicalizing sincos to cexpi. (fold_builtin_cexp): Likewise, for canonicalizing cexp to cexpi. From-SVN: r121607
This commit is contained in:
parent
7056b82ec7
commit
2d38026be8
|
@ -1,3 +1,12 @@
|
||||||
|
2007-02-05 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
|
* fold-const.c (fold_unary) <REAL_PART>: Test for availability of
|
||||||
|
BUILT_IN_COS before simplifying REAL_PART(CEXPI)) to COS.
|
||||||
|
<IMAG_PART>: Likewise, check for availability of BUILT_IN_SIN.
|
||||||
|
* builtins.c (fold_builtin_sincos): Check for TARGET_C99_FUNCTIONS
|
||||||
|
before canonicalizing sincos to cexpi.
|
||||||
|
(fold_builtin_cexp): Likewise, for canonicalizing cexp to cexpi.
|
||||||
|
|
||||||
2007-02-05 Roger Sayle <roger@eyesopen.com>
|
2007-02-05 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
* config/alpha/alpha.c (alpha_add_builtins): New Helper function.
|
* config/alpha/alpha.c (alpha_add_builtins): New Helper function.
|
||||||
|
|
|
@ -7474,6 +7474,8 @@ fold_builtin_sincos (tree arglist)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
/* Canonicalize sincos to cexpi. */
|
/* Canonicalize sincos to cexpi. */
|
||||||
|
if (!TARGET_C99_FUNCTIONS)
|
||||||
|
return NULL_TREE;
|
||||||
fn = mathfn_built_in (type, BUILT_IN_CEXPI);
|
fn = mathfn_built_in (type, BUILT_IN_CEXPI);
|
||||||
if (!fn)
|
if (!fn)
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
@ -7507,6 +7509,8 @@ fold_builtin_cexp (tree arglist, tree type)
|
||||||
|
|
||||||
/* In case we can figure out the real part of arg0 and it is constant zero
|
/* In case we can figure out the real part of arg0 and it is constant zero
|
||||||
fold to cexpi. */
|
fold to cexpi. */
|
||||||
|
if (!TARGET_C99_FUNCTIONS)
|
||||||
|
return NULL_TREE;
|
||||||
ifn = mathfn_built_in (rtype, BUILT_IN_CEXPI);
|
ifn = mathfn_built_in (rtype, BUILT_IN_CEXPI);
|
||||||
if (!ifn)
|
if (!ifn)
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
|
|
@ -7769,9 +7769,13 @@ fold_unary (enum tree_code code, tree type, tree op0)
|
||||||
{
|
{
|
||||||
CASE_FLT_FN (BUILT_IN_CEXPI):
|
CASE_FLT_FN (BUILT_IN_CEXPI):
|
||||||
fn = mathfn_built_in (type, BUILT_IN_COS);
|
fn = mathfn_built_in (type, BUILT_IN_COS);
|
||||||
return build_function_call_expr (fn, TREE_OPERAND (arg0, 1));
|
if (fn)
|
||||||
|
return build_function_call_expr (fn,
|
||||||
|
TREE_OPERAND (arg0, 1));
|
||||||
|
break;
|
||||||
|
|
||||||
default:;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
@ -7808,9 +7812,13 @@ fold_unary (enum tree_code code, tree type, tree op0)
|
||||||
{
|
{
|
||||||
CASE_FLT_FN (BUILT_IN_CEXPI):
|
CASE_FLT_FN (BUILT_IN_CEXPI):
|
||||||
fn = mathfn_built_in (type, BUILT_IN_SIN);
|
fn = mathfn_built_in (type, BUILT_IN_SIN);
|
||||||
return build_function_call_expr (fn, TREE_OPERAND (arg0, 1));
|
if (fn)
|
||||||
|
return build_function_call_expr (fn,
|
||||||
|
TREE_OPERAND (arg0, 1));
|
||||||
|
break;
|
||||||
|
|
||||||
default:;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
|
Loading…
Reference in New Issue