From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:34621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3MMd-0004j8-NJ for qemu-devel@nongnu.org; Mon, 11 Mar 2019 10:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3MHf-0008SU-Ec for qemu-devel@nongnu.org; Mon, 11 Mar 2019 10:52:08 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:36151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3MHf-0008SQ-6s for qemu-devel@nongnu.org; Mon, 11 Mar 2019 10:52:07 -0400 Received: by mail-pg1-x544.google.com with SMTP id r124so4224212pgr.3 for ; Mon, 11 Mar 2019 07:52:07 -0700 (PDT) Sender: Richard Henderson References: <20190310003428.11723-1-f4bug@amsat.org> <20190310003428.11723-5-f4bug@amsat.org> From: Richard Henderson Message-ID: <2c509fe1-5ac3-a65f-bdad-fcbcbf54acb4@twiddle.net> Date: Mon, 11 Mar 2019 07:52:03 -0700 MIME-Version: 1.0 In-Reply-To: <20190310003428.11723-5-f4bug@amsat.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Laurent Vivier Cc: qemu-devel@nongnu.org On 3/9/19 4:34 PM, Philippe Mathieu-Daudé wrote: > static TCGv gen_get_sr(DisasContext *s) > { > - TCGv ccr; > - TCGv sr; > + TCGv dest; > > - ccr = gen_get_ccr(s); > - sr = tcg_temp_new(); > - tcg_gen_andi_i32(sr, QREG_SR, 0xffe0); > - tcg_gen_or_i32(sr, sr, ccr); > - tcg_temp_free(ccr); > - return sr; > + dest = gen_get_ccr(s); > + tcg_gen_deposit_i32(dest, dest, QREG_SR, 5, 11); > + return dest; Err.. there's no shift of QREG_SR by 5 in the original. I think you meant tcg_gen_deposit_i32(dest, QREG_SR, dest, 0, 5); But I'd be surprised if QREG_SR even has those bits set, and we could elide the ANDI entirely, making this just an OR. r~