From patchwork Thu Jul 20 15:04:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 108373 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2273143qge; Thu, 20 Jul 2017 08:22:42 -0700 (PDT) X-Received: by 10.55.189.132 with SMTP id n126mr5422823qkf.89.1500564161979; Thu, 20 Jul 2017 08:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500564161; cv=none; d=google.com; s=arc-20160816; b=qTvLJTZLPHHnM7ek3Z4Jch/HGS0skUND/O6ytIHiUVlix0TeWldQb6G12FpCzhT+Cb QO0c4XwbK0BRCpSL57wONxgGvZB8mURA+6L9MhFXa7q4nsWLBB52NT2MK66NKyFttUR6 VtRzRS3PWZaSzTnJ0w20/LGdlHNMjr1sL5Turf7+9he/VWexnPWi7QAlKKc5sQ/Y1uRm +qXq0UhkqB+UeXpFj5jJcDty4dtDMwnvSVeG3uc6VjG7G7xLyHrndgEsBHnjJR+eoik3 +ir3yEnr6pUJ03nMf+/UoZ4rcgs7CdAY4oj3PSSRmFbR3tET+jYBTN3hqdYOueWm4Qcw 0X9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=MoxUR3jb2AiAmcpq6C4DGSMSBaymoXoECdfJljecjbY=; b=00Hl3oHlXY89vCztXkmDH0js7DHhat7OrDZmN82FqKioC3zD5n4Um72Y+Q3r0rKWxG CmNRlZtZDK5YaZhW8p88f6mSKU0le/d6eOfR9uek2524eqISl5jUnnUj8dF4TlEIPls7 4bR3ioVDLxRcclEYwmYMfRKsgTV8vXA9thRSu02W+Vl5PWkL+0nJnDdok9aCe+DssGol omv+jD6k2A+PHncZcDRVc181ci48ha+g1t1kQtgsx2vDhfdGVk+9//TP9wizph5haZr4 381sxFoJBmKz7eTuqhmAk0LoHHvaG7FwzhHaA84Ej9vonQCypHZkIUUdCUAxI05RvO0W kAcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=d6RdcFwR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r129si2075735qkd.288.2017.07.20.08.22.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 20 Jul 2017 08:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.b=d6RdcFwR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYDHj-0004Ge-Fz for patch@linaro.org; Thu, 20 Jul 2017 11:22:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYD88-0003FV-Dq for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYD87-0004MX-Bx for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:44 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYD87-0004M5-5l for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:43 -0400 Received: by mail-wm0-x231.google.com with SMTP id g127so29907870wmd.0 for ; Thu, 20 Jul 2017 08:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MoxUR3jb2AiAmcpq6C4DGSMSBaymoXoECdfJljecjbY=; b=d6RdcFwRipSR11Fn0Zr02qiI+nkOmv1+3l8GDjTLpfxfLRHDCZL4rS3aLBgIJwaOXq n6ClX9xU8z6NEciO/rdabRyRVzop+TT6EWc+rf8L2QgLearG3qDj/rqWzPHcj67S8SXU nZSiqLV6iOruG5CgZHfkDHEauZcedW9unUBJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MoxUR3jb2AiAmcpq6C4DGSMSBaymoXoECdfJljecjbY=; b=Bgba0q1axy6AgzcmZEXzDjMmb+qVh9Oy/9NIBuFEHv7/SvwR54DwWDrRZ8NH595iJI /JAE4aaqWotMUtLqglCR/LBeXNIujoYveRomEW2iUq5fwSYjjKa+RasGuFeTnbN3jlsB rcIPhUFjrtbiAyE/tRCBTvg7Z7Li9AnTSLp+5D+I0i7lYrhsNo3qNeGmtzS2wGVxxM06 Oa2mW7fydSLaLxbmN9VLPCuGZSiz+0tE+Rvdnmwb3qS2GgcEEbH9qST+DN8T8RLqiWLF bJuyHCEItucsYN6EhNElfpDQG+dO7HMz+tT/0Q9KWIHCl6Aai5gs9sJZ32asU9+L0hpm h4uA== X-Gm-Message-State: AIVw111wLxwJwCjYRndLd+6tk8W/T4LZ9ThgZ895GPhvQLK+kjw8sgg5 LUEcorGW2Og1HkSw X-Received: by 10.28.217.207 with SMTP id q198mr2596270wmg.45.1500563562112; Thu, 20 Jul 2017 08:12:42 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m196sm2287730wma.17.2017.07.20.08.12.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 08:12:38 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C97413E0BA0; Thu, 20 Jul 2017 16:04:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 20 Jul 2017 16:04:22 +0100 Message-Id: <20170720150426.12393-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170720150426.12393-1-alex.bennee@linaro.org> References: <20170720150426.12393-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16_abs helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno , rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will be required when expanding the MINMAX() macro for 16 bit/half-precision operations. Signed-off-by: Alex Bennée --- include/fpu/softfloat2a/softfloat.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.13.0 diff --git a/include/fpu/softfloat2a/softfloat.h b/include/fpu/softfloat2a/softfloat.h index a274dc7419..3cb41977d8 100644 --- a/include/fpu/softfloat2a/softfloat.h +++ b/include/fpu/softfloat2a/softfloat.h @@ -379,6 +379,13 @@ static inline int float16_is_zero_or_denormal(float16 a) return (float16_val(a) & 0x7c00) == 0; } +static inline float16 float16_abs(float16 a) +{ + /* Note that abs does *not* handle NaN specially, nor does + * it flush denormal inputs to zero. + */ + return make_float16(float16_val(a) & 0x7fff); +} /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/