diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2010-07-04 22:13:09 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2010-07-04 22:13:09 +0000 |
commit | 947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd (patch) | |
tree | c58b0fad8bf6ca1d17ba2102d04c971975a84d81 /gcc/optabs.h | |
parent | 47e5ff44ccdcf7c7936ad91d07b78cbf64d430d1 (diff) | |
download | gcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.zip gcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.tar.gz gcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.tar.bz2 |
optabs.h (optab_handler, [...]): Turn into inline functions that return an insn code.
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.
From-SVN: r161808
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r-- | gcc/optabs.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h index faa4330..03feb5a 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -782,9 +782,43 @@ extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx); /* Generate code for VEC_LSHIFT_EXPR and VEC_RSHIFT_EXPR. */ extern rtx expand_vec_shift_expr (sepops, rtx); -#define optab_handler(optab,mode) (&(optab)->handlers[(int) (mode)]) -#define convert_optab_handler(optab,mode,mode2) \ - (&(optab)->handlers[(int) (mode)][(int) (mode2)]) +/* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing + if the target does not have such an insn. */ + +static inline enum insn_code +optab_handler (optab op, enum machine_mode mode) +{ + return op->handlers[(int) mode].insn_code; +} + +/* Record that insn CODE should be used to implement mode MODE of OP. */ + +static inline void +set_optab_handler (optab op, enum machine_mode mode, enum insn_code code) +{ + op->handlers[(int) mode].insn_code = code; +} + +/* Return the insn used to perform conversion OP from mode FROM_MODE + to mode TO_MODE; return CODE_FOR_nothing if the target does not have + such an insn. */ + +static inline enum insn_code +convert_optab_handler (convert_optab op, enum machine_mode to_mode, + enum machine_mode from_mode) +{ + return op->handlers[(int) to_mode][(int) from_mode].insn_code; +} + +/* Record that insn CODE should be used to perform conversion OP + from mode FROM_MODE to mode TO_MODE. */ + +static inline void +set_convert_optab_handler (convert_optab op, enum machine_mode to_mode, + enum machine_mode from_mode, enum insn_code code) +{ + op->handlers[(int) to_mode][(int) from_mode].insn_code = code; +} extern rtx optab_libfunc (optab optab, enum machine_mode mode); extern rtx convert_optab_libfunc (convert_optab optab, enum machine_mode mode1, |