From patchwork Mon Mar 17 22:12:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26421 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE405202FA for ; Mon, 17 Mar 2014 22:15:40 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf15770221pbb.9 for ; Mon, 17 Mar 2014 15:15:40 -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: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=uvU99aqrWs0waw4IsraQ70zBYi4/qlcBZoqc4/swlgM=; b=cZSvkW/yWsrdvsheQ9aRWuN1Ic/uYaIIvJQ9QUFWXvvBAXIZxMzX6lvJnB+FThXKJk G+H/u250JcKz/jnhegJgnQdC4z8GospIuzlQPyulG2fGnhFwKERIoKfnDBWoCZjW8P2S 9lSMEFB7ma/VJ75vOc32h5ugpJ6l4yGc0vOvtAHeS/FnYYYiC3tMIZyMReH+tiGWtYuD PzdzHNMgC6C+1NBSwX0ObqA2fn7iBzN6OZF6WRor39ivfvIZxz4/t5jTlidnr/bjC2+n jVWYH5LLtMT1vgO7ClnwLT5EFyUIJGTLix7DZAEUNgTfqYxJ+LsfT94l/B04W+ROjafY brEw== X-Gm-Message-State: ALoCoQl2/HwtuR1X8Xp2aoVWvbApAjQwUuWSDrsnv9KhBwM8hbE2EWTBmSlWxYIyZXt4mqWYFELQ X-Received: by 10.66.158.6 with SMTP id wq6mr10392820pab.39.1395094540044; Mon, 17 Mar 2014 15:15:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.230 with SMTP id z93ls1811658qgz.93.gmail; Mon, 17 Mar 2014 15:15:39 -0700 (PDT) X-Received: by 10.52.128.231 with SMTP id nr7mr11584025vdb.17.1395094539918; Mon, 17 Mar 2014 15:15:39 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id rx10si2142208vdc.78.2014.03.17.15.15.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 15:15:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so6524706vcb.10 for ; Mon, 17 Mar 2014 15:15:39 -0700 (PDT) X-Received: by 10.52.61.133 with SMTP id p5mr18282421vdr.4.1395094539841; Mon, 17 Mar 2014 15:15:39 -0700 (PDT) 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.78.9 with SMTP id i9csp159397vck; Mon, 17 Mar 2014 15:15:39 -0700 (PDT) X-Received: by 10.140.47.20 with SMTP id l20mr30265514qga.9.1395094538601; Mon, 17 Mar 2014 15:15:38 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id d8si9516776qao.16.2014.03.17.15.15.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 15:15:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:60577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfon-0007dW-ST for patch@linaro.org; Mon, 17 Mar 2014 18:15:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfmK-0004YT-Is for qemu-devel@nongnu.org; Mon, 17 Mar 2014 18:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPfmJ-0007TN-CR for qemu-devel@nongnu.org; Mon, 17 Mar 2014 18:13:04 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfmJ-0007Pr-6D for qemu-devel@nongnu.org; Mon, 17 Mar 2014 18:13:03 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WPfld-00053M-QS; Mon, 17 Mar 2014 22:12:21 +0000 From: Peter Maydell To: Anthony Liguori Date: Mon, 17 Mar 2014 22:12:06 +0000 Message-Id: <1395094341-19339-16-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395094341-19339-1-git-send-email-peter.maydell@linaro.org> References: <1395094341-19339-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 , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 15/30] target-arm: A64: Implement FCVTN 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.220.179 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 Implement FCVTN (narrowing fp-to-fp conversions) from the SIMD 2-reg-misc category. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 1394822294-14837-11-git-send-email-peter.maydell@linaro.org --- target-arm/translate-a64.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index ec77c8b..f6a4ce7 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 == 2) { + 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,11 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } break; case 0x16: /* FCVTN, FCVTN2 */ + /* handle_2misc_narrow does a 2*size -> size operation, but these + * instructions encode the source size rather than dest size. + */ + handle_2misc_narrow(s, opcode, 0, is_q, size - 1, rn, rd); + return; case 0x17: /* FCVTL, FCVTL2 */ case 0x18: /* FRINTN */ case 0x19: /* FRINTM */