From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5YW-0006Fh-HT for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:08:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5YR-0006nW-MF for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:08:48 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:44155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5YR-0006nP-DR for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:08:43 -0400 Message-ID: <53303C48.30300@huawei.com> Date: Mon, 24 Mar 2014 15:08:08 +0100 From: Claudio Fontana MIME-Version: 1.0 References: <1394851732-25692-1-git-send-email-rth@twiddle.net> <1394851732-25692-7-git-send-email-rth@twiddle.net> In-Reply-To: <1394851732-25692-7-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/26] tcg-aarch64: Special case small constants in tcg_out_movi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, claudio.fontana@gmail.com On 15.03.2014 03:48, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > tcg/aarch64/tcg-target.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c > index 0f23e43..417f51a 100644 > --- a/tcg/aarch64/tcg-target.c > +++ b/tcg/aarch64/tcg-target.c > @@ -577,6 +577,16 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, > } > ivalue = ~svalue; > > + /* Speed things up by handling the common case of small positive > + and negative values specially. */ > + if ((value & ~0xffffull) == 0) { > + tcg_out_insn(s, 3405, MOVZ, type, rd, value, 0); > + return; > + } else if ((ivalue & ~0xffffull) == 0) { > + tcg_out_insn(s, 3405, MOVN, type, rd, ivalue, 0); > + return; > + } > + > /* Check for bitfield immediates. For the benefit of 32-bit quantities, > use the sign-extended value. That lets us match rotated values such > as 0xff0000ff with the same 64-bit logic matching 0xffffffffff0000ff. */ > Reviewed-by: Claudio Fontana