From patchwork Wed Dec 4 11:54:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 22014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F346202E0 for ; Wed, 4 Dec 2013 11:55:14 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id c14sf37240076vea.2 for ; Wed, 04 Dec 2013 03:55:14 -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=83rzwqV+HRMf70a6bju/0iqLG2bmfRxgJN89ci5YdWA=; b=YocK1WjzhGRo/S1neYw5IFZpj6PhJeDENJxxqvDFp98SsO5yA4VkzIvR7Oac7DdDLA ZouuUCKQ4tATNj8IJQWy0PqE3bLdFMUiaJhtVbsQj/jgWotO3puGxMSAtpmI2mohmod3 YdnQ6ENBGlcdeq8nOYWdNJxn8wXKMDdxjEGvPr+VPuSgFiZ4hPbMMJdFJbecQSQ5DFrx RXlRixP7Nd13VMr3VKepRw4qdQQUHfBwaZSmTFJpLBqgWswRvaeoGF6LOd9E5hbMdx5L o9b613mXEIri5/XsyImUpeGp2nv5hJ/52+onyhSXBELt9G4Qsj6i+pAtb0PP6vDfTm0Z YzeA== X-Gm-Message-State: ALoCoQkAxf9MRjKaaQvPncAzEk2Rro4XStAI21BJNcNhgFCaIRyANTjdgecVOcFqLbU6VCWIRIA3 X-Received: by 10.236.220.39 with SMTP id n37mr33892677yhp.15.1386158114037; Wed, 04 Dec 2013 03:55:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.233 with SMTP id kp9ls256326qeb.4.gmail; Wed, 04 Dec 2013 03:55:13 -0800 (PST) X-Received: by 10.52.168.4 with SMTP id zs4mr263266vdb.59.1386158113857; Wed, 04 Dec 2013 03:55:13 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id t2si32878684vem.28.2013.12.04.03.55.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 03:55:13 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.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.220.170; Received: by mail-vc0-f170.google.com with SMTP id ht10so11338621vcb.15 for ; Wed, 04 Dec 2013 03:55:13 -0800 (PST) X-Received: by 10.52.169.227 with SMTP id ah3mr436280vdc.45.1386158113701; Wed, 04 Dec 2013 03:55:13 -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 u4csp285954vcz; Wed, 4 Dec 2013 03:55:13 -0800 (PST) X-Received: by 10.180.80.233 with SMTP id u9mr6873401wix.6.1386158112948; Wed, 04 Dec 2013 03:55:12 -0800 (PST) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id ge7si1030748wic.56.2013.12.04.03.55.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 03:55:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.212.179; Received: by mail-wi0-f179.google.com with SMTP id z2so6459920wiv.12 for ; Wed, 04 Dec 2013 03:55:12 -0800 (PST) X-Received: by 10.194.161.233 with SMTP id xv9mr1893903wjb.79.1386158112504; Wed, 04 Dec 2013 03:55:12 -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 qc10sm6258318wic.9.2013.12.04.03.55.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2013 03:55:11 -0800 (PST) From: Will Newton To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH v8 6/6] target-arm: Implement ARMv8 SIMD VMAXNM and VMINNM instructions. Date: Wed, 4 Dec 2013 11:54:59 +0000 Message-Id: <1386158099-9239-7-git-send-email-will.newton@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1386158099-9239-1-git-send-email-will.newton@linaro.org> References: <1386158099-9239-1-git-send-email-will.newton@linaro.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.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: , This adds support for the ARMv8 Advanced SIMD VMAXNM and VMINNM instructions. Signed-off-by: Will Newton --- target-arm/translate.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) Changes in v8: - Use VFP helper instead of adding a NEON specific one - Drop size check diff --git a/target-arm/translate.c b/target-arm/translate.c index 9a8069e..73ed266 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -4553,7 +4553,7 @@ static void gen_neon_narrow_op(int op, int u, int size, #define NEON_3R_FLOAT_CMP 28 /* float VCEQ, VCGE, VCGT */ #define NEON_3R_FLOAT_ACMP 29 /* float VACGE, VACGT, VACLE, VACLT */ #define NEON_3R_FLOAT_MINMAX 30 /* float VMIN, VMAX */ -#define NEON_3R_VRECPS_VRSQRTS 31 /* float VRECPS, VRSQRTS */ +#define NEON_3R_FLOAT_MISC 31 /* float VRECPS, VRSQRTS, VMAXNM/MINNM */ static const uint8_t neon_3r_sizes[] = { [NEON_3R_VHADD] = 0x7, @@ -4586,7 +4586,7 @@ static const uint8_t neon_3r_sizes[] = { [NEON_3R_FLOAT_CMP] = 0x5, /* size bit 1 encodes op */ [NEON_3R_FLOAT_ACMP] = 0x5, /* size bit 1 encodes op */ [NEON_3R_FLOAT_MINMAX] = 0x5, /* size bit 1 encodes op */ - [NEON_3R_VRECPS_VRSQRTS] = 0x5, /* size bit 1 encodes op */ + [NEON_3R_FLOAT_MISC] = 0x5, /* size bit 1 encodes op */ }; /* Symbolic constants for op fields for Neon 2-register miscellaneous. @@ -4847,8 +4847,9 @@ static int disas_neon_data_insn(CPUARMState * env, DisasContext *s, uint32_t ins return 1; } break; - case NEON_3R_VRECPS_VRSQRTS: - if (u) { + case NEON_3R_FLOAT_MISC: + /* VMAXNM/VMINNM in ARMv8 */ + if (u && !arm_feature(env, ARM_FEATURE_V8)) { return 1; } break; @@ -5137,11 +5138,23 @@ static int disas_neon_data_insn(CPUARMState * env, DisasContext *s, uint32_t ins tcg_temp_free_ptr(fpstatus); break; } - case NEON_3R_VRECPS_VRSQRTS: - if (size == 0) - gen_helper_recps_f32(tmp, tmp, tmp2, cpu_env); - else - gen_helper_rsqrts_f32(tmp, tmp, tmp2, cpu_env); + case NEON_3R_FLOAT_MISC: + if (u) { + /* VMAXNM/VMINNM */ + TCGv_ptr fpstatus = get_fpstatus_ptr(1); + if (size == 0) { + gen_helper_vfp_maxnms(tmp, tmp, tmp2, fpstatus); + } else { + gen_helper_vfp_minnms(tmp, tmp, tmp2, fpstatus); + } + tcg_temp_free_ptr(fpstatus); + } else { + if (size == 0) { + gen_helper_recps_f32(tmp, tmp, tmp2, cpu_env); + } else { + gen_helper_rsqrts_f32(tmp, tmp, tmp2, cpu_env); + } + } break; case NEON_3R_VFM: {