diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-18 17:33:38 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-18 17:33:38 +0000 |
commit | 2642796685af2c90aa6c18a3bba03f5c571f87bd (patch) | |
tree | 322c854e5205121b0545f58847a6f3aa5e4c0b36 /gcc/combine.c | |
parent | 4ed6cf776004b2e0a22047c3c0296c8f0493fe36 (diff) | |
download | gcc-2642796685af2c90aa6c18a3bba03f5c571f87bd.tar.gz |
gcc/
* Makefile.in (recog.o): Add insn-codes.h.
* expr.h (extraction_pattern): Move to optabs.h.
(mode_for_extraction): Delete.
* optabs.h (extraction_insn): New structure.
(extraction_pattern): Moved from expr.h.
(get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare.
* optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv)
(HAVE_extzv, CODE_FOR_extzv): Provide defaults.
(extraction_type): New enum.
(get_traditional_extraction_insn, get_extraction_insn)
(get_best_reg_extraction_insn, get_best_mem_extraction_insn):
New functions.
* combine.c (make_extraction): Use get_best_reg_extraction_insn
instead of mode_for_extraction.
* expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv)
(CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv):
Remove fallback definitions.
(mode_for_extraction): Delete.
(adjust_bit_field_mem_for_reg): New function.
(store_bit_field_using_insv): Replace OP_MODE parameter with
an extraction_insn. Pass struct_mode to narrow_bit_field_mem.
(extract_bit_field_using_extv): Likewise EXT_MODE.
(store_bit_field_1): Use get_best_reg_extraction_insn and
get_best_mem_extraction_insn instead of mode_for_extraction.
Use adjust_bit_field_mem_for_reg when forcing memory to a
register and doing a register insertion. Update calls to
store_bit_field_using_insv.
(extract_bit_field_1): Likewise extractions and calls to
extract_bit_field_using_extv.
(store_Bit_field): When narrowing to a bitregion, don't use the
insv mode as a limit.
* recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv):
Provide defaults.
(simplify_while_replacing): Use insn_data instead of
mode_for_extraction.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193605 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index a3583e2013a..abd67e8ab9c 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7179,29 +7179,24 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, || (pos_rtx != 0 && len != 1))) return 0; - /* Get the mode to use should INNER not be a MEM, the mode for the position, - and the mode for the result. */ - if (in_dest && mode_for_extraction (EP_insv, -1) != MAX_MACHINE_MODE) - { - wanted_inner_reg_mode = mode_for_extraction (EP_insv, 0); - pos_mode = mode_for_extraction (EP_insv, 2); - extraction_mode = mode_for_extraction (EP_insv, 3); - } + enum extraction_pattern pattern = (in_dest ? EP_insv + : unsignedp ? EP_extzv : EP_extv); - if (! in_dest && unsignedp - && mode_for_extraction (EP_extzv, -1) != MAX_MACHINE_MODE) - { - wanted_inner_reg_mode = mode_for_extraction (EP_extzv, 1); - pos_mode = mode_for_extraction (EP_extzv, 3); - extraction_mode = mode_for_extraction (EP_extzv, 0); - } + /* If INNER is not from memory, we want it to have the mode of a register + extraction pattern's structure operand, or word_mode if there is no + such pattern. The same applies to extraction_mode and pos_mode + and their respective operands. - if (! in_dest && ! unsignedp - && mode_for_extraction (EP_extv, -1) != MAX_MACHINE_MODE) + For memory, assume that the desired extraction_mode and pos_mode + are the same as for a register operation, since at present we don't + have named patterns for aligned memory structures. */ + struct extraction_insn insn; + if (get_best_reg_extraction_insn (&insn, pattern, + GET_MODE_BITSIZE (inner_mode), mode)) { - wanted_inner_reg_mode = mode_for_extraction (EP_extv, 1); - pos_mode = mode_for_extraction (EP_extv, 3); - extraction_mode = mode_for_extraction (EP_extv, 0); + wanted_inner_reg_mode = insn.struct_mode; + pos_mode = insn.pos_mode; + extraction_mode = insn.field_mode; } /* Never narrow an object, since that might not be safe. */ @@ -7210,9 +7205,6 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, && GET_MODE_SIZE (extraction_mode) < GET_MODE_SIZE (mode)) extraction_mode = mode; - /* If this is not from memory, the desired mode is the preferred mode - for an extraction pattern's first input operand, or word_mode if there - is none. */ if (!MEM_P (inner)) wanted_inner_mode = wanted_inner_reg_mode; else |