From patchwork Sat Dec 28 21:49:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22770 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 9F112202E4 for ; Sat, 28 Dec 2013 21:49:24 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf49040257ieb.5 for ; Sat, 28 Dec 2013 13:49:23 -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=ypgJFf7gMLvkDfee8EoGKBMGiv8HxZlhwFExSaOqNrI=; b=dC3F2rr1mMw0okzkTLZgQX3f8Eg7eDXmEq0bUHTt4/neP/cWbGqJWZjXri19rhw3N1 D4g1bATOQ6XTFbyqLCDuxXIRsVEvbOYWDYSnCGxC7NrTjCp6T/biOca8dkTmfmkSrQG6 jqB544qlSG4b+e9kPy6hor1uxlIg5NonZtp4MuwLtwwGIQHXtAP+K1exxGuzcJO0A8au oOSZxRsQuIZAxpQ2kBWL+JhEO/Sx+rYqweJmUvMGk2GjsBmSJrVpAolFqfVcGmFP/bDI Aiasx2sx7QtnEBVMdfj4jTaKuNWwmhEBPDAn5xx0gmF0HelanEKjRY2RG2ivxnuRibgH KQ5A== X-Gm-Message-State: ALoCoQl+I/+9EhqK8fR97cEmHo6WXxIJ/Fa6SxpPpdyyn2rImBsGmPPsJamd6wtZw0KJudlONKe3 X-Received: by 10.42.70.142 with SMTP id f14mr12151826icj.6.1388267363979; Sat, 28 Dec 2013 13:49:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.164 with SMTP id ld4ls3105731qeb.51.gmail; Sat, 28 Dec 2013 13:49:23 -0800 (PST) X-Received: by 10.58.186.233 with SMTP id fn9mr13621952vec.31.1388267363847; Sat, 28 Dec 2013 13:49:23 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id a6si13789313vdp.130.2013.12.28.13.49.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Dec 2013 13:49:23 -0800 (PST) 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 if17so4706342vcb.19 for ; Sat, 28 Dec 2013 13:49:23 -0800 (PST) X-Received: by 10.52.166.6 with SMTP id zc6mr26652459vdb.10.1388267363765; Sat, 28 Dec 2013 13:49:23 -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 ey3csp529335ved; Sat, 28 Dec 2013 13:49:23 -0800 (PST) X-Received: by 10.180.207.239 with SMTP id lz15mr38156623wic.28.1388267362832; Sat, 28 Dec 2013 13:49:22 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id hr9si15002592wib.70.2013.12.28.13.49.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 28 Dec 2013 13:49:22 -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 1Vx1kt-0008IJ-M7; Sat, 28 Dec 2013 21:49:11 +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 Subject: [PATCH 10/10] target-arm: Give the FPSCR rounding modes names Date: Sat, 28 Dec 2013 21:49:11 +0000 Message-Id: <1388267351-31818-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1388267351-31818-1-git-send-email-peter.maydell@linaro.org> References: <1388267351-31818-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: , 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 --- 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; }