summaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-07-09 08:45:12 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-07-09 08:45:12 +0000
commite714561a2fab73a2592aed0418a00b0c906c0711 (patch)
tree8171a7fe230372ff8186c6f2b999f0d7b358565c /gcc/optabs.h
parent701649fa8939e9a3b6328afc9fca2abe4b55c312 (diff)
downloadgcc-e714561a2fab73a2592aed0418a00b0c906c0711.tar.gz
gensupport.c (init_rtx_reader_args_cb): Start counting code generating patterns from 1 to free up 0 for CODE_FOR_nothing.
* gensupport.c (init_rtx_reader_args_cb): Start counting code generating patterns from 1 to free up 0 for CODE_FOR_nothing. * gencodes.c (main): Give CODE_FOR_nothing the value 0. Add the LAST_INSN_CODE marker at the end. * genoutput.c (nothing): New static struct data. (idata): Initialize to &nothing. (idata_end): Initialize to &nothing.next. (init_insn_for_nothing): New function to create dummy 'nothing' insn. (main): Use it. * genpeep.c (insn_code_number): Remove global variable. (gen_peephole): Take it as an argument instead. (main): Take insn_code_number from read_md_rtx. * optabs.h: Revert r161809: (optab_handlers): Change type of insn_code back to insn_code. (optab_handler, widening_optab_handler, set_optab_handler, set_widening_optab_handler, convert_optab_handler, set_convert_optab_handler, direct_optab_handler, set_direct_optab_handler): Remove int casts. Revert to treating the insn_code field as "insn_code". From-SVN: r189366
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h36
1 files changed, 15 insertions, 21 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 70a7395cc05..d87aff81c93 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -1,6 +1,6 @@
/* Definitions for code generation pass of GNU compiler.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -29,6 +29,10 @@ 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.
@@ -36,10 +40,7 @@ along with GCC; see the file COPYING3. If not see
struct optab_handlers
{
- /* 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;
+ enum insn_code insn_code;
};
struct widening_optab_handlers
@@ -1011,8 +1012,7 @@ extern rtx expand_vec_perm (enum machine_mode, rtx, rtx, rtx, rtx);
static inline enum insn_code
optab_handler (optab op, enum machine_mode mode)
{
- return (enum insn_code) (op->handlers[(int) mode].insn_code
- + (int) CODE_FOR_nothing);
+ return op->handlers[(int) mode].insn_code;
}
/* Like optab_handler, but for widening_operations that have a TO_MODE and
@@ -1026,8 +1026,7 @@ widening_optab_handler (optab op, enum machine_mode to_mode,
return optab_handler (op, to_mode);
if (op->widening)
- return (enum insn_code) (op->widening->handlers[(int) to_mode][(int) from_mode].insn_code
- + (int) CODE_FOR_nothing);
+ return op->widening->handlers[(int) to_mode][(int) from_mode].insn_code;
return CODE_FOR_nothing;
}
@@ -1037,7 +1036,7 @@ widening_optab_handler (optab op, enum machine_mode to_mode,
static inline void
set_optab_handler (optab op, enum machine_mode mode, enum insn_code code)
{
- op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing;
+ op->handlers[(int) mode].insn_code = code;
}
/* Like set_optab_handler, but for widening operations that have a TO_MODE
@@ -1055,8 +1054,7 @@ set_widening_optab_handler (optab op, enum machine_mode to_mode,
op->widening = (struct widening_optab_handlers *)
xcalloc (1, sizeof (struct widening_optab_handlers));
- op->widening->handlers[(int) to_mode][(int) from_mode].insn_code
- = (int) code - (int) CODE_FOR_nothing;
+ op->widening->handlers[(int) to_mode][(int) from_mode].insn_code = code;
}
}
@@ -1068,9 +1066,7 @@ static inline enum insn_code
convert_optab_handler (convert_optab op, enum machine_mode to_mode,
enum machine_mode from_mode)
{
- return ((enum insn_code)
- (op->handlers[(int) to_mode][(int) from_mode].insn_code
- + (int) CODE_FOR_nothing));
+ return op->handlers[(int) to_mode][(int) from_mode].insn_code;
}
/* Record that insn CODE should be used to perform conversion OP
@@ -1080,8 +1076,7 @@ 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
- = (int) code - (int) CODE_FOR_nothing;
+ op->handlers[(int) to_mode][(int) from_mode].insn_code = code;
}
/* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing
@@ -1090,8 +1085,7 @@ set_convert_optab_handler (convert_optab op, enum machine_mode to_mode,
static inline enum insn_code
direct_optab_handler (direct_optab op, enum machine_mode mode)
{
- return (enum insn_code) (op->handlers[(int) mode].insn_code
- + (int) CODE_FOR_nothing);
+ return op->handlers[(int) mode].insn_code;
}
/* Record that insn CODE should be used to implement mode MODE of OP. */
@@ -1100,7 +1094,7 @@ static inline void
set_direct_optab_handler (direct_optab op, enum machine_mode mode,
enum insn_code code)
{
- op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing;
+ op->handlers[(int) mode].insn_code = code;
}
/* Return true if UNOPTAB is for a trapping-on-overflow operation. */