From patchwork Fri Mar 14 18:38:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26301 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 6F9FB202DD for ; Fri, 14 Mar 2014 18:57:03 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf10030807iec.11 for ; Fri, 14 Mar 2014 11:57:02 -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=xQxFWbtI72/xPLyYK/mPxFFrBPEBUJSAibOpiDq9TT8=; b=mAxqD7qnzl03OI0iZqXBIhkwZpxQC5vt/wpdUIJ8kg9yn4is01r6lq8bfUEJdENBY5 CgUS5uY09ARBwJDz4IDbTlSpgBRGDtpHo6QtliXZ5uwbQD74F6GJCzsFbaQYTnwoNKJ6 gmuzW/6ozU7mh7foMJgQUgi/1th/jobuJVUrGLq2ebfQdjwtjViiRcOcOclIczbDpvyC UVxhEXxm5IqplGBOHbhh/go51j/WbHlh0khsNpd97g+YntkYQxmLV7orErTsGL/HCfUs 5PQwOgTBDYpMHVil4xSsdqKWx6eiyBqO7W3KjlAI3kMvuLzIb/qOI4FP+ezi0xYmaZJS 3SxA== X-Gm-Message-State: ALoCoQni/wDAXTuUXbu8nqR+OtRmIsYlTAzhevMzla4VIeUeoygvAPWPgLob1OxnikdLLpkB3VQK X-Received: by 10.182.66.193 with SMTP id h1mr3809894obt.47.1394823422925; Fri, 14 Mar 2014 11:57:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.101 with SMTP id a92ls88869qga.66.gmail; Fri, 14 Mar 2014 11:57:02 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr7487677vec.15.1394823422794; Fri, 14 Mar 2014 11:57:02 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id f7si2406357vcz.57.2014.03.14.11.57.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 11:57:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so3215205vcb.33 for ; Fri, 14 Mar 2014 11:57:02 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr7761585vcb.16.1394823422718; Fri, 14 Mar 2014 11:57:02 -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 i9csp44503vck; Fri, 14 Mar 2014 11:57:02 -0700 (PDT) X-Received: by 10.194.1.242 with SMTP id 18mr8137825wjp.22.1394823421656; Fri, 14 Mar 2014 11:57:01 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id a9si9405240wiy.42.2014.03.14.11.57.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Mar 2014 11:57:01 -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 1WOWzn-0003sk-Cg; Fri, 14 Mar 2014 18:38:15 +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 v2 15/25] target-arm: A64: Implement FRINT* Date: Fri, 14 Mar 2014 18:38:04 +0000 Message-Id: <1394822294-14837-16-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394822294-14837-1-git-send-email-peter.maydell@linaro.org> References: <1394822294-14837-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.220.174 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 the FRINT* round-to-integral operations from the 2-reg-misc category. Signed-off-by: Peter Maydell --- 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(); }