From patchwork Mon Sep 14 13:52:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53582 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id AB93E2056A for ; Mon, 14 Sep 2015 14:03:41 +0000 (UTC) Received: by lamf6 with SMTP id f6sf11945330lam.1 for ; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=5q6Q1jL/5g9cLQ2m43RfdL95oHpc2FrwOK1bId70toU=; b=ajj8vWoKgSm8tw2ZtwzBEIMV8ZmhV2a/3zBPxqVz3lh1OY6bczSPOKFtd6Oh0LfC+/ 3gBrnNgy9gw0X4773vXMomMphHOHIDbAfX6HpzB6dpletOQ2yaBRS9nyPESuNFtwL104 gHx2N+AOHE5yQnke0uP/Y0S5YJhqLN+0R6XpMOL/yFqWNdJFY8d6fJoXlHTQahRpyeKr gsUPjK8mevPPKN5mPDVG62rE4TpaoWEih0x0lIki1bad4i9Z0epjKZo8BZX97JBnifYd l7p+8j1JhUb2lI6cJ3BafOVqtXES0jOlVa1aiMz5rLZMeSxjxflaClhn0ts8en1jeaZ4 dSBQ== X-Gm-Message-State: ALoCoQm4y/F5rjxWQm2PPBFbqPnVVoBiK6f3KPj+w7B3JVGmGNf+PfVmrfTJP9HcBXE+oSSnCzw7 X-Received: by 10.112.140.195 with SMTP id ri3mr3147312lbb.22.1442239420636; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.137 with SMTP id k9ls125465lak.79.gmail; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) X-Received: by 10.152.6.133 with SMTP id b5mr14215673laa.33.1442239420485; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ta8si9813937lbb.115.2015.09.14.07.03.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 07:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lahg1 with SMTP id g1so57633188lah.1 for ; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr3377838lbc.72.1442239420335; Mon, 14 Sep 2015 07:03:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1218012lbq; Mon, 14 Sep 2015 07:03:39 -0700 (PDT) X-Received: by 10.107.158.15 with SMTP id h15mr6160030ioe.52.1442239418953; Mon, 14 Sep 2015 07:03:38 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q132si9265712ioe.135.2015.09.14.07.03.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 14 Sep 2015 07:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:41064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUM5-0004Yt-Oq for patch@linaro.org; Mon, 14 Sep 2015 10:03:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCG-0004q2-Dq for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbUCA-0000De-SO for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:28 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCA-00005c-Mp for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:22 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZbUBz-0007tF-Ov for qemu-devel@nongnu.org; Mon, 14 Sep 2015 14:53:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 14 Sep 2015 14:52:57 +0100 Message-Id: <1442238791-30255-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> References: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 10/24] target-arm: Recognize UXTB, UXTH, LSR, LSL 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Richard Henderson These are all special case aliases of UBFM. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 1441909103-24666-9-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 8ae6814..f2f8443 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -3038,6 +3038,23 @@ static void disas_bitfield(DisasContext *s, uint32_t insn) tcg_gen_sari_i64(tcg_rd, tcg_tmp, ri); goto done; } + } else if (opc == 2) { /* UBFM */ + if (ri == 0) { /* UXTB, UXTH, plus non-canonical AND */ + tcg_gen_andi_i64(tcg_rd, tcg_tmp, bitmask64(si + 1)); + return; + } + if (si == 63 || (si == 31 && ri <= si)) { /* LSR */ + if (si == 31) { + tcg_gen_ext32u_i64(tcg_tmp, tcg_tmp); + } + tcg_gen_shri_i64(tcg_rd, tcg_tmp, ri); + return; + } + if (si + 1 == ri && si != bitsize - 1) { /* LSL */ + int shift = bitsize - 1 - si; + tcg_gen_shli_i64(tcg_rd, tcg_tmp, shift); + goto done; + } } if (opc != 1) { /* SBFM or UBFM */