From patchwork Mon Mar 17 22:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26438 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 200C1202FA for ; Mon, 17 Mar 2014 23:13:00 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf23477184ieb.9 for ; Mon, 17 Mar 2014 16:12:59 -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=2vEDLBxwHgOoZBXysHtXCoZ7enePZKOGROfWNCwnc1Q=; b=AotVhwAxCFLBOpBdMlpP334+xUyS/8hY8/vWPOqiFhVkZUnWQGTGh2r7nOSAKs7+z1 rBVMlyq63iUSKN4qFeLzbV+qyYKC6u6QlJ/9egvgD8nRTOrEO7XkL4HYdPu6Sv53UIlY m1lOJ3SMv7J4BKji7QGlLGFLJhrQgc6bbL8sfBLnw9miWlueDIxuXrGf3AH9afkQFzY7 pQxWm0DOk/Y9BHCQhKGaUE/oNr1xHBzVlMTsF5V1Z3b+X/hwLlz0vNSHyXc9WArFp7Op QXVadzKifTRmSPD1+Yms5Oapaofeu5yj0RNcnOZF17R4e9OEyEHOla5KDEDDvdYyaZTd gRmQ== X-Gm-Message-State: ALoCoQmsTu/LqcacBO/meLk0/Tl9dxwSMv17Z0BGKWSawAuUBROCtrLMfEM2ySmzI1nu7KunAuS6 X-Received: by 10.182.213.5 with SMTP id no5mr10401014obc.15.1395097979290; Mon, 17 Mar 2014 16:12:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.196 with SMTP id 62ls1099084qgt.76.gmail; Mon, 17 Mar 2014 16:12:59 -0700 (PDT) X-Received: by 10.220.99.72 with SMTP id t8mr21938765vcn.10.1395097978993; Mon, 17 Mar 2014 16:12:58 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id tm8si2170370vdc.98.2014.03.17.16.12.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 16:12:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id id10so6541593vcb.12 for ; Mon, 17 Mar 2014 16:12:58 -0700 (PDT) X-Received: by 10.221.29.137 with SMTP id ry9mr21931615vcb.6.1395097978883; Mon, 17 Mar 2014 16:12:58 -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 i9csp162008vck; Mon, 17 Mar 2014 16:12:58 -0700 (PDT) X-Received: by 10.224.131.193 with SMTP id y1mr6122834qas.86.1395097978375; Mon, 17 Mar 2014 16:12:58 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id gq5si7763833qab.67.2014.03.17.16.12.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 16:12:58 -0700 (PDT) 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]:60606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfr5-0001nu-8N for patch@linaro.org; Mon, 17 Mar 2014 18:17:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfmJ-0004XD-Nu 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 1WPfmI-0007Sh-DJ for qemu-devel@nongnu.org; Mon, 17 Mar 2014 18:13:03 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfmI-0007Pr-6P for qemu-devel@nongnu.org; Mon, 17 Mar 2014 18:13:02 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WPfle-00053g-0X; Mon, 17 Mar 2014 22:12:22 +0000 From: Peter Maydell To: Anthony Liguori Date: Mon, 17 Mar 2014 22:12:11 +0000 Message-Id: <1395094341-19339-21-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 20/30] target-arm: A64: Implement FRINT* 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.181 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 the FRINT* round-to-integral operations from the 2-reg-misc category. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 1394822294-14837-16-git-send-email-peter.maydell@linaro.org --- target-arm/translate-a64.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index b67cd1d..32eed41 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -6800,6 +6800,17 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u, tcg_temp_free_i32(tcg_shift); break; } + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x79: /* FRINTI */ + gen_helper_rintd(tcg_rd, tcg_rn, tcg_fpstatus); + break; + case 0x59: /* FRINTX */ + gen_helper_rintd_exact(tcg_rd, tcg_rn, tcg_fpstatus); + break; default: g_assert_not_reached(); } @@ -8999,12 +9010,29 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x19: /* FRINTM */ case 0x38: /* FRINTP */ case 0x39: /* FRINTZ */ + need_rmode = true; + rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); + /* fall through */ + case 0x59: /* FRINTX */ + case 0x79: /* FRINTI */ + need_fpstatus = true; + if (size == 3 && !is_q) { + unallocated_encoding(s); + return; + } + break; + case 0x58: /* FRINTA */ + need_rmode = true; + rmode = FPROUNDING_TIEAWAY; + need_fpstatus = true; + if (size == 3 && !is_q) { + unallocated_encoding(s); + return; + } + break; case 0x3c: /* URECPE */ case 0x3d: /* FRECPE */ case 0x56: /* FCVTXN, FCVTXN2 */ - case 0x58: /* FRINTA */ - case 0x59: /* FRINTX */ - case 0x79: /* FRINTI */ case 0x7c: /* URSQRTE */ case 0x7d: /* FRSQRTE */ unsupported_encoding(s, insn); @@ -9130,6 +9158,17 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_temp_free_i32(tcg_shift); break; } + case 0x18: /* FRINTN */ + case 0x19: /* FRINTM */ + case 0x38: /* FRINTP */ + case 0x39: /* FRINTZ */ + case 0x58: /* FRINTA */ + case 0x79: /* FRINTI */ + gen_helper_rints(tcg_res, tcg_op, tcg_fpstatus); + break; + case 0x59: /* FRINTX */ + gen_helper_rints_exact(tcg_res, tcg_op, tcg_fpstatus); + break; default: g_assert_not_reached(); }