diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-04 22:14:02 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-04 22:14:02 +0000 |
commit | 4fc789b6842b60da700b757c99f326062bd54539 (patch) | |
tree | 485e2dfab01d9fdfedead6728bacde5e33853595 /gcc/optabs.h | |
parent | d6bf3b142da7fb201b42a7ca49a1a27c04df4bb0 (diff) | |
download | gcc-4fc789b6842b60da700b757c99f326062bd54539.tar.gz |
gcc/
* optabs.h (optab_handlers): Change type of insn_code to int.
(optab_handler, set_optab_handler, convert_optab_handler)
(set_convert_optab_handler): Treat the insn_code field as "insn_code -
CODE_FOR_nothing".
* optabs.c (optab_table, convert_optab_table): Always zero-initialize.
(init_insn_codes): Zero both the above arrays.
(init_optabs): Never call init_insn_codes first time around.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161809 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r-- | gcc/optabs.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h index 03feb5a5abb..c37fd41bf29 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -29,10 +29,6 @@ along with GCC; see the file COPYING3. If not see For example, add_optab applies to addition. - The insn_code slot is the enum insn_code that says how to - generate an insn for this operation on a particular machine mode. - It is CODE_FOR_nothing if there is no such insn on the target machine. - The `lib_call' slot is the name of the library function that can be used to perform the operation. @@ -40,7 +36,10 @@ along with GCC; see the file COPYING3. If not see struct optab_handlers { - enum insn_code insn_code; + /* I - CODE_FOR_nothing, where I is either the insn code of the + associated insn generator or CODE_FOR_nothing if there is no such + insn on the target machine. */ + int insn_code; }; struct optab_d @@ -788,7 +787,8 @@ extern rtx expand_vec_shift_expr (sepops, rtx); static inline enum insn_code optab_handler (optab op, enum machine_mode mode) { - return op->handlers[(int) mode].insn_code; + return (enum insn_code) (op->handlers[(int) mode].insn_code + + (int) CODE_FOR_nothing); } /* Record that insn CODE should be used to implement mode MODE of OP. */ @@ -796,7 +796,7 @@ optab_handler (optab op, enum machine_mode mode) static inline void set_optab_handler (optab op, enum machine_mode mode, enum insn_code code) { - op->handlers[(int) mode].insn_code = code; + op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing; } /* Return the insn used to perform conversion OP from mode FROM_MODE @@ -807,7 +807,9 @@ 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; + return ((enum insn_code) + (op->handlers[(int) to_mode][(int) from_mode].insn_code + + (int) CODE_FOR_nothing)); } /* Record that insn CODE should be used to perform conversion OP @@ -817,7 +819,8 @@ 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; + op->handlers[(int) to_mode][(int) from_mode].insn_code + = (int) code - (int) CODE_FOR_nothing; } extern rtx optab_libfunc (optab optab, enum machine_mode mode); |