From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21184 invoked by alias); 3 May 2017 07:33:28 -0000 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 Received: (qmail 21165 invoked by uid 89); 3 May 2017 07:33:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=wondering X-HELO: sasl.smtp.pobox.com Received: from pb-smtp1.pobox.com (HELO sasl.smtp.pobox.com) (64.147.108.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 May 2017 07:33:25 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 3744F8F22E; Wed, 3 May 2017 03:33:26 -0400 (EDT) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 2F7578F22D; Wed, 3 May 2017 03:33:26 -0400 (EDT) Received: from [192.168.1.4] (unknown [76.215.41.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 6C1DD8F22A; Wed, 3 May 2017 03:33:25 -0400 (EDT) Subject: Re: [PATCH 09/12] [i386] Add patterns and predicates foutline-msabi-xlouges To: Uros Bizjak References: <49e81c0b-07a4-22df-d7c3-2439177ac7cf@pobox.com> <20170427080932.11703-9-daniel.santos@pobox.com> <272376f2-178f-4d42-bc88-1555b54282f0@pobox.com> Cc: gcc-patches , Jan Hubicka From: Daniel Santos Message-ID: Date: Wed, 03 May 2017 07:38:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: CB2D2C0E-2FD2-11E7-B179-E680B56B9B0B-06139138!pb-smtp1.pobox.com X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00165.txt.bz2 On 05/03/2017 01:10 AM, Uros Bizjak wrote: > The order of subexpressions of parallel in general does not matter. Thanks, this makes things much clearer. >> Also, I'm wondering if there's anything wrong with calling ix86_gen_leave () >> and plucking the insns out of the generated parallel insn and moving that >> into my own parallel rather than generating them in my own function. I >> guess all the matters is what is cleanest. > Hm... I'd rather see subexpressions generated "by hand". OK. While we're on the topic, are you OK with my changes to ix86_emit_leave to generate the notes or would you prefer those by hand as well? Also, are these predicates what you had in mind? (I haven't actually tested them just yet.) (define_predicate "save_multiple" (match_code "parallel") { const unsigned len = XVECLEN (op, 0); unsigned i; /* Starting from end of vector, count register saves. */ for (i = 0; i < len; ++i) { rtx src, dest, addr; rtx e = XVECEXP (op, 0, len - 1 - i); if (GET_CODE (e) != SET) break; src = SET_SRC (e); dest = SET_DEST (e); if (!REG_P (src) || !MEM_P (dest)) break; addr = XEXP (dest, 0); /* Good if dest address is in RAX. */ if (REG_P (addr) && REGNO (addr) == AX_REG) continue; /* Good if dest address is offset of RAX. */ if (GET_CODE (addr) == PLUS && REG_P (XEXP (addr, 0)) && REGNO (XEXP (addr, 0)) == AX_REG) continue; break; } return (i >= 12 && i <= 18); }) (define_predicate "restore_multiple" (match_code "parallel") { const unsigned len = XVECLEN (op, 0); unsigned i; /* Starting from end of vector, count register restores. */ for (i = 0; i < len; ++i) { rtx src, dest, addr; rtx e = XVECEXP (op, 0, len - 1 - i); if (GET_CODE (e) != SET) break; src = SET_SRC (e); dest = SET_DEST (e); if (!MEM_P (src) || !REG_P (dest)) break; addr = XEXP (src, 0); /* Good if src address is in RSI. */ if (REG_P (addr) && REGNO (addr) == SI_REG) continue; /* Good if src address is offset of RSI. */ if (GET_CODE (addr) == PLUS && REG_P (XEXP (addr, 0)) && REGNO (XEXP (addr, 0)) == SI_REG) continue; break; } return (i >= 12 && i <= 18); }) Thanks, Daniel