From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19652 invoked by alias); 7 Aug 2014 19:33:09 -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 19637 invoked by uid 89); 7 Aug 2014 19:33:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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, 07 Aug 2014 19:33:07 +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 s77JX2VU020892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Aug 2014 15:33:02 -0400 Received: from pike.twiddle.home (vpn-60-238.rdu2.redhat.com [10.10.60.238]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s77JWvGP010814; Thu, 7 Aug 2014 15:32:59 -0400 Message-ID: <53E3D467.2020509@redhat.com> Date: Thu, 07 Aug 2014 19:33:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Kyrill Tkachov , Richard Earnshaw CC: gcc-patches Subject: Re: [PATCH, AArch64] Use MOVN to generate 64-bit negative immediates where sensible References: <000001cf6ae4$059c2280$10d46780$@bolton@arm.com> <537605FF.8070700@arm.com> <53E363C2.4000405@arm.com> <53E37532.60101@arm.com> <53E3779C.1020709@arm.com> In-Reply-To: <53E3779C.1020709@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00844.txt.bz2 On 08/07/2014 02:57 AM, Kyrill Tkachov wrote: > + if (one_match > zero_match) > + { > + /* Set either first three quarters or all but the third. */ > + mask = 0xffffll << (16 - first_not_ffff_match); > + emit_insn (gen_rtx_SET (VOIDmode, dest, > + GEN_INT (val | mask | 0xffffffff00000000ull))); > + > + /* Now insert other two quarters. */ > + for (i = first_not_ffff_match + 16, mask <<= (first_not_ffff_match << 1); > + i < 64; i += 16, mask <<= 16) > { > if ((val & mask) != mask) > + emit_insn (gen_insv_immdi (dest, GEN_INT (i), > + GEN_INT ((val >> i) & 0xffff))); > } > + return; > } > > if (zero_match == 2) You should not place this three instruction sequence before the two instruction sequences that follow. I.e. place this just before simple_sequence. I do wonder if we should be memo-izing these computations so that we only have to do the complex search for a sequence only once for each constant... r~