From patchwork Tue Dec 31 13:35:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22834 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25D1E218CC for ; Tue, 31 Dec 2013 13:36:20 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id gq1sf59865818obb.6 for ; Tue, 31 Dec 2013 05:36:19 -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=y50VYf3Sj6IPIAvDYeZMPCFr9e3SlqIWVSpMhgX+CUQ=; b=RsEG9DFVb5S6BS1a5l102aF4IGnqX5a5SFmV/iyBuXzw3JcjkzYN3t3kceuTjA/F7G mUu4LWHG/TnvS66pX4SDnoIJb5McXBvC18BpWwIi9UVJv5BLFhAMzdngPhxijtZ6bzvP n9PXvWdl1zkck9/1Ocbcuo93cIoaupY69kdu4IU/P6+EXHUD8+b0s+KUzjgCiysCsuug PKzpzdapAP0a2Tl72KFjiyZrpkP2rQRIpfO+JXUOZiMfO5QEqvLyyZLWLM4TZNttnUo9 F0gdean/PLzjCWdfA07CVfwOCkjqliDvom2HCupdKXwQ1Ot15WusgR9+9sg/strLCqCG Yr4A== X-Gm-Message-State: ALoCoQl3yu6bE2e02wGFj1P7gI353P8+LexLStVmEuobSCmF5fq39i+6hFwTile4GPP+rWBc1vSW X-Received: by 10.182.213.5 with SMTP id no5mr29462475obc.15.1388496979297; Tue, 31 Dec 2013 05:36:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.16.35 with SMTP id c3ls3813852qed.83.gmail; Tue, 31 Dec 2013 05:36:19 -0800 (PST) X-Received: by 10.58.44.166 with SMTP id f6mr165140vem.76.1388496979190; Tue, 31 Dec 2013 05:36:19 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id e3si19117269vek.55.2013.12.31.05.36.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 31 Dec 2013 05:36:19 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id id10so5182550vcb.21 for ; Tue, 31 Dec 2013 05:36:19 -0800 (PST) X-Received: by 10.52.33.178 with SMTP id s18mr5023385vdi.39.1388496979087; Tue, 31 Dec 2013 05:36:19 -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.59.13.131 with SMTP id ey3csp664817ved; Tue, 31 Dec 2013 05:36:18 -0800 (PST) X-Received: by 10.180.14.195 with SMTP id r3mr47641054wic.51.1388496977272; Tue, 31 Dec 2013 05:36:17 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id lp10si18525532wjb.12.2013.12.31.05.36.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 31 Dec 2013 05:36:17 -0800 (PST) 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 1VxzUE-0000wN-Pc; Tue, 31 Dec 2013 13:35:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite , Tom Musta , Aurelien Jarno Subject: [PATCH 11/22] softfloat: Provide complete set of accessors for fp state Date: Tue, 31 Dec 2013 13:35:47 +0000 Message-Id: <1388496958-3542-12-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1388496958-3542-1-git-send-email-peter.maydell@linaro.org> References: <1388496958-3542-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.176 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: , Tidy up the get/set accessors for the fp state to add missing ones and make them all inline in softfloat.h rather than some inline and some not. Signed-off-by: Peter Maydell --- The specific one we want for A64 is to get the rounding mode, but we might as well fill in the gaps. --- fpu/softfloat.c | 15 --------------- include/fpu/softfloat.h | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 0eb4a29..495f46f 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -59,21 +59,6 @@ these four paragraphs for those parts of this code that are retained. *----------------------------------------------------------------------------*/ #include "softfloat-specialize.h" -void set_float_rounding_mode(int val STATUS_PARAM) -{ - STATUS(float_rounding_mode) = val; -} - -void set_float_exception_flags(int val STATUS_PARAM) -{ - STATUS(float_exception_flags) = val; -} - -void set_floatx80_rounding_precision(int val STATUS_PARAM) -{ - STATUS(floatx80_rounding_precision) = val; -} - /*---------------------------------------------------------------------------- | Returns the fraction bits of the half-precision floating-point value `a'. *----------------------------------------------------------------------------*/ diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index c49e836..b8d2b30 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -180,12 +180,22 @@ typedef struct float_status { flag default_nan_mode; } float_status; -void set_float_rounding_mode(int val STATUS_PARAM); -void set_float_exception_flags(int val STATUS_PARAM); INLINE void set_float_detect_tininess(int val STATUS_PARAM) { STATUS(float_detect_tininess) = val; } +INLINE void set_float_rounding_mode(int val STATUS_PARAM) +{ + STATUS(float_rounding_mode) = val; +} +INLINE void set_float_exception_flags(int val STATUS_PARAM) +{ + STATUS(float_exception_flags) = val; +} +INLINE void set_floatx80_rounding_precision(int val STATUS_PARAM) +{ + STATUS(floatx80_rounding_precision) = val; +} INLINE void set_flush_to_zero(flag val STATUS_PARAM) { STATUS(flush_to_zero) = val; @@ -198,11 +208,34 @@ INLINE void set_default_nan_mode(flag val STATUS_PARAM) { STATUS(default_nan_mode) = val; } +INLINE int get_float_detect_tininess(float_status *status) +{ + return STATUS(float_detect_tininess); +} +INLINE int get_float_rounding_mode(float_status *status) +{ + return STATUS(float_rounding_mode); +} INLINE int get_float_exception_flags(float_status *status) { return STATUS(float_exception_flags); } -void set_floatx80_rounding_precision(int val STATUS_PARAM); +INLINE int get_floatx80_rounding_precision(float_status *status) +{ + return STATUS(floatx80_rounding_precision); +} +INLINE flag get_flush_to_zero(float_status *status) +{ + return STATUS(flush_to_zero); +} +INLINE flag get_flush_inputs_to_zero(float_status *status) +{ + return STATUS(flush_inputs_to_zero); +} +INLINE flag get_default_nan_mode(float_status *status) +{ + return STATUS(default_nan_mode); +} /*---------------------------------------------------------------------------- | Routine to raise any or all of the software IEC/IEEE floating-point