Re: [PATCH, rs6000] Port cleanup patch, use rtl.h convenience macros, etc.

2019-01-24 Thread Peter Bergner
On 1/23/19 10:31 AM, Segher Boessenkool wrote:
>>  (rs6000_init_hard_regno_mode_ok, direct_move_p): Use 
>> HARD_REGISTER_NUM_P.
> 
> This line is too long.

Fixed.


> And that is the worst I see in that whole patch!  Please apply it.

Committed after a svn update and another self review of the patch,
along with another round of bootstrap and regtesting which showed
no regressions.  Thanks!

Peter

 



Re: [PATCH, rs6000] Port cleanup patch, use rtl.h convenience macros, etc.

2019-01-23 Thread Segher Boessenkool
Hi!

On Tue, Dec 04, 2018 at 10:12:51AM -0600, Peter Bergner wrote:
> We talked about replacing rs6000'c regno_or_subregno() with the generic
> reg_or_subregno() function from jump.c.  I agree the geberic version is
> better because it has an assert that ensures we have a REG.  There were
> also a couple of places that could use reg_or_subregno() where we weren't.
> I made those changes and tested it and ran into no regressions.
> 
> Nearby the changes above, there were cases where could could have been using
> the rtl convenience macros like REG_P, etc. to simplify the code so I did
> that too...and kept going and just ended up converting all the cases I could
> find that should have been using them, to use them.  So the patch is large,
> but pretty straight forward.

In the future, please do separate patches?  Especially mechanical ones
could be separated (and then be much easier to review -- you also post
the script, and then I don't have to check it really is mechanical,
instead of just boring and you could have made mistakes).

>   (rs6000_init_hard_regno_mode_ok, direct_move_p): Use 
> HARD_REGISTER_NUM_P.

This line is too long.

And that is the worst I see in that whole patch!  Please apply it.

Thanks!


Segher


Re: [PATCH, rs6000] Port cleanup patch, use rtl.h convenience macros, etc.

2019-01-07 Thread Peter Bergner
On 12/12/18 1:58 PM, Peter Bergner wrote:
> Ping.

Ping * 2.

https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00212.html

Peter




Re: [PATCH, rs6000] Port cleanup patch, use rtl.h convenience macros, etc.

2018-12-12 Thread Peter Bergner
Ping.

Peter


On 12/4/18 10:12 AM, Peter Bergner wrote:
> Hi Segher,
> 
> We talked about replacing rs6000'c regno_or_subregno() with the generic
> reg_or_subregno() function from jump.c.  I agree the geberic version is
> better because it has an assert that ensures we have a REG.  There were
> also a couple of places that could use reg_or_subregno() where we weren't.
> I made those changes and tested it and ran into no regressions.
> 
> Nearby the changes above, there were cases where could could have been using
> the rtl convenience macros like REG_P, etc. to simplify the code so I did
> that too...and kept going and just ended up converting all the cases I could
> find that should have been using them, to use them.  So the patch is large,
> but pretty straight forward.
> 
> The passed bootstrap and regtesting on powerpc64le-linux with no regressions.
> Ok for mainline?
> 
> Peter
> 
>   * config/rs6000/altivec.md (build_vector_mask_for_load): Use MEM_P.
>   * config/rs6000/constraints.md (Q constraint): Use REG_P.
>   * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Use SYMBOL_REF_P.
>   * config/rs6000/freebsd64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Use
>   SYMBOL_REF_P, CONST_INT_P and CONST_DOUBLE_P.
>   * config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Likewise.
>   * config/rs6000/predicates.md (altivec_register_operand, vint_operand,
>   vsx_register_operand, vsx_reg_sfsubreg_ok, vfloat_operand,
>   vlogical_operand, gpc_reg_operand, int_reg_operand,
>   int_reg_operand_not_pseudo): Use SUBREG_P and HARD_REGISTER_P.
>   (ca_operand, base_reg_operand, htm_spr_reg_operand, cc_reg_operand,
>   cc_reg_not_cr0_operand, input_operand): Use SUBREG_P.
>   (save_world_operation, restore_world_operation, lmw_operation,
>   stmw_operation): Use MEM_P and REG_P.
>   (tie_operand): Use MEM_P.
>   (vrsave_operation, crsave_operation): Use REG_P.
>   (mfcr_operation, mtcrf_operation): Use REG_P and CONST_INT_P.
>   (fpr_reg_operand): Use SUBREG_P and HARD_REGISTER_NUM_P.
>   (quad_int_reg_operand): Use HARD_REGISTER_NUM_P.
>   (call_operand): Use HARD_REGISTER_P.
>   (indexed_or_indirect_operand, altivec_indexed_or_indirect_operand):
>   Use CONST_INT_P.
>   (lwa_operand): Use SUBREG_P, REG_P and CONST_INT_P.
>   * config/rs6000/rs6000-p8swap.c (insn_is_load_p, insn_is_store_p,
>   quad_aligned_load_p, replace_swapped_aligned_store,
>   recombine_lvx_pattern, replace_swapped_aligned_load,
>   recombine_stvx_pattern): Use MEM_P.
>   (const_load_sequence_p, adjust_vperm, replace_swapped_load_constant):
>   Use MEM_P and SYMBOL_REF_P.
>   (rtx_is_swappable_p): Use REG_P and CONST_INT_P.
>   (insn_is_swappable_p): Use REG_P and MEM_P.
>   (insn_is_swap_p, (alignment_mask): Use CONST_INT_P.
>   * config/rs6000/rs6000-string.c (expand_block_clear, expand_block_move):
>   Use CONST_INT_P.
>   * config/rs6000/rs6000.c (rs6000_secondary_reload, rs6000_emit_cmove,
>   rs6000_legitimate_constant_p): Use CONST_DOUBLE_P.
>   (rs6000_output_move_128bit): Use CONST_DOUBLE_P, CONST_INT_P and
>   CONST_WIDE_INT_P.
>   (rs6000_legitimize_address): Use CONST_DOUBLE_P, CONST_INT_P,
>   CONST_WIDE_INT_P, REG_P and SYMBOL_REF_P.
>   (rs6000_emit_move): Use CONST_DOUBLE_P, CONST_INT_P, HARD_REGISTER_P,
>   HARD_REGISTER_NUM_P, MEM_P, REG_P, SUBREG_P, SYMBOL_REF_P and
>   reg_or_subregno:
>   (output_toc): Use CONST_DOUBLE_P, CONST_INT_P and SYMBOL_REF_P.
>   (easy_altivec_constant, rs6000_legitimate_offset_address_p,
>   rs6000_mode_dependent_address, rs6000_expand_mtfsf_builtin,
>   rs6000_expand_set_fpscr_rn_builtin, rs6000_expand_set_fpscr_drn_builtin,
>   rs6000_expand_unop_builtin, INT_P, rs6000_generate_compare,
>   rs6000_machopic_legitimize_pic_address, rs6000_split_logical_inner,
>   rs6000_split_logical_di): Use CONST_INT_P.
>   (rs6000_legitimize_reload_address): Use CONST_INT_P, HARD_REGISTER_P,
>   REG_P and SYMBOL_REF_P.
>   (setup_incoming_varargs, rs6000_rtx_costs): Use CONST_INT_P and MEM_P.
>   (print_operand): Use CONST_INT_P, MEM_P and REG_P.
>   (virtual_stack_registers_memory_p, rs6000_legitimate_address_p,
>   mems_ok_for_quad_peep): Use CONST_INT_P and REG_P.
>   (rs6000_secondary_reload_memory): Use CONST_INT_P and SUBREG_P.
>   (small_data_operand, print_operand_address): Use CONST_INT_P and
>   SYMBOL_REF_P.
>   (split_stack_arg_pointer_used_p): Use HARD_REGISTER_P.
>   (rs6000_init_hard_regno_mode_ok, direct_move_p): Use 
> HARD_REGISTER_NUM_P.
>   (rs6000_secondary_reload_gpr): Use HARD_REGISTER_NUM_P and MEM_P.
>   (rs6000_secondary_reload_class): Use HARD_REGISTER_NUM_P, REG_P,
>   SUBREG_P and SYMBOL_REF_P.
>   (register_to_reg_type, rs6000_secondary_reload_inner): Use SUBREG_P
>   and HARD_REGISTER_NUM_P.
>   

[PATCH, rs6000] Port cleanup patch, use rtl.h convenience macros, etc.

2018-12-04 Thread Peter Bergner
Hi Segher,

We talked about replacing rs6000'c regno_or_subregno() with the generic
reg_or_subregno() function from jump.c.  I agree the geberic version is
better because it has an assert that ensures we have a REG.  There were
also a couple of places that could use reg_or_subregno() where we weren't.
I made those changes and tested it and ran into no regressions.

Nearby the changes above, there were cases where could could have been using
the rtl convenience macros like REG_P, etc. to simplify the code so I did
that too...and kept going and just ended up converting all the cases I could
find that should have been using them, to use them.  So the patch is large,
but pretty straight forward.

The passed bootstrap and regtesting on powerpc64le-linux with no regressions.
Ok for mainline?

Peter

* config/rs6000/altivec.md (build_vector_mask_for_load): Use MEM_P.
* config/rs6000/constraints.md (Q constraint): Use REG_P.
* config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Use SYMBOL_REF_P.
* config/rs6000/freebsd64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Use
SYMBOL_REF_P, CONST_INT_P and CONST_DOUBLE_P.
* config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Likewise.
* config/rs6000/predicates.md (altivec_register_operand, vint_operand,
vsx_register_operand, vsx_reg_sfsubreg_ok, vfloat_operand,
vlogical_operand, gpc_reg_operand, int_reg_operand,
int_reg_operand_not_pseudo): Use SUBREG_P and HARD_REGISTER_P.
(ca_operand, base_reg_operand, htm_spr_reg_operand, cc_reg_operand,
cc_reg_not_cr0_operand, input_operand): Use SUBREG_P.
(save_world_operation, restore_world_operation, lmw_operation,
stmw_operation): Use MEM_P and REG_P.
(tie_operand): Use MEM_P.
(vrsave_operation, crsave_operation): Use REG_P.
(mfcr_operation, mtcrf_operation): Use REG_P and CONST_INT_P.
(fpr_reg_operand): Use SUBREG_P and HARD_REGISTER_NUM_P.
(quad_int_reg_operand): Use HARD_REGISTER_NUM_P.
(call_operand): Use HARD_REGISTER_P.
(indexed_or_indirect_operand, altivec_indexed_or_indirect_operand):
Use CONST_INT_P.
(lwa_operand): Use SUBREG_P, REG_P and CONST_INT_P.
* config/rs6000/rs6000-p8swap.c (insn_is_load_p, insn_is_store_p,
quad_aligned_load_p, replace_swapped_aligned_store,
recombine_lvx_pattern, replace_swapped_aligned_load,
recombine_stvx_pattern): Use MEM_P.
(const_load_sequence_p, adjust_vperm, replace_swapped_load_constant):
Use MEM_P and SYMBOL_REF_P.
(rtx_is_swappable_p): Use REG_P and CONST_INT_P.
(insn_is_swappable_p): Use REG_P and MEM_P.
(insn_is_swap_p, (alignment_mask): Use CONST_INT_P.
* config/rs6000/rs6000-string.c (expand_block_clear, expand_block_move):
Use CONST_INT_P.
* config/rs6000/rs6000.c (rs6000_secondary_reload, rs6000_emit_cmove,
rs6000_legitimate_constant_p): Use CONST_DOUBLE_P.
(rs6000_output_move_128bit): Use CONST_DOUBLE_P, CONST_INT_P and
CONST_WIDE_INT_P.
(rs6000_legitimize_address): Use CONST_DOUBLE_P, CONST_INT_P,
CONST_WIDE_INT_P, REG_P and SYMBOL_REF_P.
(rs6000_emit_move): Use CONST_DOUBLE_P, CONST_INT_P, HARD_REGISTER_P,
HARD_REGISTER_NUM_P, MEM_P, REG_P, SUBREG_P, SYMBOL_REF_P and
reg_or_subregno:
(output_toc): Use CONST_DOUBLE_P, CONST_INT_P and SYMBOL_REF_P.
(easy_altivec_constant, rs6000_legitimate_offset_address_p,
rs6000_mode_dependent_address, rs6000_expand_mtfsf_builtin,
rs6000_expand_set_fpscr_rn_builtin, rs6000_expand_set_fpscr_drn_builtin,
rs6000_expand_unop_builtin, INT_P, rs6000_generate_compare,
rs6000_machopic_legitimize_pic_address, rs6000_split_logical_inner,
rs6000_split_logical_di): Use CONST_INT_P.
(rs6000_legitimize_reload_address): Use CONST_INT_P, HARD_REGISTER_P,
REG_P and SYMBOL_REF_P.
(setup_incoming_varargs, rs6000_rtx_costs): Use CONST_INT_P and MEM_P.
(print_operand): Use CONST_INT_P, MEM_P and REG_P.
(virtual_stack_registers_memory_p, rs6000_legitimate_address_p,
mems_ok_for_quad_peep): Use CONST_INT_P and REG_P.
(rs6000_secondary_reload_memory): Use CONST_INT_P and SUBREG_P.
(small_data_operand, print_operand_address): Use CONST_INT_P and
SYMBOL_REF_P.
(split_stack_arg_pointer_used_p): Use HARD_REGISTER_P.
(rs6000_init_hard_regno_mode_ok, direct_move_p): Use 
HARD_REGISTER_NUM_P.
(rs6000_secondary_reload_gpr): Use HARD_REGISTER_NUM_P and MEM_P.
(rs6000_secondary_reload_class): Use HARD_REGISTER_NUM_P, REG_P,
SUBREG_P and SYMBOL_REF_P.
(register_to_reg_type, rs6000_secondary_reload_inner): Use SUBREG_P
and HARD_REGISTER_NUM_P.
(rs6000_adjust_vec_address): Use HARD_REGISTER_NUM_P and
reg_or_subregno.
(rs6000_adjust_cost,