From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSvzJ-00025Z-Re for qemu-devel@nongnu.org; Thu, 28 Jul 2016 20:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSvzF-0001z3-0L for qemu-devel@nongnu.org; Thu, 28 Jul 2016 20:49:17 -0400 Sender: Richard Henderson References: <1469571686-7284-1-git-send-email-benh@kernel.crashing.org> <1469571686-7284-28-git-send-email-benh@kernel.crashing.org> From: Richard Henderson Message-ID: <76968d9e-1b45-538e-a400-9069eb72f42e@twiddle.net> Date: Fri, 29 Jul 2016 06:19:00 +0530 MIME-Version: 1.0 In-Reply-To: <1469571686-7284-28-git-send-email-benh@kernel.crashing.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 28/32] ppc: Avoid double translation for lvx/lvxl/stvx/stvxl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt , qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au On 07/27/2016 03:51 AM, Benjamin Herrenschmidt wrote: > - tcg_gen_andi_tl(EA, EA, ~0xf); \ > - /* We only need to swap high and low halves. gen_qemu_ld64 does necessary \ > - 64-bit byteswap already. */ \ > - if (ctx->le_mode) { \ > - gen_qemu_ld64(ctx, cpu_avrl[rD(ctx->opcode)], EA); \ > - tcg_gen_addi_tl(EA, EA, 8); \ > - gen_qemu_ld64(ctx, cpu_avrh[rD(ctx->opcode)], EA); \ > - } else { \ > - gen_qemu_ld64(ctx, cpu_avrh[rD(ctx->opcode)], EA); \ > - tcg_gen_addi_tl(EA, EA, 8); \ > - gen_qemu_ld64(ctx, cpu_avrl[rD(ctx->opcode)], EA); \ > - } \ > + gen_helper_lvx(cpu_env, t0, EA); \ This, I'm not so keen on. (1) The helper, since it writes to registers controlled by tcg, must be described to clobber all registers. Which will noticeably increase memory traffic to ENV. For instance, you won't be able to hold the guest register holding the address in a host register across the call. (2) We're going to have to teach tcg about 16-byte data types soon anyway, for the proper emulation of 16-byte atomic operations. r~