From patchwork Wed Jan 29 13:39:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23853 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01190202FA for ; Wed, 29 Jan 2014 13:50:29 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id c14sf4387241vea.3 for ; Wed, 29 Jan 2014 05:50:29 -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:date :message-id:in-reply-to:references:cc: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=LVYWIHolcn/dAF24UfTYmOHbl5DdQ2bXZNLu+BEXzaI=; b=cjnok6pVTzX10p80v8hH1O1N63kTL+LxEBXwvEGy//9/3WI983wWRpTwvHOuIkupEF BEOP5FlgscGaKCLNEUf3NSmKd83w40MbQuPH7TXMqQE2UVfqg9Bh0WWJ1JBH7Mc4WPVe 2IcsJiNGimKUVUyOi2xa37PHHwfIHv2gw+bLUWacVruMwnGtrCETg1yNixzXDrEvQcZH DYVbjivMC3YT+4fLlwH+MrAXIjfyMKaYE/4MFF/K3e5uNdZleUalyI/Ldssym89DgCvN SpgWwY/ypqcpFfpMcvnbJuvcLBJEdkr1TU316m2G2HAClqngW2Dlh5BEZUA4baLu4Rpp 1fvw== X-Gm-Message-State: ALoCoQmsvq/I10VjoQbi9yBc1+FtM3v9EOeKGnuXvcgHEFCOa2Pq6JNQ5M1/EPBQa/cWFPkETK1M X-Received: by 10.236.18.196 with SMTP id l44mr2596124yhl.52.1391003429050; Wed, 29 Jan 2014 05:50:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.49 with SMTP id 46ls90295qgq.21.gmail; Wed, 29 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.220.161.132 with SMTP id r4mr910685vcx.29.1391003428920; Wed, 29 Jan 2014 05:50:28 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id vd4si815612vdc.13.2014.01.29.05.50.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:50:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id c14so1169555vea.6 for ; Wed, 29 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.52.26.148 with SMTP id l20mr1172109vdg.28.1391003428844; Wed, 29 Jan 2014 05:50:28 -0800 (PST) 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.220.174.196 with SMTP id u4csp114171vcz; Wed, 29 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.140.43.3 with SMTP id d3mr11288800qga.70.1391003427901; Wed, 29 Jan 2014 05:50:27 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a3si1807476qam.26.2014.01.29.05.50.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:50:27 -0800 (PST) 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]:42399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VX2-000632-Kf for patch@linaro.org; Wed, 29 Jan 2014 08:50:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNg-0001GP-23 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8VNe-0001Ij-Ba for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:39 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:45249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNd-0001GJ-Rh for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:38 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W8VN8-0006wy-6P; Wed, 29 Jan 2014 13:40:06 +0000 From: Peter Maydell To: Anthony Liguori Date: Wed, 29 Jan 2014 13:39:51 +0000 Message-Id: <1391002805-26596-25-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> References: <1391002805-26596-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 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 24/38] target-arm: Add AArch32 SIMD VCVTA, VCVTN, VCVTP and VCVTM 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=neutral (google.com: 209.85.128.175 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Will Newton Add support for the AArch32 Advanced SIMD VCVTA, VCVTN, VCVTP and VCVTM instructions. Signed-off-by: Will Newton Signed-off-by: Peter Maydell --- target-arm/translate.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 0fcc159..e701c0f 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4778,6 +4778,14 @@ static const uint8_t neon_3r_sizes[] = { #define NEON_2RM_VRINTM 45 #define NEON_2RM_VCVT_F32_F16 46 #define NEON_2RM_VRINTP 47 +#define NEON_2RM_VCVTAU 48 +#define NEON_2RM_VCVTAS 49 +#define NEON_2RM_VCVTNU 50 +#define NEON_2RM_VCVTNS 51 +#define NEON_2RM_VCVTPU 52 +#define NEON_2RM_VCVTPS 53 +#define NEON_2RM_VCVTMU 54 +#define NEON_2RM_VCVTMS 55 #define NEON_2RM_VRECPE 56 #define NEON_2RM_VRSQRTE 57 #define NEON_2RM_VRECPE_F 58 @@ -4792,7 +4800,8 @@ static int neon_2rm_is_float_op(int op) /* Return true if this neon 2reg-misc op is float-to-float */ return (op == NEON_2RM_VABS_F || op == NEON_2RM_VNEG_F || (op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || - op == NEON_2RM_VRINTM || op == NEON_2RM_VRINTP || + op == NEON_2RM_VRINTM || + (op >= NEON_2RM_VRINTP && op <= NEON_2RM_VCVTMS) || op >= NEON_2RM_VRECPE_F); } @@ -4845,6 +4854,14 @@ static const uint8_t neon_2rm_sizes[] = { [NEON_2RM_VRINTM] = 0x4, [NEON_2RM_VCVT_F32_F16] = 0x2, [NEON_2RM_VRINTP] = 0x4, + [NEON_2RM_VCVTAU] = 0x4, + [NEON_2RM_VCVTAS] = 0x4, + [NEON_2RM_VCVTNU] = 0x4, + [NEON_2RM_VCVTNS] = 0x4, + [NEON_2RM_VCVTPU] = 0x4, + [NEON_2RM_VCVTPS] = 0x4, + [NEON_2RM_VCVTMU] = 0x4, + [NEON_2RM_VCVTMS] = 0x4, [NEON_2RM_VRECPE] = 0x4, [NEON_2RM_VRSQRTE] = 0x4, [NEON_2RM_VRECPE_F] = 0x4, @@ -6588,6 +6605,40 @@ static int disas_neon_data_insn(CPUARMState * env, DisasContext *s, uint32_t ins tcg_temp_free_ptr(fpstatus); break; } + case NEON_2RM_VCVTAU: + case NEON_2RM_VCVTAS: + case NEON_2RM_VCVTNU: + case NEON_2RM_VCVTNS: + case NEON_2RM_VCVTPU: + case NEON_2RM_VCVTPS: + case NEON_2RM_VCVTMU: + case NEON_2RM_VCVTMS: + { + bool is_signed = !extract32(insn, 7, 1); + TCGv_ptr fpst = get_fpstatus_ptr(1); + TCGv_i32 tcg_rmode, tcg_shift; + int rmode = fp_decode_rm[extract32(insn, 8, 2)]; + + tcg_shift = tcg_const_i32(0); + tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); + gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, + cpu_env); + + if (is_signed) { + gen_helper_vfp_tosls(cpu_F0s, cpu_F0s, + tcg_shift, fpst); + } else { + gen_helper_vfp_touls(cpu_F0s, cpu_F0s, + tcg_shift, fpst); + } + + gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, + cpu_env); + tcg_temp_free_i32(tcg_rmode); + tcg_temp_free_i32(tcg_shift); + tcg_temp_free_ptr(fpst); + break; + } case NEON_2RM_VRECPE: gen_helper_recpe_u32(tmp, tmp, cpu_env); break;