From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYage-0006t4-FM for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:36:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYagY-0008Ju-OB for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:36:04 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:51256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYagY-0008Ji-GQ for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:35:58 -0400 Message-ID: <5347E1A9.20507@huawei.com> Date: Fri, 11 Apr 2014 14:35:53 +0200 From: Claudio Fontana MIME-Version: 1.0 References: <1396555000-8205-1-git-send-email-rth@twiddle.net> <1396555000-8205-26-git-send-email-rth@twiddle.net> In-Reply-To: <1396555000-8205-26-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 25/26] tcg-aarch64: Prefer unsigned offsets before signed offsets for ldst List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: claudio.fontana@gmail.com On 03.04.2014 21:56, Richard Henderson wrote: > The assembler seems to prefer them, perhaps we should too. > > Signed-off-by: Richard Henderson > --- > tcg/aarch64/tcg-target.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c > index a538a87..58597e7 100644 > --- a/tcg/aarch64/tcg-target.c > +++ b/tcg/aarch64/tcg-target.c > @@ -645,11 +645,6 @@ static void tcg_out_ldst_r(TCGContext *s, TCGMemOp size, AArch64LdstType type, > static void tcg_out_ldst(TCGContext *s, TCGMemOp size, AArch64LdstType type, > TCGReg rd, TCGReg rn, intptr_t offset) > { > - if (offset >= -256 && offset < 256) { > - tcg_out_ldst_9(s, size, type, rd, rn, offset); > - return; > - } > - > /* If the offset is naturally aligned and in range, then we can > use the scaled uimm12 encoding */ > if (offset >= 0 && !(offset & ((1 << size) - 1))) { > @@ -660,6 +655,11 @@ static void tcg_out_ldst(TCGContext *s, TCGMemOp size, AArch64LdstType type, > } > } > > + if (offset >= -256 && offset < 256) { > + tcg_out_ldst_9(s, size, type, rd, rn, offset); > + return; > + } > + > /* Worst-case scenario, move offset to temp register, use reg offset. */ > tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP, offset); > tcg_out_ldst_r(s, size, type, rd, rn, TCG_REG_TMP); > Reviewed-by: Claudio Fontana