From patchwork Sat Dec 24 03:59:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 708569 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tlsD80fC1z9ssP for ; Sat, 24 Dec 2016 15:07:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H9fCZKY8"; dkim-atps=neutral Received: from localhost ([::1]:41885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKdcL-0003pA-Pp for incoming@patchwork.ozlabs.org; Fri, 23 Dec 2016 23:07:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKdVz-0006aE-Fp for qemu-devel@nongnu.org; Fri, 23 Dec 2016 23:01:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKdVy-0005a5-TI for qemu-devel@nongnu.org; Fri, 23 Dec 2016 23:00:59 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:34013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKdVy-0005Zi-O5 for qemu-devel@nongnu.org; Fri, 23 Dec 2016 23:00:58 -0500 Received: by mail-pg0-x244.google.com with SMTP id b1so2475170pgc.1 for ; Fri, 23 Dec 2016 20:00:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=a3Alf4vPtqND1wbQQ0xlDVmIL+IAFibQHXf9f0zqP50=; b=H9fCZKY8sqxOjIye3S+v+spF5b0X2IK/OKiLRba75nwcahrEGG9K/pi7bSwmBXV46d R6PGeefHNNoGe4/WFrer3l5c5+qnYPSj1qwgBllSIpWD/TEUyFldkIP6WX2+sdUwahx2 HWwjrJZ21u4PfoCc/JCV1Xjd0PejKOojCTPjPXn+Tn5TD0eVPTDa51Kh6ISGgGAU/QkR nb5MuXhGTZyU/j/zTvSCwmtaW0J74rd4i+uMrcqsoIK/nsf9WGJy0drYKguLghlEu9j2 zQ+4fPGfiKF4EuD3s+JLxbJqDeh+tQh+H8O5d8ABx9r2nU3pwipkg3yA/2+lO51ObE4z mYwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=a3Alf4vPtqND1wbQQ0xlDVmIL+IAFibQHXf9f0zqP50=; b=I4XqlqOJDMCMb4iD/If2nxR1RjclKnLEMbanApNpivNNxKxWf77JQRS7bPyB9boHOE FDHaYysMhQv2o2MNp7/el6+Yd8573Slr+HsHZ5w8dMYvOHcT2zZKa3AnRkoJqIvTe9Nf uJ0+ho6ssXVTb8WE0VUAQzPDuvC7rtNsrHg1xDVWhgel19Sv6/neTzWdkc4kXTJ8cpKd UjgMj/YO8C2OK9Ft01fh1qvWcCAnhXd1Gw+ASfxotSWcjmP9/uBa6REDLsxajd2qJs68 3jUD1yaIq8gH0YFyRZGCLiM1ubkwmiD5UoR91arfwvYIcfXLzBILhFjYg3HgrvQqimPC 97BA== X-Gm-Message-State: AIkVDXLGi27bdAewd04haR1ZNoZgq5im+SxDD/ogdYqUmo6L+Nhz2zNT5l6JNxFpXiTOyQ== X-Received: by 10.98.23.88 with SMTP id 85mr16649679pfx.21.1482552057755; Fri, 23 Dec 2016 20:00:57 -0800 (PST) Received: from bigtime.domain ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id n25sm65339316pfi.33.2016.12.23.20.00.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 20:00:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 23 Dec 2016 19:59:53 -0800 Message-Id: <20161224040042.12654-17-rth@twiddle.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161224040042.12654-1-rth@twiddle.net> References: <20161224040042.12654-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH 16/65] target-mips: Use the new extract op X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" Use extract for EXT and DEXT. Reviewed-by: Yongbok Kim Signed-off-by: Richard Henderson --- target/mips/translate.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 57b824f..8deffa1 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -4488,11 +4488,12 @@ static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt, if (lsb + msb > 31) { goto fail; } - tcg_gen_shri_tl(t0, t1, lsb); if (msb != 31) { - tcg_gen_andi_tl(t0, t0, (1U << (msb + 1)) - 1); + tcg_gen_extract_tl(t0, t1, lsb, msb + 1); } else { - tcg_gen_ext32s_tl(t0, t0); + /* The two checks together imply that lsb == 0, + so this is a simple sign-extension. */ + tcg_gen_ext32s_tl(t0, t1); } break; #if defined(TARGET_MIPS64) @@ -4507,10 +4508,7 @@ static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt, if (lsb + msb > 63) { goto fail; } - tcg_gen_shri_tl(t0, t1, lsb); - if (msb != 63) { - tcg_gen_andi_tl(t0, t0, (1ULL << (msb + 1)) - 1); - } + tcg_gen_extract_tl(t0, t1, lsb, msb + 1); break; #endif case OPC_INS: