summaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-04 22:13:09 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-04 22:13:09 +0000
commitd6bf3b142da7fb201b42a7ca49a1a27c04df4bb0 (patch)
treec58b0fad8bf6ca1d17ba2102d04c971975a84d81 /gcc/optabs.h
parentb56481add5397e285a48fbb54b7ab140974a68b9 (diff)
downloadgcc-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/optabs.h')
-rw-r--r--gcc/optabs.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index faa4330e5dd..03feb5a5abb 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,