From patchwork Tue Dec 31 13:35:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22836 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D999218CC for ; Tue, 31 Dec 2013 13:36:21 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i4sf62934740oah.2 for ; Tue, 31 Dec 2013 05:36:21 -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=2FNHZ8slSrAvkApzvC3A/XgffgJyHht3rhZCVMixvlA=; b=BZx3Egb1Q+0K8xkr2X3StdnXCrga9EQsrE7RlvgFz5L/2RqrE2ujfmYHolP+x9uQt2 HFf94MGv0ViRfNs7JEXDKc8+eqVC72vzXN1mTcaTpSxS1pVG3tF7Qj8yfSonjqV+cg9O K1eLWtlGz4NKLwoTIIN9cOYtXUnqQ6vjjOlxCsEV7Vfo0je5Bip56htttoumbX8DwQaA X6VOkVUYhUzet2kXdz/pGyaU36Z/wCZE+AR/bTKFOrSPNu5XD9QbbE9iS4hy8LkZJv8N mIohRULb9YdH9L9x46j163blhC1eTF3/rUeAvyJ5HI9qgaCir7UO5WXSSxXh8ZASfj6N Vt9g== X-Gm-Message-State: ALoCoQkif3+U2A6X09x6Yy5TwPssP8uS6+nuCItfEN99CnUQTl76fb5NL2R+q50k/UJd01pUtJvj X-Received: by 10.182.243.166 with SMTP id wz6mr28633190obc.19.1388496981205; Tue, 31 Dec 2013 05:36:21 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.70 with SMTP id v6ls4079967qec.47.gmail; Tue, 31 Dec 2013 05:36:21 -0800 (PST) X-Received: by 10.53.2.36 with SMTP id bl4mr4990579vdd.32.1388496981064; Tue, 31 Dec 2013 05:36:21 -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 b4si15810709vck.95.2013.12.31.05.36.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 31 Dec 2013 05:36:21 -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 id10so5141374vcb.7 for ; Tue, 31 Dec 2013 05:36:21 -0800 (PST) X-Received: by 10.52.114.99 with SMTP id jf3mr172903vdb.66.1388496980970; Tue, 31 Dec 2013 05:36:20 -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 ey3csp664819ved; Tue, 31 Dec 2013 05:36:20 -0800 (PST) X-Received: by 10.15.41.140 with SMTP id s12mr6776710eev.50.1388496978211; Tue, 31 Dec 2013 05:36:18 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id h45si57371246eeo.151.2013.12.31.05.36.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 31 Dec 2013 05:36:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VxzUE-0000vp-DN; 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 03/22] softfloat: Add 16 bit integer to float conversions Date: Tue, 31 Dec 2013 13:35:39 +0000 Message-Id: <1388496958-3542-4-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: , Add the float to 16 bit integer conversion routines. These can be trivially implemented in terms of the int32_to_float* routines, but providing them makes our API more symmetrical and can simplify callers. Signed-off-by: Peter Maydell --- include/fpu/softfloat.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index a9b8cd9..3790b10 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -238,6 +238,23 @@ float64 uint64_to_float64( uint64 STATUS_PARAM ); floatx80 int64_to_floatx80( int64 STATUS_PARAM ); float128 int64_to_float128( int64 STATUS_PARAM ); float128 uint64_to_float128( uint64 STATUS_PARAM ); +/* We provide the int16 versions for symmetry of API with float-to-int */ +INLINE float32 int16_to_float32(int_fast16_t v STATUS_PARAM) +{ + return int32_to_float32(v STATUS_VAR); +} +INLINE float32 uint16_to_float32(uint_fast16_t v STATUS_PARAM) +{ + return uint32_to_float32(v STATUS_VAR); +} +INLINE float64 int16_to_float64(int_fast16_t v STATUS_PARAM) +{ + return int32_to_float64(v STATUS_VAR); +} +INLINE float64 uint16_to_float64(uint_fast16_t v STATUS_PARAM) +{ + return uint32_to_float64(v STATUS_VAR); +} /*---------------------------------------------------------------------------- | Software half-precision conversion routines.