From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ714-0005bV-Ov for qemu-devel@nongnu.org; Thu, 21 Jul 2016 01:59:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ710-0002zl-Sd for qemu-devel@nongnu.org; Thu, 21 Jul 2016 01:59:26 -0400 Sender: Richard Henderson References: <1468346602-20700-1-git-send-email-nikunj@linux.vnet.ibm.com> <1468346602-20700-4-git-send-email-nikunj@linux.vnet.ibm.com> From: Richard Henderson Message-ID: <6b568a67-b83b-a956-a4e8-ec0a087acea8@twiddle.net> Date: Thu, 21 Jul 2016 11:29:09 +0530 MIME-Version: 1.0 In-Reply-To: <1468346602-20700-4-git-send-email-nikunj@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 3/6] target-ppc: adding addpcis instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com On 07/12/2016 11:33 PM, Nikunj A Dadhania wrote: > +static void gen_addpcis(DisasContext *ctx) > +{ > + target_long d = DX(ctx->opcode); > + > + tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], ctx->nip); > + tcg_gen_addi_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rD(ctx->opcode)], d); > +} (1) You appear to have forgotten the "shift" part of "addpcis". (2) Both of these are translate-time constants, so... tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], ctx->nip + (d << 16)); r~