From patchwork Sun Mar 9 15:11:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25931 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 529DA206A6 for ; Sun, 9 Mar 2014 15:11:18 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf24183331ieb.5 for ; Sun, 09 Mar 2014 08:11:17 -0700 (PDT) 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=03R+gvxSY6LdoFlPvZ24jSBN1exAxHcj2/gdX99Tokw=; b=hstle9tbOwBNIlQ4k4z9l6aci0bUVZXJdfXGxBGpAJzBGV/ztx80X0BZs/pVcXdaCq Uy8Gu0C/tTSQO/AFPK8U06ht45Bi+sE1Dqt1vMA/9PyK7jjCYqER6FKwqTqFKR56ro6t Zst3n2+6t2VIoC8qSA0C7JUt4MrJWj70RT59s7VTLhqIvs7Ht/gS5geCWQNxDcVup5Re vqjJDo1qjF0ije7njFLiIPOyznWtHWyIrpYfvpEgVw5hSk8YYOXr4FS/o+eJzTvsceok wuamt08WYZQkiy4fZAXMvcU0IsYbUXD2nB/oFW99PX7EOVsZTFjqiPlgkoZsrGFuR84n YhkQ== X-Gm-Message-State: ALoCoQmlibIKQRj3SNHwVg0gxhpn8oT74RU1EfIMdXkE0ZrWk4150UjiaJfJ2AqMvQPHaLDs97ap X-Received: by 10.182.158.4 with SMTP id wq4mr11404040obb.18.1394377876771; Sun, 09 Mar 2014 08:11:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.117 with SMTP id z108ls1760300qge.51.gmail; Sun, 09 Mar 2014 08:11:16 -0700 (PDT) X-Received: by 10.59.7.170 with SMTP id dd10mr18794329ved.12.1394377876636; Sun, 09 Mar 2014 08:11:16 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id tz5si4598227vdc.46.2014.03.09.08.11.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Mar 2014 08:11:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so6012577veb.41 for ; Sun, 09 Mar 2014 08:11:16 -0700 (PDT) X-Received: by 10.52.27.9 with SMTP id p9mr127651vdg.28.1394377876559; Sun, 09 Mar 2014 08:11:16 -0700 (PDT) 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.78.9 with SMTP id i9csp64517vck; Sun, 9 Mar 2014 08:11:16 -0700 (PDT) X-Received: by 10.112.173.6 with SMTP id bg6mr18745190lbc.17.1394377873445; Sun, 09 Mar 2014 08:11:13 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id v4si15168622laj.73.2014.03.09.08.11.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 09 Mar 2014 08:11:13 -0700 (PDT) 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 1WMfNc-0001rs-7o; Sun, 09 Mar 2014 15:11:08 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite Subject: [PATCH 10/16] target-arm: A64: Implement FCVTN Date: Sun, 9 Mar 2014 15:11:01 +0000 Message-Id: <1394377867-7115-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394377867-7115-1-git-send-email-peter.maydell@linaro.org> References: <1394377867-7115-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.182 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: , Implement FCVTN (narrowing fp-to-fp conversions) from the SIMD 2-reg-misc category. Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index d0df8d2..a958aa6 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -8450,13 +8450,30 @@ static void handle_2misc_narrow(DisasContext *s, int opcode, bool u, bool is_q, genenvfn = fns[size][u]; break; } + case 0x16: /* FCVTN, FCVTN2 */ + /* 32 bit to 16 bit or 64 bit to 32 bit float conversion */ + if (size == 3) { + gen_helper_vfp_fcvtsd(tcg_res[pass], tcg_op, cpu_env); + } else { + TCGv_i32 tcg_lo = tcg_temp_new_i32(); + TCGv_i32 tcg_hi = tcg_temp_new_i32(); + tcg_gen_trunc_i64_i32(tcg_lo, tcg_op); + gen_helper_vfp_fcvt_f32_to_f16(tcg_lo, tcg_lo, cpu_env); + tcg_gen_shri_i64(tcg_op, tcg_op, 32); + tcg_gen_trunc_i64_i32(tcg_hi, tcg_op); + gen_helper_vfp_fcvt_f32_to_f16(tcg_hi, tcg_hi, cpu_env); + tcg_gen_deposit_i32(tcg_res[pass], tcg_lo, tcg_hi, 16, 16); + tcg_temp_free_i32(tcg_lo); + tcg_temp_free_i32(tcg_hi); + } + break; default: g_assert_not_reached(); } if (genfn) { genfn(tcg_res[pass], tcg_op); - } else { + } else if (genenvfn) { genenvfn(tcg_res[pass], cpu_env, tcg_op); } @@ -8807,6 +8824,8 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } break; case 0x16: /* FCVTN, FCVTN2 */ + handle_2misc_narrow(s, opcode, 0, is_q, size, rn, rd); + return; case 0x17: /* FCVTL, FCVTL2 */ case 0x18: /* FRINTN */ case 0x19: /* FRINTM */