From patchwork Tue Jan 14 16:43:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 23198 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 C3C0B2066C for ; Tue, 14 Jan 2014 16:52:52 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf2033038iec.7 for ; Tue, 14 Jan 2014 08:52:52 -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=HNhLEhAyEMCpSni/pke6adEHsHkPe6lTPsOWiNmCugM=; b=NPWNNWOSgAaFXBFy9RBQd0Mg5riVDAlyrup+gRdK3JvuK0NX3TIN/Fj/grAw7/fbdN qEDAOG+ZE51eYczEC6QgZQXTiFxtNcuETQfX02rqggQreo/EB94TsyCTfww/4xQuVUJM kvkjZfzz/g5mUcJTEoYaJQpiLnYWbOXD/AX2146TIFFHUnteHmBqFjSYqlWiRyGoNzbi fV+NPHLXrSKc89RqQEpB5f6W+a+M86LlBexjly63W0M+CeQtN2j1eBlUPkrlS8/N2aKO xCLXjevRZwjVx8a3XiYNbwqn9EeTP+VvShjbbkVePYZxCwGagh1panH9o1qMCjNuJofO 8vyA== X-Gm-Message-State: ALoCoQlQfcX88U12leh3x1Sv3hzrOVAKlFXXn+JAZ2lTfLyjjuAXhwxhuzWxIYLDD4byMQpli2rb X-Received: by 10.182.24.134 with SMTP id u6mr908569obf.24.1389718372048; Tue, 14 Jan 2014 08:52:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.137 with SMTP id o9ls161750qed.88.gmail; Tue, 14 Jan 2014 08:52:51 -0800 (PST) X-Received: by 10.52.166.81 with SMTP id ze17mr507744vdb.72.1389718371945; Tue, 14 Jan 2014 08:52:51 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id n8si438468vdv.146.2014.01.14.08.52.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 08:52:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ks9so374888vcb.11 for ; Tue, 14 Jan 2014 08:52:51 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr1220379vcn.21.1389718371865; Tue, 14 Jan 2014 08:52:51 -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.59.13.131 with SMTP id ey3csp215280ved; Tue, 14 Jan 2014 08:52:51 -0800 (PST) X-Received: by 10.49.108.200 with SMTP id hm8mr4453035qeb.53.1389718371292; Tue, 14 Jan 2014 08:52:51 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q6si1350595qag.120.2014.01.14.08.52.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 Jan 2014 08:52:50 -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]:49245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W379o-0008Gw-RF for patch@linaro.org; Tue, 14 Jan 2014 11:48:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W375W-0002C3-UB for qemu-devel@nongnu.org; Tue, 14 Jan 2014 11:43:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W375Q-0001Kw-TZ for qemu-devel@nongnu.org; Tue, 14 Jan 2014 11:43:38 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:55306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W375Q-0001Kq-NP for qemu-devel@nongnu.org; Tue, 14 Jan 2014 11:43:32 -0500 Received: by mail-wi0-f176.google.com with SMTP id hq4so3989292wib.15 for ; Tue, 14 Jan 2014 08:43:32 -0800 (PST) X-Received: by 10.194.76.231 with SMTP id n7mr28878321wjw.16.1389717811851; Tue, 14 Jan 2014 08:43:31 -0800 (PST) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginm.net. [82.1.113.198]) by mx.google.com with ESMTPSA id jw4sm971156wjc.20.2014.01.14.08.43.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2014 08:43:31 -0800 (PST) From: Will Newton To: qemu-devel@nongnu.org Date: Tue, 14 Jan 2014 16:43:10 +0000 Message-Id: <1389717790-30860-10-git-send-email-will.newton@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1389717790-30860-1-git-send-email-will.newton@linaro.org> References: <1389717790-30860-1-git-send-email-will.newton@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.176 Cc: Peter Maydell Subject: [Qemu-devel] [PATCH 9/9] target-arm: Add AArch32 SIMD VRINTA, VRINTN, VRINTP and VRINTM 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: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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 Add support for the AArch32 Advanced SIMD VRINTA, VRINTN, VRINTP and VRINTM instructions. Signed-off-by: Will Newton --- target-arm/translate.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 16242d3..5564cb9 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4709,10 +4709,14 @@ static const uint8_t neon_3r_sizes[] = { #define NEON_2RM_VMOVN 36 /* Includes VQMOVN, VQMOVUN */ #define NEON_2RM_VQMOVN 37 /* Includes VQMOVUN */ #define NEON_2RM_VSHLL 38 +#define NEON_2RM_VRINTN 40 #define NEON_2RM_VRINTX 41 +#define NEON_2RM_VRINTA 42 #define NEON_2RM_VRINTZ 43 #define NEON_2RM_VCVT_F16_F32 44 +#define NEON_2RM_VRINTM 45 #define NEON_2RM_VCVT_F32_F16 46 +#define NEON_2RM_VRINTP 47 #define NEON_2RM_VRECPE 56 #define NEON_2RM_VRSQRTE 57 #define NEON_2RM_VRECPE_F 58 @@ -4726,7 +4730,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_VRINTX || op == NEON_2RM_VRINTZ || + (op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || + op == NEON_2RM_VRINTM || op == NEON_2RM_VRINTP || op >= NEON_2RM_VRECPE_F); } @@ -4771,10 +4776,14 @@ static const uint8_t neon_2rm_sizes[] = { [NEON_2RM_VMOVN] = 0x7, [NEON_2RM_VQMOVN] = 0x7, [NEON_2RM_VSHLL] = 0x7, + [NEON_2RM_VRINTN] = 0x4, [NEON_2RM_VRINTX] = 0x4, + [NEON_2RM_VRINTA] = 0x4, [NEON_2RM_VRINTZ] = 0x4, [NEON_2RM_VCVT_F16_F32] = 0x2, + [NEON_2RM_VRINTM] = 0x4, [NEON_2RM_VCVT_F32_F16] = 0x2, + [NEON_2RM_VRINTP] = 0x4, [NEON_2RM_VRECPE] = 0x4, [NEON_2RM_VRSQRTE] = 0x4, [NEON_2RM_VRECPE_F] = 0x4, @@ -6485,6 +6494,24 @@ static int disas_neon_data_insn(CPUARMState * env, DisasContext *s, uint32_t ins } neon_store_reg(rm, pass, tmp2); break; + case NEON_2RM_VRINTN: + case NEON_2RM_VRINTA: + case NEON_2RM_VRINTM: + case NEON_2RM_VRINTP: + { + TCGv_i32 tcg_rmode; + TCGv_ptr fpstatus = get_fpstatus_ptr(1); + int rmode = fp_decode_rm[((op & 0x6) >> 1) ^ 1]; + tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); + gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, + cpu_env); + gen_helper_rints(cpu_F0s, cpu_F0s, fpstatus); + gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, + cpu_env); + tcg_temp_free_ptr(fpstatus); + tcg_temp_free_i32(tcg_rmode); + break; + } case NEON_2RM_VRINTX: { TCGv_ptr fpstatus = get_fpstatus_ptr(1);