From patchwork Tue Apr 2 04:23:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 232879 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 290112C0098 for ; Tue, 2 Apr 2013 16:20:47 +1100 (EST) Received: from localhost ([::1]:45364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMspB-0007s9-Un for incoming@patchwork.ozlabs.org; Tue, 02 Apr 2013 00:27:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMslW-0002fh-3h for qemu-devel@nongnu.org; Tue, 02 Apr 2013 00:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMslS-0007Ku-NK for qemu-devel@nongnu.org; Tue, 02 Apr 2013 00:24:10 -0400 Received: from mail-gg0-x22f.google.com ([2607:f8b0:4002:c02::22f]:62423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMslS-0007Ki-JN for qemu-devel@nongnu.org; Tue, 02 Apr 2013 00:24:06 -0400 Received: by mail-gg0-f175.google.com with SMTP id l1so3007ggn.20 for ; Mon, 01 Apr 2013 21:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=jjDfqNFpimGkkSmOIK0nNu+Vt7UjjNk7rxQxQvk4ZCI=; b=M2SrgoD2CBUWKkzZ0UToxnoq9dDnMgg/j1GmvA/yg4uBHPEdltp7ceSlpYR5+13eO9 zpZgbQOQmPOlM2frgeDLFukhhpdU2od0k2aABKmvBr+so+2iMDSazb4ElbtWBa14LEBp 5ogZ4tlUTxwnY6W76VTJVhZ/8boeyTqJE7aLewiTME3Glh83DzNy0tKcM30MLe+1/I0j 9QqlX+WYqZ0H6Xy5Vx+6vkF2FWTETVCy62ogl5QkDWmlOdF5yDWHIWLfcPCZhgtOvd3d WLb51RrxhmOFo1hsqjQo9asMmW/39BvgByo5D4vimUaHI1XpH2C9gM+yks5nYPrklYBr +Wtg== X-Received: by 10.236.207.34 with SMTP id m22mr13067877yho.31.1364876646258; Mon, 01 Apr 2013 21:24:06 -0700 (PDT) Received: from pebble.com ([12.236.175.36]) by mx.google.com with ESMTPS id z64sm32502731yhc.24.2013.04.01.21.24.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Apr 2013 21:24:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2013 21:23:08 -0700 Message-Id: <1364876610-3933-6-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1364876610-3933-1-git-send-email-rth@twiddle.net> References: <1364876610-3933-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c02::22f Cc: av1474@comtv.ru, agraf@suse.de, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH v3 05/27] tcg-ppc64: Introduce and use tcg_out_shli64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/ppc64/tcg-target.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 84e30ad..9199ac4 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -456,6 +456,11 @@ static inline void tcg_out_ext32u(TCGContext *s, TCGReg dst, TCGReg src) tcg_out_rld(s, RLDICL, dst, src, 0, 32); } +static inline void tcg_out_shli64(TCGContext *s, TCGReg dst, TCGReg src, int c) +{ + tcg_out_rld(s, RLDICR, dst, src, c, 63 - c); +} + static void tcg_out_movi32(TCGContext *s, TCGReg ret, int32_t arg) { if (arg == (int16_t) arg) @@ -482,7 +487,7 @@ static void tcg_out_movi (TCGContext *s, TCGType type, uint16_t l16 = arg; tcg_out_movi32 (s, ret, arg >> 32); - tcg_out_rld (s, RLDICR, ret, ret, 32, 31); + tcg_out_shli64(s, ret, ret, 32); if (h16) tcg_out32 (s, ORIS | RS (ret) | RA (ret) | h16); if (l16) tcg_out32 (s, ORI | RS (ret) | RA (ret) | l16); } @@ -597,9 +602,7 @@ static void tcg_out_tlb_read(TCGContext *s, TCGReg r0, TCGReg r1, TCGReg r2, tcg_out_rld (s, RLDICL, r0, addr_reg, 64 - TARGET_PAGE_BITS, 64 - CPU_TLB_BITS); - tcg_out_rld (s, RLDICR, r0, r0, - CPU_TLB_ENTRY_BITS, - 63 - CPU_TLB_ENTRY_BITS); + tcg_out_shli64(s, r0, r0, CPU_TLB_ENTRY_BITS); tcg_out32 (s, ADD | TAB (r0, r0, TCG_AREG0)); tcg_out32 (s, LD_ADDR | RT (r1) | RA (r0) | offset); @@ -1446,7 +1449,7 @@ static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_shl_i64: if (const_args[2]) - tcg_out_rld (s, RLDICR, args[0], args[1], args[2], 63 - args[2]); + tcg_out_shli64(s, args[0], args[1], args[2]); else tcg_out32 (s, SLD | SAB (args[1], args[0], args[2])); break;