diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-04 22:13:09 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-04 22:13:09 +0000 |
commit | d6bf3b142da7fb201b42a7ca49a1a27c04df4bb0 (patch) | |
tree | c58b0fad8bf6ca1d17ba2102d04c971975a84d81 /gcc/builtins.c | |
parent | b56481add5397e285a48fbb54b7ab140974a68b9 (diff) | |
download | gcc-d6bf3b142da7fb201b42a7ca49a1a27c04df4bb0.tar.gz |
gcc/
* optabs.h (optab_handler, convert_optab_handler): Turn into
inline functions that return an insn code.
(set_optab_handler, set_convert_optab_handler): New functions.
* builtins.c: Replace optab_handler(X)->insn_code with
optab_handler or set_optab_handler thoughout. Likewise
convert_optab_handler(X)->insn_code with convert_optab_handler
and set_convert_optab_handler.
* expmed.c, expr.c, genopinit.c, ifcvt.c, optabs.c, reload.c,
reload1.c, stmt.c, targhooks.c, tree-ssa-loop-prefetch.c,
tree-ssa-math-opts.c, tree-vect-data-refs.c, tree-vect-generic.c,
tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c,
tree-vect-stmts.c, config/m32c/m32c.c, config/rs6000/rs6000.c,
config/spu/spu.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index ddbbd79dbe2..46cc03d8069 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1994,7 +1994,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) errno_set = false; /* Before working hard, check whether the instruction is available. */ - if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing) + if (optab_handler (builtin_optab, mode) != CODE_FOR_nothing) { target = gen_reg_rtx (mode); @@ -2096,7 +2096,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) mode = TYPE_MODE (TREE_TYPE (exp)); /* Before working hard, check whether the instruction is available. */ - if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing) + if (optab_handler (builtin_optab, mode) == CODE_FOR_nothing) return NULL_RTX; target = gen_reg_rtx (mode); @@ -2173,7 +2173,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget) /* Check if sincos insn is available, otherwise fallback to sin or cos insn. */ - if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing) + if (optab_handler (builtin_optab, mode) == CODE_FOR_nothing) switch (DECL_FUNCTION_CODE (fndecl)) { CASE_FLT_FN (BUILT_IN_SIN): @@ -2185,7 +2185,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget) } /* Before working hard, check whether the instruction is available. */ - if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing) + if (optab_handler (builtin_optab, mode) != CODE_FOR_nothing) { target = gen_reg_rtx (mode); @@ -2282,7 +2282,7 @@ interclass_mathfn_icode (tree arg, tree fndecl) mode = TYPE_MODE (TREE_TYPE (arg)); if (builtin_optab) - return optab_handler (builtin_optab, mode)->insn_code; + return optab_handler (builtin_optab, mode); return CODE_FOR_nothing; } @@ -2370,7 +2370,7 @@ expand_builtin_sincos (tree exp) mode = TYPE_MODE (TREE_TYPE (arg)); /* Check if sincos insn is available, otherwise emit the call. */ - if (optab_handler (sincos_optab, mode)->insn_code == CODE_FOR_nothing) + if (optab_handler (sincos_optab, mode) == CODE_FOR_nothing) return NULL_RTX; target1 = gen_reg_rtx (mode); @@ -2417,7 +2417,7 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget) /* Try expanding via a sincos optab, fall back to emitting a libcall to sincos or cexp. We are sure we have sincos or cexp because cexpi is only generated from sincos, cexp or if we have either of them. */ - if (optab_handler (sincos_optab, mode)->insn_code != CODE_FOR_nothing) + if (optab_handler (sincos_optab, mode) != CODE_FOR_nothing) { op1 = gen_reg_rtx (mode); op2 = gen_reg_rtx (mode); @@ -3080,8 +3080,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) smaller than pow (x, 1.5) if sqrt will not be expanded as a call. */ || (n == 3 - && (optab_handler (sqrt_optab, mode)->insn_code - != CODE_FOR_nothing)))) + && optab_handler (sqrt_optab, mode) != CODE_FOR_nothing))) { tree call_expr = build_call_nofold_loc (EXPR_LOCATION (exp), fn, 1, narg0); @@ -3272,7 +3271,7 @@ expand_builtin_strlen (tree exp, rtx target, /* Bail out if we can't compute strlen in the right mode. */ while (insn_mode != VOIDmode) { - icode = optab_handler (strlen_optab, insn_mode)->insn_code; + icode = optab_handler (strlen_optab, insn_mode); if (icode != CODE_FOR_nothing) break; @@ -5308,7 +5307,7 @@ expand_builtin_signbit (tree exp, rtx target) /* Check if the back end provides an insn that handles signbit for the argument's mode. */ - icode = signbit_optab->handlers [(int) fmode].insn_code; + icode = optab_handler (signbit_optab, fmode); if (icode != CODE_FOR_nothing) { rtx last = get_last_insn (); |