From patchwork Sun Aug 30 02:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248717 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp2298741ilg; Sat, 29 Aug 2020 19:32:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU2GC37LiJOE9fPj27GVO1Q6F7oX9tnc/yQXcPkCUo1Fe4ykufqI1yNckWJx0uoYcOhQyL X-Received: by 2002:a25:1189:: with SMTP id 131mr10941994ybr.364.1598754758196; Sat, 29 Aug 2020 19:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598754758; cv=none; d=google.com; s=arc-20160816; b=sGj463k/jSuwzAySsLBUj2mH+Ei2Aa1j7vS1IbdpfGhdHNq7+m6raPA+6R0jZ/U33z +MohLKzd8J/djNmH458IroPv8SqPWna0YrGMG6A75qRa6swNBdEuv128L1ZpVSrECFdF qfvs8wyOhsR+lJk0+H3O/RE7ddYyPZa5viRoPdClBuIO78eE/leo1g910Cxq9Dp2rZkz INy9wJWrzG6Ta21n9dTJ+DO+1O0QIgCGuTbDQF5GNmjuddVWPHjY0YI+XHYf8sElun0B CKfxr2Gsbgj2KZUAzIaCnbMIsHnBCFvNTE7YTviycIBZmvY2Zo0mjjvMAw5/TsUVr+8+ fnNQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=03HWfKJcxI+2FEdiEL/iXlMX93EyWDJq6OG6P1m51Wg=; b=s9Q9janzKNTD4Wv+TW3icVxngCd6m1tuSzbWLuHFhDReQ8EQet/WVvA8kc3ZbTRZTh X3nD/t0XnrPaql36os8U116hlyB70NiZvVJdpzLk8sh04stB4ZK4xs4RFEglE4DrlwaX PAz1J7M7fbxfLdVBGObbmhOPMz0d08cMwk5ND8GO1lmT/Qv4uXoAP4uh15YiFARJBsrJ bqMVgRQJ2OTqTCmk99DWre5bRfgyKoZi5ntxvGKAxHoewE8V8fO2DLAlkhrCiDm5AUO0 saOrMx0uwNE/tENwVpcyWv4tVSyKWtM8a7k2aKD91ImoVeeK0Yxea5P2OjCzpirGCg0G 9jAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JFtHkiOE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r66si3866525ybr.265.2020.08.29.19.32.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 29 Aug 2020 19:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JFtHkiOE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCD93-0002tv-KU for patch@linaro.org; Sat, 29 Aug 2020 22:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCD8m-0002qi-JK for qemu-devel@nongnu.org; Sat, 29 Aug 2020 22:32:21 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:46862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCD8j-0002Z6-8N for qemu-devel@nongnu.org; Sat, 29 Aug 2020 22:32:20 -0400 Received: by mail-pg1-x534.google.com with SMTP id 31so2367615pgy.13 for ; Sat, 29 Aug 2020 19:32:16 -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=03HWfKJcxI+2FEdiEL/iXlMX93EyWDJq6OG6P1m51Wg=; b=JFtHkiOEBSQhZglqDXmlEXGcIcVkM+B/1drXTPienRwUZFH5uEzoUsta7PDy8wTcx8 cakMGy6MfwvYuUFwHwmIOBWJCCJWw+U0NK7ISKLofCdDGF93luDHlUyFlfzJ4088D6pt L/Hh2I0Dewv8DgE4AlsmoegyGDPgdpzzzK44JwcwDVgrPCNE+ZQMt1QDwQF+RIrHZeHN myNzq3849oNvVi6HAFFPXo/m+rryFzDBntWd/m9lM1lhwAbwTPFxKYhlvdlqGYtycVoh RXjvsenoyGr/UWJXv+7+WL4KMRgu9v5cjmBzgqIgKvmxsVAvnz5MiTf4R3i4Zz2N0W5M zwqw== 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=03HWfKJcxI+2FEdiEL/iXlMX93EyWDJq6OG6P1m51Wg=; b=lROLmI8TKvXE8pOU51vHw2uEMEs2yXISxHJKDPENqPnyM9dzZz3Et9ERHrUDmdh3Jb T0L3LXyH+6m2tJKho4avTygceOm4ejJB8N6Z9P9dJwu3VonBIqtf1ARjQOlyL6QSsR29 tI2oZy9DTs5YA2ljiuGrgupkY0z96dXXm/BMZr7Xs5DaRkmuaUkgPwW5wmMjLHcln5U2 XPxaMQ9T3HBcbGNYq3p0BcmHEc57P+TWjbfWR5EHp/kq3+zifghDvX2r2xQQdLjbSgbW +sjthjk7rRztc/O384BrX4JMXQ+21GFLNwSsLtk/9VQnfmP/H6BozaYnWx8PuDOZraJR tkrA== X-Gm-Message-State: AOAM532LQwpap9tLS0J87QfiEjpFO9NQmGo3lmndz6fKVe/ueRvIqOry DWkgUwGNrxfkzDKSJtep95hPJ8xM3fMyfw== X-Received: by 2002:a63:f209:: with SMTP id v9mr3937213pgh.237.1598754735364; Sat, 29 Aug 2020 19:32:15 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id l23sm3546269pgt.16.2020.08.29.19.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 19:32:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 7/7] softfloat: Define comparison operations for bfloat16 Date: Sat, 29 Aug 2020 19:32:03 -0700 Message-Id: <20200830023203.612312-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200830023203.612312-1-richard.henderson@linaro.org> References: <20200830023203.612312-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, LIU Zhiwei Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: LIU Zhiwei Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) -- 2.25.1 diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 1233f98014..78ad5ca738 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -479,6 +479,47 @@ static inline bfloat16 bfloat16_set_sign(bfloat16 a, int sign) return (a & 0x7fff) | (sign << 15); } +static inline bool bfloat16_eq(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare(a, b, s) == float_relation_equal; +} + +static inline bool bfloat16_le(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare(a, b, s) <= float_relation_equal; +} + +static inline bool bfloat16_lt(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare(a, b, s) < float_relation_equal; +} + +static inline bool bfloat16_unordered(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare(a, b, s) == float_relation_unordered; +} + +static inline bool bfloat16_eq_quiet(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare_quiet(a, b, s) == float_relation_equal; +} + +static inline bool bfloat16_le_quiet(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare_quiet(a, b, s) <= float_relation_equal; +} + +static inline bool bfloat16_lt_quiet(bfloat16 a, bfloat16 b, float_status *s) +{ + return bfloat16_compare_quiet(a, b, s) < float_relation_equal; +} + +static inline bool bfloat16_unordered_quiet(bfloat16 a, bfloat16 b, + float_status *s) +{ + return bfloat16_compare_quiet(a, b, s) == float_relation_unordered; +} + #define bfloat16_zero 0 #define bfloat16_half 0x3f00 #define bfloat16_one 0x3f80