From patchwork Mon Dec 9 12:37:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22183 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43E5123FBA for ; Mon, 9 Dec 2013 12:57:16 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf8067943veb.4 for ; Mon, 09 Dec 2013 04:57:16 -0800 (PST) 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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=FtE8fn+ARcdSHlzUl2wfKVszD978SUKCqHn/khlI3lg=; b=BW5tuDM+i7yLwd5l88S/236C5J8CuJ13Tnv+uS77cllg4pT4FIJ3r+z4BL7/C+PkL/ vzaHGm2U920VoAezy2dIcECw8OaXNbaFSLpYsrV9xEfCLW3b0FhhnUxZHhulK5lnqNel vjtz7NPgvzlUBD19mT3zxOWJrNmTF3OAgNe0HxqG93mu3ywUKxfsjssSXp1VPsfIehM3 IuL3HPDSnWqdOmCS+e0q1UrfOmdhNKXFN8e/t6s8cbhH93Lz4tMgU6Zi+PcjHzi4rcVK 3QWXPr+rwUM9c/4KR8A/z1S6mPkxobVulkw9+NA8FtOz3pnM64RspkdKwk2gpmLN1XiW T4wA== X-Gm-Message-State: ALoCoQmtVpJg6IIUa5ap2n9myEbLIIOcGMDOYisqJ7+JkJXxE45y+T2RgtHuVub92U5dpGkTuHza X-Received: by 10.236.147.241 with SMTP id t77mr580274yhj.51.1386593836070; Mon, 09 Dec 2013 04:57:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.101.39 with SMTP id fd7ls2133631qeb.16.gmail; Mon, 09 Dec 2013 04:57:15 -0800 (PST) X-Received: by 10.58.120.48 with SMTP id kz16mr113946veb.72.1386593835966; Mon, 09 Dec 2013 04:57:15 -0800 (PST) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id z9si3797764veh.108.2013.12.09.04.57.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 04:57:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id m10so483934vbh.14 for ; Mon, 09 Dec 2013 04:57:15 -0800 (PST) X-Received: by 10.221.51.5 with SMTP id vg5mr1500009vcb.40.1386593835893; Mon, 09 Dec 2013 04:57:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp104583vcz; Mon, 9 Dec 2013 04:57:15 -0800 (PST) X-Received: by 10.180.108.42 with SMTP id hh10mr14145814wib.15.1386593835019; Mon, 09 Dec 2013 04:57:15 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ew19si6649795wid.16.2013.12.09.04.57.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Dec 2013 04:57:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Vq05e-00006j-G1; Mon, 09 Dec 2013 12:37:34 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton Subject: [PATCH v3 06/13] target-arm: A64: add support for 2-src shift reg insns Date: Mon, 9 Dec 2013 12:37:27 +0000 Message-Id: <1386592654-362-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386592654-362-1-git-send-email-peter.maydell@linaro.org> References: <1386592654-362-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alexander Graf This adds 2-src variable shift register instructions: C5.6.115 LSLV, C5.6.118 LSRV, C5.6.17 ASRV, C5.6.154 RORV Signed-off-by: Alexander Graf [claudio: adapted to new decoder, use enums for shift types] Signed-off-by: Claudio Fontana Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target-arm/translate-a64.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index fe82b9a..2f673d6 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1077,6 +1077,20 @@ static void handle_div(DisasContext *s, bool is_signed, unsigned int sf, } } +/* C5.6.115 LSLV, C5.6.118 LSRV, C5.6.17 ASRV, C5.6.154 RORV */ +static void handle_shift_reg(DisasContext *s, + enum a64_shift_type shift_type, unsigned int sf, + unsigned int rm, unsigned int rn, unsigned int rd) +{ + TCGv_i64 tcg_shift = tcg_temp_new_i64(); + TCGv_i64 tcg_rd = cpu_reg(s, rd); + TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf); + + tcg_gen_andi_i64(tcg_shift, cpu_reg(s, rm), sf ? 63 : 31); + shift_reg(tcg_rd, tcg_rn, sf, shift_type, tcg_shift); + tcg_temp_free_i64(tcg_shift); +} + /* C3.5.8 Data-processing (2 source) * 31 30 29 28 21 20 16 15 10 9 5 4 0 * +----+---+---+-----------------+------+--------+------+------+ @@ -1105,9 +1119,17 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) handle_div(s, true, sf, rm, rn, rd); break; case 8: /* LSLV */ + handle_shift_reg(s, A64_SHIFT_TYPE_LSL, sf, rm, rn, rd); + break; case 9: /* LSRV */ + handle_shift_reg(s, A64_SHIFT_TYPE_LSR, sf, rm, rn, rd); + break; case 10: /* ASRV */ + handle_shift_reg(s, A64_SHIFT_TYPE_ASR, sf, rm, rn, rd); + break; case 11: /* RORV */ + handle_shift_reg(s, A64_SHIFT_TYPE_ROR, sf, rm, rn, rd); + break; case 16: case 17: case 18: