#include "tree-ssa.h"
#include "builtins.h"
#include "params.h"
+#include "case-cfn-macros.h"
/* This structure represents one basic block that either computes a
division, or is a common dominator for basic block that compute a
FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, name)
{
if (gimple_code (use_stmt) != GIMPLE_CALL
- || !gimple_call_lhs (use_stmt)
- || !(fndecl = gimple_call_fndecl (use_stmt))
- || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
+ || !gimple_call_lhs (use_stmt))
continue;
- switch (DECL_FUNCTION_CODE (fndecl))
+ switch (gimple_call_combined_fn (use_stmt))
{
- CASE_FLT_FN (BUILT_IN_COS):
+ CASE_CFN_COS:
seen_cos |= maybe_record_sincos (&stmts, &top_bb, use_stmt) ? 1 : 0;
break;
- CASE_FLT_FN (BUILT_IN_SIN):
+ CASE_CFN_SIN:
seen_sin |= maybe_record_sincos (&stmts, &top_bb, use_stmt) ? 1 : 0;
break;
- CASE_FLT_FN (BUILT_IN_CEXPI):
+ CASE_CFN_CEXPI:
seen_cexpi |= maybe_record_sincos (&stmts, &top_bb, use_stmt) ? 1 : 0;
break;
for (i = 0; stmts.iterate (i, &use_stmt); ++i)
{
tree rhs = NULL;
- fndecl = gimple_call_fndecl (use_stmt);
- switch (DECL_FUNCTION_CODE (fndecl))
+ switch (gimple_call_combined_fn (use_stmt))
{
- CASE_FLT_FN (BUILT_IN_COS):
+ CASE_CFN_COS:
rhs = fold_build1 (REALPART_EXPR, type, res);
break;
- CASE_FLT_FN (BUILT_IN_SIN):
+ CASE_CFN_SIN:
rhs = fold_build1 (IMAGPART_EXPR, type, res);
break;
- CASE_FLT_FN (BUILT_IN_CEXPI):
+ CASE_CFN_CEXPI:
rhs = res;
break;
for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
- tree fndecl;
/* Only the last stmt in a bb could throw, no need to call
gimple_purge_dead_eh_edges if we change something in the middle
of a basic block. */
cleanup_eh = false;
- if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)
+ if (is_gimple_call (stmt)
&& gimple_call_lhs (stmt))
{
tree arg, arg0, arg1, result;
HOST_WIDE_INT n;
location_t loc;
- fndecl = gimple_call_fndecl (stmt);
- switch (DECL_FUNCTION_CODE (fndecl))
+ switch (gimple_call_combined_fn (stmt))
{
- CASE_FLT_FN (BUILT_IN_COS):
- CASE_FLT_FN (BUILT_IN_SIN):
- CASE_FLT_FN (BUILT_IN_CEXPI):
+ CASE_CFN_COS:
+ CASE_CFN_SIN:
+ CASE_CFN_CEXPI:
/* Make sure we have either sincos or cexp. */
if (!targetm.libc_has_function (function_c99_math_complex)
&& !targetm.libc_has_function (function_sincos))
cfg_changed |= execute_cse_sincos_1 (arg);
break;
- CASE_FLT_FN (BUILT_IN_POW):
+ CASE_CFN_POW:
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
}
break;
- CASE_FLT_FN (BUILT_IN_POWI):
+ CASE_CFN_POWI:
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
loc = gimple_location (stmt);
}
break;
- CASE_FLT_FN (BUILT_IN_CABS):
+ CASE_CFN_CABS:
arg0 = gimple_call_arg (stmt, 0);
loc = gimple_location (stmt);
result = gimple_expand_builtin_cabs (&gsi, loc, arg0);