From patchwork Wed Feb 12 17:36:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1236971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519422-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=Q5HCI3Dd; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F1SFmgbN; dkim-atps=neutral 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 48Hmz60yLtz9sPF for ; Thu, 13 Feb 2020 04:36:32 +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:subject:from:reply-to:to:date:mime-version :content-type; q=dns; s=default; b=AjdqMpwuskVc/kYqi3ft5z4odznws P0ZGBFlLtefT1jwqxVVxx86hVGBKs2wggLMXTviArCQvmFx3zqO8W1uJ/diM3Z70 JaN1A9lx9brfxA0xaUrctzfNNvVOnWxrdiRus/dmzT/fyRkUlPkP/KEvIBK6cCtQ hUXFYXGu8w2F8s= 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:subject:from:reply-to:to:date:mime-version :content-type; s=default; bh=ttrx+2OzGYBTaOH2qrUSPJmqNcc=; b=Q5H CI3DdN4o6A6aDH++Huzh7JEEGT5x+sIEgZfVa7UdyCrYBXV7aJnivf+YWn3mBElW WfxPtOMdP+TwSJ0jjBiozaH6QoWK0o3ryAtrjsURz1QJIKA+VgacrTF2ZzN+Q/27 R1vocmrd4KoQcuC84v5aYbP0CqRVVJWspdM83zZA= Received: (qmail 99566 invoked by alias); 12 Feb 2020 17:36:23 -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 99557 invoked by uid 89); 12 Feb 2020 17:36:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2020 17:36:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581528977; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=hL9WDYXKGlR6j/KnhVOLIWirMFBXFZHsxNMi5EzAH/w=; b=F1SFmgbNI7E9U1NVRiDyiZ8d75x9+TvhW/A9/UyY2pRNOvhwcMgyuRJqZP0lOUkrQgjKtp JY6O8vqH6nOOi28RZy1AMMs7lJ+xounaU/nNIEOScJ696FBD+3o3phSNGiBdN40akwCUB8 yRign8LZBB6kXKypsb2K6MFHzpxmhBA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-8EtbhK2DP7GGMRA0YMJ1pA-1; Wed, 12 Feb 2020 12:36:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88A001005502 for ; Wed, 12 Feb 2020 17:36:13 +0000 (UTC) Received: from ovpn-118-11.phx2.redhat.com (ovpn-118-11.phx2.redhat.com [10.3.118.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3517860BF1 for ; Wed, 12 Feb 2020 17:36:12 +0000 (UTC) Message-ID: <9dbc903e1d91cf3a3113d7042ad7b42ff75a777d.camel@redhat.com> Subject: [committed] Clean up various dead patterns, expanders, splitters and peepholes on the H8. From: Jeff Law Reply-To: law@redhat.com To: gcc-patches List Date: Wed, 12 Feb 2020 10:36:10 -0700 User-Agent: Evolution 3.34.3 (3.34.3-1.fc31) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-IsSubscribed: yes I needed some mindless work yesterday, so I took the opportunity to do some light cleanups on the H8 port in the hopes that removing unnecessary cruft will make cc0 conversion easier. In this round I'm removing all the expanders, patterns and splitters that have been disabled (in some cases for ~15 years) as well as removing the peepholes that widen QI/HI mode pushes to SImode. I verified none of those peepholes trigger during the course of building libgcc, newlib or across the testsuite (I won't list all the multilibs, there's many :-) I didn't feel such rigor was needed for the previously disabled patterns, expanders and splitters. While we're in stage4, this is isolated to the H8 target which is currently scheduled for deprecation. So it's seems safe enough :-) There'll be more of these cleanups coming. Removing the unused combiner patterns in particular is useful to simplify the cc0 conversion. Installing on the trunk momentarily. Jeff commit e5cc04a73a3e212114ca9725911eaaa66d32303c Author: Jeff Law Date: Wed Feb 12 10:35:12 2020 -0700 Clean up dead patterns, splitters, expanders and peepholes on the H8 port. * config/h8300/h8300.md (cpymemsi, movmd): Remove dead patterns, expanders, splits, etc. (movmd_internal_, movmd splitter, movstr, movsd): Likewise. (stpcpy_internal_, stpcpy splitter): Likewise. (peepholes to convert QI/HI mode pushes to SI mode pushes): Likewise. * config/h8300/h8300.c (h8300_swap_into_er6): Remove unused function. (h8300_swap_out_of_er6, h8sx_emit_movmd): Likewise * config/h8300/h8300-protos.h (h8300_swap_into_er6): Remove unused function prototype. (h8300_swap_out_of_er6, h8sx_emit_movmd): Likewise. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fa4768d816..9ff0a943e4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2020-02-12 Jeff Law + + * config/h8300/h8300.md (cpymemsi, movmd): Remove dead patterns, + expanders, splits, etc. + (movmd_internal_, movmd splitter, movstr, movsd): Likewise. + (stpcpy_internal_, stpcpy splitter): Likewise. + (peepholes to convert QI/HI mode pushes to SI mode pushes): Likewise. + * config/h8300/h8300.c (h8300_swap_into_er6): Remove unused function. + (h8300_swap_out_of_er6, h8sx_emit_movmd): Likewise + * config/h8300/h8300-protos.h (h8300_swap_into_er6): Remove unused + function prototype. + (h8300_swap_out_of_er6, h8sx_emit_movmd): Likewise. + 2020-02-12 Jakub Jelinek PR target/93670 diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 0cbb091390d..2416741e76a 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -109,9 +109,6 @@ extern unsigned int h8300_insn_length_from_table (rtx_insn *, rtx *); extern const char * output_h8sx_shift (rtx *, int, int); extern bool h8300_operands_match_p (rtx *); extern bool h8sx_mergeable_memrefs_p (rtx, rtx); -extern bool h8sx_emit_movmd (rtx, rtx, rtx, HOST_WIDE_INT); -extern void h8300_swap_into_er6 (rtx); -extern void h8300_swap_out_of_er6 (rtx); extern poly_int64 h8300_push_rounding (poly_int64); #endif /* ! GCC_H8300_PROTOS_H */ diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index def8be344af..d2fea04d8e4 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -2647,145 +2647,6 @@ h8300_operands_match_p (rtx *operands) return false; } -/* Try using movmd to move LENGTH bytes from memory region SRC to memory - region DEST. The two regions do not overlap and have the common - alignment given by ALIGNMENT. Return true on success. - - Using movmd for variable-length moves seems to involve some - complex trade-offs. For instance: - - - Preparing for a movmd instruction is similar to preparing - for a memcpy. The main difference is that the arguments - are moved into er4, er5 and er6 rather than er0, er1 and er2. - - - Since movmd clobbers the frame pointer, we need to save - and restore it somehow when frame_pointer_needed. This can - sometimes make movmd sequences longer than calls to memcpy(). - - - The counter register is 16 bits, so the instruction is only - suitable for variable-length moves when sizeof (size_t) == 2. - That's only true in normal mode. - - - We will often lack static alignment information. Falling back - on movmd.b would likely be slower than calling memcpy(), at least - for big moves. - - This function therefore only uses movmd when the length is a - known constant, and only then if -fomit-frame-pointer is in - effect or if we're not optimizing for size. - - At the moment the function uses movmd for all in-range constants, - but it might be better to fall back on memcpy() for large moves - if ALIGNMENT == 1. */ - -bool -h8sx_emit_movmd (rtx dest, rtx src, rtx length, - HOST_WIDE_INT alignment) -{ - if (!flag_omit_frame_pointer && optimize_size) - return false; - - if (GET_CODE (length) == CONST_INT) - { - rtx dest_reg, src_reg, first_dest, first_src; - HOST_WIDE_INT n; - int factor; - - /* Use movmd.l if the alignment allows it, otherwise fall back - on movmd.b. */ - factor = (alignment >= 2 ? 4 : 1); - - /* Make sure the length is within range. We can handle counter - values up to 65536, although HImode truncation will make - the count appear negative in rtl dumps. */ - n = INTVAL (length); - if (n <= 0 || n / factor > 65536) - return false; - - /* Create temporary registers for the source and destination - pointers. Initialize them to the start of each region. */ - dest_reg = copy_addr_to_reg (XEXP (dest, 0)); - src_reg = copy_addr_to_reg (XEXP (src, 0)); - - /* Create references to the movmd source and destination blocks. */ - first_dest = replace_equiv_address (dest, dest_reg); - first_src = replace_equiv_address (src, src_reg); - - set_mem_size (first_dest, n & -factor); - set_mem_size (first_src, n & -factor); - - length = copy_to_mode_reg (HImode, gen_int_mode (n / factor, HImode)); - emit_insn (gen_movmd (first_dest, first_src, length, GEN_INT (factor))); - - if ((n & -factor) != n) - { - /* Move SRC and DEST past the region we just copied. - This is done to update the memory attributes. */ - dest = adjust_address (dest, BLKmode, n & -factor); - src = adjust_address (src, BLKmode, n & -factor); - - /* Replace the addresses with the source and destination - registers, which movmd has left with the right values. */ - dest = replace_equiv_address (dest, dest_reg); - src = replace_equiv_address (src, src_reg); - - /* Mop up the left-over bytes. */ - if (n & 2) - emit_move_insn (adjust_address (dest, HImode, 0), - adjust_address (src, HImode, 0)); - if (n & 1) - emit_move_insn (adjust_address (dest, QImode, n & 2), - adjust_address (src, QImode, n & 2)); - } - return true; - } - return false; -} - -/* Move ADDR into er6 after pushing its old value onto the stack. */ - -void -h8300_swap_into_er6 (rtx addr) -{ - rtx insn = push (HARD_FRAME_POINTER_REGNUM, false); - if (frame_pointer_needed) - add_reg_note (insn, REG_CFA_DEF_CFA, - plus_constant (Pmode, gen_rtx_MEM (Pmode, stack_pointer_rtx), - 2 * UNITS_PER_WORD)); - else - add_reg_note (insn, REG_CFA_ADJUST_CFA, - gen_rtx_SET (stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, 4))); - - emit_move_insn (hard_frame_pointer_rtx, addr); - if (REGNO (addr) == SP_REG) - emit_move_insn (hard_frame_pointer_rtx, - plus_constant (Pmode, hard_frame_pointer_rtx, - GET_MODE_SIZE (word_mode))); -} - -/* Move the current value of er6 into ADDR and pop its old value - from the stack. */ - -void -h8300_swap_out_of_er6 (rtx addr) -{ - rtx insn; - - if (REGNO (addr) != SP_REG) - emit_move_insn (addr, hard_frame_pointer_rtx); - - insn = pop (HARD_FRAME_POINTER_REGNUM); - if (frame_pointer_needed) - add_reg_note (insn, REG_CFA_DEF_CFA, - plus_constant (Pmode, hard_frame_pointer_rtx, - 2 * UNITS_PER_WORD)); - else - add_reg_note (insn, REG_CFA_ADJUST_CFA, - gen_rtx_SET (stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, -4))); -} - /* Return the length of mov instruction. */ unsigned int diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 4c219a70eea..0548368215b 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -474,174 +474,6 @@ (set_attr "length_table" "*,movl") (set_attr "cc" "set_zn,set_znv")]) -;; Implement block copies using movmd. Defining cpymemsi allows the full -;; range of constant lengths (up to 0x40000 bytes when using movmd.l). -;; See h8sx_emit_movmd for details. - -(define_expand "cpymemsi" - [(use (match_operand:BLK 0 "memory_operand" "")) - (use (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:SI 2 "" "")) - (use (match_operand:SI 3 "const_int_operand" ""))] - "TARGET_H8300SX && 0" - { - if (h8sx_emit_movmd (operands[0], operands[1], operands[2], INTVAL (operands[3]))) - DONE; - else - FAIL; - }) - -;; Expander for generating movmd insns. Operand 0 is the destination -;; memory region, operand 1 is the source, operand 2 is the counter -;; register and operand 3 is the chunk size (1, 2 or 4). - -(define_expand "movmd" - [(parallel - [(set (match_operand:BLK 0 "memory_operand" "") - (match_operand:BLK 1 "memory_operand" "")) - (unspec [(match_operand:HI 2 "register_operand" "") - (match_operand:HI 3 "const_int_operand" "")] UNSPEC_MOVMD) - (clobber (match_dup 4)) - (clobber (match_dup 5)) - (set (match_dup 2) - (const_int 0))])] - "TARGET_H8300SX && 0" - { - operands[4] = copy_rtx (XEXP (operands[0], 0)); - operands[5] = copy_rtx (XEXP (operands[1], 0)); - }) - -;; This is a difficult instruction to reload since operand 0 must be the -;; frame pointer. See h8300_reg_class_from_letter for an explanation. - -(define_insn "movmd_internal_" - [(set (mem:BLK (match_operand:P 3 "register_operand" "0,r")) - (mem:BLK (match_operand:P 4 "register_operand" "1,1"))) - (unspec [(match_operand:HI 5 "register_operand" "2,2") - (match_operand:HI 6 "const_int_operand" "n,n")] UNSPEC_MOVMD) - (clobber (match_operand:P 0 "register_operand" "=d,??D")) - (clobber (match_operand:P 1 "register_operand" "=f,f")) - (set (match_operand:HI 2 "register_operand" "=c,c") - (const_int 0))] - "TARGET_H8300SX && 0" - "@ - movmd%m6 - #" - [(set_attr "length" "2,14") - (set_attr "can_delay" "no") - (set_attr "cc" "none,clobber")]) - -;; Split the above instruction if the destination register isn't er6. -;; We need a sequence like: -;; -;; mov.l er6,@-er7 -;; mov.l ,er6 -;; movmd.sz -;; mov.l er6, -;; mov.l @er7+,er6 -;; -;; where is the current destination register (operand 4). -;; The fourth instruction will be deleted if dies here. - -(define_split - [(set (match_operand:BLK 0 "memory_operand" "") - (match_operand:BLK 1 "memory_operand" "")) - (unspec [(match_operand:HI 2 "register_operand" "") - (match_operand:HI 3 "const_int_operand" "")] UNSPEC_MOVMD) - (clobber (match_operand:P 4 "register_operand" "")) - (clobber (match_operand:P 5 "register_operand" "")) - (set (match_dup 2) - (const_int 0))] - "TARGET_H8300SX && reload_completed - && 0 - && REGNO (operands[4]) != DESTINATION_REG" - [(const_int 0)] - { - rtx dest; - - h8300_swap_into_er6 (XEXP (operands[0], 0)); - dest = replace_equiv_address (operands[0], hard_frame_pointer_rtx); - emit_insn (gen_movmd (dest, operands[1], operands[2], operands[3])); - h8300_swap_out_of_er6 (operands[4]); - DONE; - }) - -;; Expand a call to stpcpy() using movsd. Operand 0 should point to -;; the final character, but movsd leaves it pointing to the character -;; after that. - -(define_expand "movstr" - [(use (match_operand 0 "register_operand" "")) - (use (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:BLK 2 "memory_operand" ""))] - "TARGET_H8300SX && 0" - { - operands[1] = replace_equiv_address - (operands[1], copy_to_mode_reg (Pmode, XEXP (operands[1], 0))); - operands[2] = replace_equiv_address - (operands[2], copy_to_mode_reg (Pmode, XEXP (operands[2], 0))); - emit_insn (gen_movsd (operands[1], operands[2], gen_reg_rtx (Pmode))); - emit_insn (gen_add3_insn (operands[0], XEXP (operands[1], 0), constm1_rtx)); - DONE; - }) - -;; Expander for generating a movsd instruction. Operand 0 is the -;; destination string, operand 1 is the source string and operand 2 -;; is a scratch register. - -(define_expand "movsd" - [(parallel - [(set (match_operand:BLK 0 "memory_operand" "") - (unspec:BLK [(match_operand:BLK 1 "memory_operand" "")] - UNSPEC_STPCPY)) - (clobber (match_dup 3)) - (clobber (match_dup 4)) - (clobber (match_operand 2 "register_operand" ""))])] - "TARGET_H8300SX && 0" - { - operands[3] = copy_rtx (XEXP (operands[0], 0)); - operands[4] = copy_rtx (XEXP (operands[1], 0)); - }) - -;; See comments above memcpy_internal(). - -(define_insn "stpcpy_internal_" - [(set (mem:BLK (match_operand:P 3 "register_operand" "0,r")) - (unspec:BLK [(mem:BLK (match_operand:P 4 "register_operand" "1,1"))] - UNSPEC_STPCPY)) - (clobber (match_operand:P 0 "register_operand" "=d,??D")) - (clobber (match_operand:P 1 "register_operand" "=f,f")) - (clobber (match_operand:P 2 "register_operand" "=c,c"))] - "TARGET_H8300SX && 0" - "@ - \n1:\tmovsd\t2f\;bra\t1b\n2: - #" - [(set_attr "length" "6,18") - (set_attr "cc" "none,clobber")]) - -;; Split the above instruction if the destination isn't er6. This works -;; in the same way as the movmd splitter. - -(define_split - [(set (match_operand:BLK 0 "memory_operand" "") - (unspec:BLK [(match_operand:BLK 1 "memory_operand" "")] UNSPEC_STPCPY)) - (clobber (match_operand:P 2 "register_operand" "")) - (clobber (match_operand:P 3 "register_operand" "")) - (clobber (match_operand:P 4 "register_operand" ""))] - "TARGET_H8300SX && reload_completed - && 0 - && REGNO (operands[2]) != DESTINATION_REG" - [(const_int 0)] - { - rtx dest; - - h8300_swap_into_er6 (XEXP (operands[0], 0)); - dest = replace_equiv_address (operands[0], hard_frame_pointer_rtx); - emit_insn (gen_movsd (dest, operands[1], operands[4])); - h8300_swap_out_of_er6 (operands[2]); - DONE; - }) - (include "mova.md") (define_insn "*movsf_h8300" @@ -4248,60 +4080,6 @@ (clobber (match_dup 2))])] "") -;; Convert a QImode push into an SImode push so that the -;; define_peephole2 below can cram multiple pushes into one stm.l. - -(define_peephole2 - [(parallel [(set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) (const_int -4))) - (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int -3))) - (match_operand:QI 0 "register_operand" ""))])] - "TARGET_H8300S && !TARGET_NORMAL_MODE && REGNO (operands[0]) != SP_REG" - [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) - (match_dup 0))] - { - operands[0] = gen_rtx_REG (SImode, REGNO (operands[0])); - }) - -(define_peephole2 - [(parallel [(set (reg:HI SP_REG) - (plus:HI (reg:HI SP_REG) (const_int -4))) - (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3))) - (match_operand:QI 0 "register_operand" ""))])] - "TARGET_H8300S && TARGET_NORMAL_MODE && REGNO (operands[0]) != SP_REG" - [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) - (match_dup 0))] - { - operands[0] = gen_rtx_REG (SImode, REGNO (operands[0])); - }) - -;; Convert a HImode push into an SImode push so that the -;; define_peephole2 below can cram multiple pushes into one stm.l. - -(define_peephole2 - [(parallel [(set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) (const_int -4))) - (set (mem:HI (plus:SI (reg:SI SP_REG) (const_int -2))) - (match_operand:HI 0 "register_operand" ""))])] - "TARGET_H8300S && !TARGET_NORMAL_MODE && REGNO (operands[0]) != SP_REG" - [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) - (match_dup 0))] - { - operands[0] = gen_rtx_REG (SImode, REGNO (operands[0])); - }) - -(define_peephole2 - [(parallel [(set (reg:HI SP_REG) - (plus:HI (reg:HI SP_REG) (const_int -4))) - (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2))) - (match_operand:HI 0 "register_operand" ""))])] - "TARGET_H8300S && TARGET_NORMAL_MODE && REGNO (operands[0]) != SP_REG" - [(set (mem:SI (pre_dec:HI (reg:HI SP_REG))) - (match_dup 0))] - { - operands[0] = gen_rtx_REG (SImode, REGNO (operands[0])); - }) - ;; Cram four pushes into stm.l. (define_peephole2 @@ -5745,69 +5523,6 @@ (match_dup 0))] "") -;; Transform -;; -;; mov dst,reg -;; op src,reg -;; mov reg,dst -;; -;; into -;; -;; op src,dst -;; -;; if "reg" dies at the end of the sequence. - -(define_peephole2 - [(set (match_operand 0 "register_operand" "") - (match_operand 1 "memory_operand" "")) - (set (match_dup 0) - (match_operator 2 "h8sx_binary_memory_operator" - [(match_dup 0) - (match_operand 3 "h8300_src_operand" "")])) - (set (match_operand 4 "memory_operand" "") - (match_dup 0))] - "0 /* Disable because it breaks compiling fp-bit.c. */ - && TARGET_H8300SX - && peep2_reg_dead_p (3, operands[0]) - && !reg_overlap_mentioned_p (operands[0], operands[3]) - && !reg_overlap_mentioned_p (operands[0], operands[4]) - && h8sx_mergeable_memrefs_p (operands[4], operands[1])" - [(set (match_dup 4) - (match_dup 5))] - { - operands[5] = shallow_copy_rtx (operands[2]); - XEXP (operands[5], 0) = operands[1]; - }) - -;; Transform -;; -;; mov src,reg -;; op reg,dst -;; -;; into -;; -;; op src,dst -;; -;; if "reg" dies in the second insn. - -(define_peephole2 - [(set (match_operand 0 "register_operand" "") - (match_operand 1 "h8300_src_operand" "")) - (set (match_operand 2 "h8300_dst_operand" "") - (match_operator 3 "h8sx_binary_memory_operator" - [(match_operand 4 "h8300_dst_operand" "") - (match_dup 0)]))] - "0 /* Disable because it breaks compiling fp-bit.c. */ - && TARGET_H8300SX - && peep2_reg_dead_p (2, operands[0]) - && !reg_overlap_mentioned_p (operands[0], operands[4])" - [(set (match_dup 2) - (match_dup 5))] - { - operands[5] = shallow_copy_rtx (operands[3]); - XEXP (operands[5], 1) = operands[1]; - }) - ;; Transform ;; ;; mov dst,reg