diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2012-04-30 14:59:44 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2012-04-30 14:59:44 +0200 |
commit | d55d2c8490cf7c44a2c48a41cf253888b3a5c552 (patch) | |
tree | 039605ad4914aaacf8230a5a570a1e5e587ed0a1 | |
parent | b9c8da345cd0763bb30a5a12713c808d74a2070f (diff) | |
download | gcc-d55d2c8490cf7c44a2c48a41cf253888b3a5c552.zip gcc-d55d2c8490cf7c44a2c48a41cf253888b3a5c552.tar.gz gcc-d55d2c8490cf7c44a2c48a41cf253888b3a5c552.tar.bz2 |
i386.md (and<mode>3): Expand masking operations with 0xff...
* config/i386/i386.md (and<mode>3): Expand masking operations with
0xff, 0xffff or 0xffffffff immediates to corresponding zero_extend RTX.
(and splitter): Split to DImode zero_extend RTX for DImode operand[0].
From-SVN: r186979
-rw-r--r-- | gcc/ChangeLog | 48 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 69 |
2 files changed, 77 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 264c997..009d45f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,14 @@ +2012-04-30 Uros Bizjak <ubizjak@gmail.com> + + * config/i386/i386.md (and<mode>3): Expand masking operations with + 0xff, 0xffff or 0xffffffff immediates to corresponding zero_extend RTX. + (and splitter): Split to DImode zero_extend RTX for DImode operand[0]. + 2012-04-30 Dodji Seketeli <dodji@redhat.com> Add -Wvarargs option * builtins.c (fold_builtin_next_arg): Use OPT_Wvarargs as an - argument for the various warning_at calls. + argument for the various warning_at calls. * docs/invoke.texi: Update the documentation. 2012-04-30 Dodji Seketeli <dodji@redhat.com> @@ -18,13 +24,11 @@ Make conversion warnings work on NULL with -ftrack-macro-expansion * input.h (expansion_point_location_if_in_system_header): Declare new function. - * input.c (expansion_point_location_if_in_system_header): Define - it. + * input.c (expansion_point_location_if_in_system_header): Define it. Fix -Wuninitialized for -ftrack-macro-expansion - * tree-ssa.c (warn_uninit): Use the spelling location of the - variable declaration. Use linemap_location_before_p for source - locations. + * tree-ssa.c (warn_uninit): Use the spelling location of the variable + declaration. Use linemap_location_before_p for source locations. Strip "<built-in>" loc from displayed expansion context * input.c (expand_location_1): When expanding to spelling location @@ -61,8 +65,9 @@ 2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org> - * opts.c (finish_options): Do not handle -Wmissing-noreturn here. - * common.opt (Wmissing-noreturn): Alias of -Wsuggest-attribute=noreturn. + * opts.c (finish_options): Do not handle -Wmissing-noreturn here. + * common.opt (Wmissing-noreturn): Alias of + -Wsuggest-attribute=noreturn. 2012-04-29 Hans-Peter Nilsson <hp@axis.com> @@ -102,9 +107,8 @@ 2012-04-27 Paolo Bonzini <bonzini@gnu.org> - * tree-ssa-phiopt.c (conditional_replacement): Replace PHIs - whose arguments are -1 and 0, by negating the result of the - conditional. + * tree-ssa-phiopt.c (conditional_replacement): Replace PHIs whose + arguments are -1 and 0, by negating the result of the conditional. 2012-04-27 Paolo Bonzini <bonzini@gnu.org> @@ -289,8 +293,7 @@ * config/sparc/sparc.md (attr type): Delete 'fgm_cmp'. (fpack16_vis, fpackfix_vis, fpack32_vis): Set type to fgm_pack. (fmul8x16_vis, fmul8x16au_vis, fmul8x16al_vis, fmul8sux16_vis, - fmul8ulx16_vis, fmuld8sux16_vis, fmuld8ulx16_vis): Set type to - fgm_mul. + fmul8ulx16_vis, fmuld8sux16_vis, fmuld8ulx16_vis): Set type to fgm_mul. (alignaddrsi_vis, alignaddrdi_vis, alignaddrlsi_vis, alignaddrldi_vis): Set type to gsr. (pdist_vis, pdistn<mode>_vis): Set type to fgm_pdsit. @@ -348,8 +351,7 @@ 2012-04-25 H.J. Lu <hongjiu.lu@intel.com> PR debug/52857 - * dwarf2out.c (dbx_reg_number): Assert return value != - INVALID_REGNUM. + * dwarf2out.c (dbx_reg_number): Assert return value != INVALID_REGNUM. 2012-04-25 Jakub Jelinek <jakub@redhat.com> @@ -404,8 +406,9 @@ 2012-04-25 Jan Hubicka <jh@suse.cz> - PR middle-end/53089 - * cgraphunit.c (referred_to_p): Move ahead in file to avoid forward declaration. + PR middle-end/53089 + * cgraphunit.c (referred_to_p): Move ahead in file to avoid + forward declaration. (cgraph_finalize_function): Finalize them here. * symtab.c (dump_symtab): Dump ctors and dtors. @@ -417,8 +420,7 @@ Also check that unit bytes long store at bitpos / unit * unit doesn't affect bits beyond bitregion_end. * expmed.c (store_bit_field_1): Avoid trying insv if OP_MODE MEM - would not fit into bitregion_start ... bitregion_end + 1 bit - region. + would not fit into bitregion_start ... bitregion_end + 1 bit region. (store_split_bit_field): Decrease unit close to end of bitregion_end if access is restricted in order to avoid mutual recursion. @@ -427,9 +429,8 @@ prototypes. * double-int.c (double_int_max_value, double_int_min_value): New functions. - * tree-vrp.c (register_edge_assert_for_2): Compare mask - for LE_EXPR or GT_EXPR with double_int_max_value - instead of double_int_mask. + * tree-vrp.c (register_edge_assert_for_2): Compare mask for LE_EXPR + or GT_EXPR with double_int_max_value instead of double_int_mask. 2012-04-25 Richard Guenther <rguenther@suse.de> @@ -437,8 +438,7 @@ * tree-vect-loop.c (vect_transform_loop): Adjust. * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Record the maximum number of iterations for the epilogue loop. - (vect_loop_versioning): Remove case re-using the peeled - epilogue loop. + (vect_loop_versioning): Remove case re-using the peeled epilogue loop. 2012-04-25 Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 28d2f9e..c98efaa 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -7695,14 +7695,45 @@ (match_operand:SWIM 2 "<general_szext_operand>")))] "" { - if (<MODE>mode == DImode - && GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == (HOST_WIDE_INT) 0xffffffff - && REG_P (operands[1])) - emit_insn (gen_zero_extendsidi2 (operands[0], - gen_lowpart (SImode, operands[1]))); + enum machine_mode mode = GET_MODE (operands[1]); + rtx (*insn) (rtx, rtx); + + if (CONST_INT_P (operands[2]) && REG_P (operands[0])) + { + HOST_WIDE_INT ival = INTVAL (operands[2]); + + if (ival == (HOST_WIDE_INT) 0xffffffff) + mode = SImode; + else if (ival == 0xffff) + mode = HImode; + else if (ival == 0xff) + mode = QImode; + } + + if (mode == GET_MODE (operands[1])) + { + ix86_expand_binary_operator (AND, <MODE>mode, operands); + DONE; + } + + operands[1] = gen_lowpart (mode, operands[1]); + + if (GET_MODE (operands[0]) == DImode) + insn = (mode == SImode) + ? gen_zero_extendsidi2 + : (mode == HImode) + ? gen_zero_extendhidi2 + : gen_zero_extendqidi2; + else if (GET_MODE (operands[0]) == SImode) + insn = (mode == HImode) + ? gen_zero_extendhisi2 + : gen_zero_extendqisi2; + else if (GET_MODE (operands[0]) == HImode) + insn = gen_zero_extendqihi2; else - ix86_expand_binary_operator (AND, <MODE>mode, operands); + gcc_unreachable (); + + emit_insn (insn (operands[0], operands[1])); DONE; }) @@ -7839,32 +7870,38 @@ && true_regnum (operands[0]) != true_regnum (operands[1])" [(const_int 0)] { + HOST_WIDE_INT ival = INTVAL (operands[2]); enum machine_mode mode; + rtx (*insn) (rtx, rtx); - if (INTVAL (operands[2]) == (HOST_WIDE_INT) 0xffffffff) + if (ival == (HOST_WIDE_INT) 0xffffffff) mode = SImode; - else if (INTVAL (operands[2]) == 0xffff) + else if (ival == 0xffff) mode = HImode; else { - gcc_assert (INTVAL (operands[2]) == 0xff); + gcc_assert (ival == 0xff); mode = QImode; } operands[1] = gen_lowpart (mode, operands[1]); - if (mode == SImode) - emit_insn (gen_zero_extendsidi2 (operands[0], operands[1])); + if (GET_MODE (operands[0]) == DImode) + insn = (mode == SImode) + ? gen_zero_extendsidi2 + : (mode == HImode) + ? gen_zero_extendhidi2 + : gen_zero_extendqidi2; else { - rtx (*insn) (rtx, rtx); - /* Zero extend to SImode to avoid partial register stalls. */ operands[0] = gen_lowpart (SImode, operands[0]); - insn = (mode == HImode) ? gen_zero_extendhisi2 : gen_zero_extendqisi2; - emit_insn (insn (operands[0], operands[1])); + insn = (mode == HImode) + ? gen_zero_extendhisi2 + : gen_zero_extendqisi2; } + emit_insn (insn (operands[0], operands[1])); DONE; }) |