From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8688 invoked by alias); 28 Oct 2011 13:39:00 -0000 Received: (qmail 8558 invoked by uid 22791); 28 Oct 2011 13:38:58 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 13:38:38 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (klopstock mo6) (RZmta 26.10 AUTH) with ESMTPA id z06defn9SCAajt ; Fri, 28 Oct 2011 15:38:17 +0200 (MEST) Message-ID: <4EAAB049.7010006@gjlay.de> Date: Fri, 28 Oct 2011 14:34:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Denis Chertykov , Eric Weddington Subject: [Patch,AVR]: Tweak 8-bit parity expansion Content-Type: multipart/mixed; boundary="------------090702060305060907090004" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg02662.txt.bz2 This is a multi-part message in MIME format. --------------090702060305060907090004 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 551 This is minor tweak to support 8-bit parity. Otherwise, the input operand of 8-bit values will be extended before parity computation. The final representation as libgcc call is not generated in split1 and no more in expand. Notice that - combine is not allowed to propagate hard regs into zero-extends. - combine does not try parity:QI Ok for trunk? Johann * config/avr/avr.md (parityhi2): Expand allowing pseudos. (*parityhi2): New pre-reload insn-and-split to map 16-bit parity to the libgcc insn. (*parityqihi2): Same for 8-bit parity. --------------090702060305060907090004 Content-Type: text/x-patch; name="tweak-parity-8.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tweak-parity-8.diff" Content-length: 1580 Index: config/avr/avr.md =================================================================== --- config/avr/avr.md (revision 180605) +++ config/avr/avr.md (working copy) @@ -4288,15 +4288,41 @@ (define_insn "delay_cycles_4" ;; Parity +;; Postpone expansion of 16-bit parity to libgcc call until after combine for +;; better 8-bit parity recognition. + (define_expand "parityhi2" + [(parallel [(set (match_operand:HI 0 "register_operand" "") + (parity:HI (match_operand:HI 1 "register_operand" ""))) + (clobber (reg:HI 24))])]) + +(define_insn_and_split "*parityhi2" + [(set (match_operand:HI 0 "register_operand" "=r") + (parity:HI (match_operand:HI 1 "register_operand" "r"))) + (clobber (reg:HI 24))] + "!reload_completed" + { gcc_unreachable(); } + "&& 1" [(set (reg:HI 24) - (match_operand:HI 1 "register_operand" "")) + (match_dup 1)) (set (reg:HI 24) (parity:HI (reg:HI 24))) - (set (match_operand:HI 0 "register_operand" "") - (reg:HI 24))] - "" - "") + (set (match_dup 0) + (reg:HI 24))]) + +(define_insn_and_split "*parityqihi2" + [(set (match_operand:HI 0 "register_operand" "=r") + (parity:HI (match_operand:QI 1 "register_operand" "r"))) + (clobber (reg:HI 24))] + "!reload_completed" + { gcc_unreachable(); } + "&& 1" + [(set (reg:QI 24) + (match_dup 1)) + (set (reg:HI 24) + (zero_extend:HI (parity:QI (reg:QI 24)))) + (set (match_dup 0) + (reg:HI 24))]) (define_expand "paritysi2" [(set (reg:SI 22) --------------090702060305060907090004--