From patchwork Fri Dec 6 13:19:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22123 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 735C123FF9 for ; Fri, 6 Dec 2013 13:19:23 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at1sf2169236iec.3 for ; Fri, 06 Dec 2013 05:19:23 -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=dslcLYqFmxy5ZEvhFMdPvdRTyD+KUpp90YbxJ4h9Byo=; b=CUrHKro5nnwWzPGlOk+OSiaqBV1D2WgsTCfcoKBLE846vysoY1pLRXKWYxMgzOZM33 VveWKToRHTUElKIYEoq1HT1uvcxigS+B2Gl5EsMytfp8TjE5XvsWhDo6TlLOSuHfXSYu zv+21uAc336xW9thX5fukhwf6ogCbqYT58N5Y4J3soVdLt0KuXztluB4jA+wW2sExcjp 4N9G0ZzvBvszsNBsPLd40jjtQsRPAltVvIjQxef8CWB15LjZkJhvUX8N9vDytrORhRdF +65msAswbkPuIBeL3Z5/QiLglMhX611bW7wqJGW/+RtU4H/KCIN/Wa7wyk92Nm4flpdG Wz4w== X-Gm-Message-State: ALoCoQmY40vipmyVZ4X7QYVc5ya1V496RkewhYty8VK/4L2j1WY+klG8sXG1rRuLt0mskn8DMZVV X-Received: by 10.182.245.197 with SMTP id xq5mr1156215obc.27.1386335963142; Fri, 06 Dec 2013 05:19:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.138 with SMTP id k10ls1189758qek.13.gmail; Fri, 06 Dec 2013 05:19:23 -0800 (PST) X-Received: by 10.58.181.165 with SMTP id dx5mr1192742vec.52.1386335963035; Fri, 06 Dec 2013 05:19:23 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id gq10si36651206vdc.56.2013.12.06.05.19.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Dec 2013 05:19:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id oy12so738289veb.1 for ; Fri, 06 Dec 2013 05:19:22 -0800 (PST) X-Received: by 10.220.95.201 with SMTP id e9mr369248vcn.71.1386335962853; Fri, 06 Dec 2013 05:19:22 -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 u4csp99112vcz; Fri, 6 Dec 2013 05:19:22 -0800 (PST) X-Received: by 10.204.117.196 with SMTP id s4mr1167571bkq.40.1386335959063; Fri, 06 Dec 2013 05:19:19 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id le2si7076321bkb.290.2013.12.06.05.19.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Dec 2013 05:19:19 -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 1VovJJ-0007Wb-Ig; Fri, 06 Dec 2013 13:19:13 +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 v2 06/13] target-arm: A64: add support for 2-src shift reg insns Date: Fri, 6 Dec 2013 13:19:06 +0000 Message-Id: <1386335953-28876-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386335953-28876-1-git-send-email-peter.maydell@linaro.org> References: <1386335953-28876-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.128.170 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 ddee285..486db8b 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1069,6 +1069,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 * +----+---+---+-----------------+------+--------+------+------+ @@ -1097,9 +1111,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: