From patchwork Thu Oct 30 05:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 404877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1D41B14007D for ; Thu, 30 Oct 2014 16:16:33 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=e//9mbjvuOG6ax3cALTU/BcaTZYbihmWzDqZLpkiOf0HQH TfNUg51ZJlPWYV5mrOBNF4KpbGbgKtitLaip3/QHJHO+eyPcXphHx7PGsphDBNhK OWGR55DlTRX5Wskw0b9iduMRtthiTX87mOKTRbHrAG6JMgpopLzPWr/XWQIHk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=F9uP1XALzOZmmIRdC8iyc8A9ZR8=; b=kkecnWkagGcUH0NpBPsS b2hpy7ZA6dfQJ0OOLB9atZqM2G8ARxXVdI//aV3Zgcs0ASOfzR9wNdyRXay2KGaU qr595vkElGX0SDlYVgBu/fIzGAM/qS5WuHt8NbWiQMg23IFq/wuHAfnHDVivYb+y B/w7BFgtivA6dip9qcdlQIc= Received: (qmail 31406 invoked by alias); 30 Oct 2014 05:16:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31387 invoked by uid 89); 30 Oct 2014 05:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 30 Oct 2014 05:16:19 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9U5GHvs029939 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 30 Oct 2014 01:16:17 -0400 Received: from [10.3.113.140] (ovpn-113-140.phx2.redhat.com [10.3.113.140]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9U5GHaD019573 for ; Thu, 30 Oct 2014 01:16:17 -0400 Message-ID: <5451C9A0.2030903@redhat.com> Date: Wed, 29 Oct 2014 23:16:16 -0600 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: PA port -- promoting various arguments/local variables to rtx_insn * X-IsSubscribed: yes For the first time in over a decade, I'm going to poke a bit at the PA port. Basically I want to use Bin's work to do insn fusion to generate fmpyadd and fmpysub instructions on the PA -- doing so ought to answer most of my questions about the implementation. Ultimately that'll be throw-away work since those instructions are a lose on the PA8000 processors and I can't believe anyone is actively using a PA7xxx[LC] processor to do high performance floating point :-) So when I'm done pa_combine_instructions will probably just be removed. Before I embark on that experiment, it seemed reasonable to go ahead and do some trivial housekeeping. Specifically changing some types from rtx to rtx_insn * when it was obvious they could be strengthened. This patch was bootstrapped for sanity (but not regression tested) on hppa-unknown-linux-gnu. Installed on the trunk. * config/pa/pa-protos.h (pa_output_arg_descriptor): Strengthen argument from rtx to rtx_insn *. (compute_movmem_length, compute_clrmem_length): Likewise. (copy_fp_args, length_fp_args): Likewise. * config/pa/pa.c (legitimize_pic_address): Promote local variable "insn" from rtx to rtx_insn *. (legitimize_tls_address, pa_emit_move_sequence): Likewise. (pa_output_block_move, store_reg, store_reg_modify): Likewise. (set_reg_plus_d, pa_expand_prologue, hppa_profile_hook): Likewise. (branch_to_delay_slot_p, branch_needs_nop_p, use_skip_p): Likewise. (pa_output_arg_descriptor): Strengthen argument to an rtx_insn *. (compute_movmem_length, compute_clrmem_length): Likewise. (copy_fp-args, length_fp_args): Likewise. diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 80e1efe..0ba5055 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -48,7 +48,7 @@ extern const char *pa_output_mod_insn (int, rtx_insn *); extern const char *pa_singlemove_string (rtx *); extern void pa_output_addr_vec (rtx, rtx); extern void pa_output_addr_diff_vec (rtx, rtx); -extern void pa_output_arg_descriptor (rtx); +extern void pa_output_arg_descriptor (rtx_insn *); extern void pa_output_global_address (FILE *, rtx, int); extern void pa_print_operand (FILE *, rtx, int); extern void pa_encode_label (rtx); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 7072722..6e34d77 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -117,8 +117,8 @@ static int pa_can_combine_p (rtx_insn *, rtx_insn *, rtx_insn *, int, rtx, static bool forward_branch_p (rtx_insn *); static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *); static void compute_zdepdi_operands (unsigned HOST_WIDE_INT, unsigned *); -static int compute_movmem_length (rtx); -static int compute_clrmem_length (rtx); +static int compute_movmem_length (rtx_insn *); +static int compute_clrmem_length (rtx_insn *); static bool pa_assemble_integer (rtx, unsigned int, int); static void remove_useless_addtr_insns (int); static void store_reg (int, HOST_WIDE_INT, int); @@ -156,8 +156,8 @@ static void hppa_va_start (tree, rtx); static tree hppa_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); static bool pa_scalar_mode_supported_p (machine_mode); static bool pa_commutative_p (const_rtx x, int outer_code); -static void copy_fp_args (rtx) ATTRIBUTE_UNUSED; -static int length_fp_args (rtx) ATTRIBUTE_UNUSED; +static void copy_fp_args (rtx_insn *) ATTRIBUTE_UNUSED; +static int length_fp_args (rtx_insn *) ATTRIBUTE_UNUSED; static rtx hppa_legitimize_address (rtx, rtx, machine_mode); static inline void pa_file_start_level (void) ATTRIBUTE_UNUSED; static inline void pa_file_start_space (int) ATTRIBUTE_UNUSED; @@ -775,7 +775,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) /* Labels need special handling. */ if (pic_label_operand (orig, mode)) { - rtx insn; + rtx_insn *insn; /* We do not want to go through the movXX expanders here since that would create recursion. @@ -811,7 +811,8 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) } if (GET_CODE (orig) == SYMBOL_REF) { - rtx insn, tmp_reg; + rtx_insn *insn; + rtx tmp_reg; gcc_assert (reg); @@ -915,7 +916,8 @@ hppa_tls_call (rtx arg) static rtx legitimize_tls_address (rtx addr) { - rtx ret, insn, tmp, t1, t2, tp; + rtx ret, tmp, t1, t2, tp; + rtx_insn *insn; /* Currently, we can't handle anything but a SYMBOL_REF. */ if (GET_CODE (addr) != SYMBOL_REF) @@ -2090,7 +2092,8 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) else if (GET_CODE (operand1) != CONST_INT || !pa_cint_ok_for_move (INTVAL (operand1))) { - rtx insn, temp; + rtx temp; + rtx_insn *insn; rtx op1 = operand1; HOST_WIDE_INT value = 0; HOST_WIDE_INT insv = 0; @@ -2884,7 +2887,7 @@ pa_output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) count insns rather than emit them. */ static int -compute_movmem_length (rtx insn) +compute_movmem_length (rtx_insn *insn) { rtx pat = PATTERN (insn); unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 7), 0)); @@ -3026,7 +3029,7 @@ pa_output_block_clear (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) count insns rather than emit them. */ static int -compute_clrmem_length (rtx insn) +compute_clrmem_length (rtx_insn *insn) { rtx pat = PATTERN (insn); unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 4), 0)); @@ -3515,7 +3518,8 @@ static int save_fregs; static void store_reg (int reg, HOST_WIDE_INT disp, int base) { - rtx insn, dest, src, basereg; + rtx dest, src, basereg; + rtx_insn *insn; src = gen_rtx_REG (word_mode, reg); basereg = gen_rtx_REG (Pmode, base); @@ -3570,7 +3574,8 @@ store_reg (int reg, HOST_WIDE_INT disp, int base) static void store_reg_modify (int base, int reg, HOST_WIDE_INT mod) { - rtx insn, basereg, srcreg, delta; + rtx basereg, srcreg, delta; + rtx_insn *insn; gcc_assert (VAL_14_BITS_P (mod)); @@ -3600,7 +3605,7 @@ store_reg_modify (int base, int reg, HOST_WIDE_INT mod) static void set_reg_plus_d (int reg, int base, HOST_WIDE_INT disp, int note) { - rtx insn; + rtx_insn *insn; if (VAL_14_BITS_P (disp)) { @@ -3790,7 +3795,8 @@ pa_expand_prologue (void) HOST_WIDE_INT size = get_frame_size (); HOST_WIDE_INT offset; int i; - rtx insn, tmpreg; + rtx tmpreg; + rtx_insn *insn; gr_saved = 0; fr_saved = 0; @@ -4035,7 +4041,8 @@ pa_expand_prologue (void) if (df_regs_ever_live_p (i) || (! TARGET_64BIT && df_regs_ever_live_p (i + 1))) { - rtx addr, insn, reg; + rtx addr, reg; + rtx_insn *insn; addr = gen_rtx_MEM (DFmode, gen_rtx_POST_INC (word_mode, tmpreg)); reg = gen_rtx_REG (DFmode, i); @@ -4454,7 +4461,8 @@ hppa_profile_hook (int label_no) lcla2 and load_offset_label_address insn patterns. */ rtx reg = gen_reg_rtx (SImode); rtx_code_label *label_rtx = gen_label_rtx (); - rtx begin_label_rtx, call_insn; + rtx begin_label_rtx; + rtx_insn *call_insn; char begin_label_name[16]; ASM_GENERATE_INTERNAL_LABEL (begin_label_name, FUNC_BEGIN_PROLOG_LABEL, @@ -5826,7 +5834,7 @@ pa_output_mod_insn (int unsignedp, rtx_insn *insn) } void -pa_output_arg_descriptor (rtx call_insn) +pa_output_arg_descriptor (rtx_insn *call_insn) { const char *arg_regs[4]; machine_mode arg_mode; @@ -6334,7 +6342,7 @@ pa_scalar_mode_supported_p (machine_mode mode) static bool branch_to_delay_slot_p (rtx_insn *insn) { - rtx jump_insn; + rtx_insn *jump_insn; if (dbr_sequence_length ()) return FALSE; @@ -6368,7 +6376,7 @@ branch_to_delay_slot_p (rtx_insn *insn) static bool branch_needs_nop_p (rtx_insn *insn) { - rtx jump_insn; + rtx_insn *jump_insn; if (dbr_sequence_length ()) return FALSE; @@ -6396,7 +6404,7 @@ branch_needs_nop_p (rtx_insn *insn) static bool use_skip_p (rtx_insn *insn) { - rtx jump_insn = next_active_insn (JUMP_LABEL (insn)); + rtx_insn *jump_insn = next_active_insn (JUMP_LABEL (insn)); while (insn) { @@ -7428,7 +7436,7 @@ pa_output_movb (rtx *operands, rtx_insn *insn, int which_alternative, /* Copy any FP arguments in INSN into integer registers. */ static void -copy_fp_args (rtx insn) +copy_fp_args (rtx_insn *insn) { rtx link; rtx xoperands[2]; @@ -7471,7 +7479,7 @@ copy_fp_args (rtx insn) /* Compute length of the FP argument copy sequence for INSN. */ static int -length_fp_args (rtx insn) +length_fp_args (rtx_insn *insn) { int length = 0; rtx link;