From patchwork Mon Dec 30 16:34:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22819 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF2D3218CC for ; Mon, 30 Dec 2013 16:34:47 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 6sf14492419qea.9 for ; Mon, 30 Dec 2013 08:34:46 -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=5zS+CY1DdJ7u7cyk1wnEYqYF2WRWRXcTzOGMluUj+hM=; b=TpP6xszsLoHxi5csVMIk1rsFZO9/VNnM55gVsyELY4Gc5m0mIUs16Z6dofxIgAuJLs AIhfVgnAHGgKbwuM6WSk8Ccb96b0IzBymZOzh1z0PcKUHiQSFdmGDBV2zuTYDbM72tsC Bk6R6IF6AF9jmDXRrEhPNML5cwyOMMk4L3yK5E0o5mXFU1WFO+a9GXM7s40/2FIBP3GQ pzsjGh0Tay9XZ/i0SXHH9k+SoomuYI6WYfcwglbc5COeLOwqybKASAe5WbfuWaNhoBYq NXhTrCXwoVxbw52Er9iDd4Qp95U9asLHghThjDkSY5zKRegD6IuVK3rYucYx97lVJQEa OZpQ== X-Gm-Message-State: ALoCoQn2m8HIuLv+hJEU9+Wpmsa64ig8SIcQnDrgXg+n0v4xA4qQhxbuPjUFbwG6mGPXjsatRUXs X-Received: by 10.58.171.135 with SMTP id au7mr27950891vec.22.1388421286848; Mon, 30 Dec 2013 08:34:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.37 with SMTP id e5ls3687060qer.84.gmail; Mon, 30 Dec 2013 08:34:46 -0800 (PST) X-Received: by 10.58.100.244 with SMTP id fb20mr36902543veb.6.1388421286715; Mon, 30 Dec 2013 08:34:46 -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 dd4si17396827vcb.70.2013.12.30.08.34.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Dec 2013 08:34:46 -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 id10so4932649vcb.35 for ; Mon, 30 Dec 2013 08:34:46 -0800 (PST) X-Received: by 10.220.248.202 with SMTP id mh10mr1825291vcb.70.1388421286622; Mon, 30 Dec 2013 08:34:46 -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 ey3csp616686ved; Mon, 30 Dec 2013 08:34:46 -0800 (PST) X-Received: by 10.204.70.9 with SMTP id b9mr22844177bkj.17.1388421284707; Mon, 30 Dec 2013 08:34:44 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id dg6si14703506bkc.242.2013.12.30.08.34.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Dec 2013 08:34:44 -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 1VxfnY-0000Xw-CD; Mon, 30 Dec 2013 16:34:36 +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 Subject: [PATCH v2 10/10] target-arm: Give the FPSCR rounding modes names Date: Mon, 30 Dec 2013 16:34:35 +0000 Message-Id: <1388421275-2035-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1388421275-2035-1-git-send-email-peter.maydell@linaro.org> References: <1388421275-2035-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: , From: Alexander Graf When setting rounding modes we currently just hardcode the numeric values for rounding modes in a big switch statement. With AArch64 support coming, we will need to refer to these rounding modes at different places throughout the code though, so let's better give them names so we don't get confused by accident. Signed-off-by: Alexander Graf [WN: Commit message tweak, use names from ARM ARM.] Signed-off-by: Will Newton Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target-arm/cpu.h | 9 +++++++++ target-arm/helper.c | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 6c84e22..1a32907 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -487,6 +487,15 @@ static inline void vfp_set_fpcr(CPUARMState *env, uint32_t val) vfp_set_fpscr(env, new_fpscr); } +enum arm_fprounding { + FPROUNDING_TIEEVEN, + FPROUNDING_POSINF, + FPROUNDING_NEGINF, + FPROUNDING_ZERO, + FPROUNDING_TIEAWAY, + FPROUNDING_ODD +}; + enum arm_cpu_mode { ARM_CPU_MODE_USR = 0x10, ARM_CPU_MODE_FIQ = 0x11, diff --git a/target-arm/helper.c b/target-arm/helper.c index d1ed6b0..b157c55 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -3815,16 +3815,16 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) if (changed & (3 << 22)) { i = (val >> 22) & 3; switch (i) { - case 0: + case FPROUNDING_TIEEVEN: i = float_round_nearest_even; break; - case 1: + case FPROUNDING_POSINF: i = float_round_up; break; - case 2: + case FPROUNDING_NEGINF: i = float_round_down; break; - case 3: + case FPROUNDING_ZERO: i = float_round_to_zero; break; }