From patchwork Thu Jun 3 21:41:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 453315 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp627795jao; Thu, 3 Jun 2021 14:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwARGHRSqmCKoO2tFNlKWuoXhbLiFan3s2ZGh71trbUhT/ukwPmE/CPNqkgHDC5dLE2ZXum X-Received: by 2002:a05:6102:2046:: with SMTP id q6mr483267vsr.51.1622756710400; Thu, 03 Jun 2021 14:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622756710; cv=none; d=google.com; s=arc-20160816; b=rtvw7c0cpeVqdc990aUoEQkjKQX3EmiMf9IKDiLxZu54IVbb+9F0907ykYMXeVccLZ LZPaxntLxykL0SndZkuF2HRwwrypXni0PEqTdDdQUmhUCEvVuJ0C5VefO645umwqmOod ee8LbVI6BLmbAVSB36o1kqM2T/FPlzxJ17fPeE1RgPyhK236TqDKPTAp93LcqyEbHid/ z5HuOJqh9hKJWkML1Da6g9m+z9zA2sJVDJxW5nBfiIhwZXL5Z/jyaczz+lZeH5Mp0Xaw E98D4TyfMYCfuz8U2KAmecpSjHefMyFFTVX3CKSE+gFfV+o+IZViD5jA5g7/XPJaUuP2 mNXw== 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=keKjVz3imnmcUE3wTIllL+iQylaB2Eebnx0eXWC+uoM=; b=0MhocXv4vJB0CMlS4KyLZKfxBu905qGGc9pQZXbyPxlX+jsn0v1gI5o8Qoo4peS6j9 omQY5URZpeOQyUOxP1f/Y+px2fCR7eeqdriJca9so6F9IVsynn7Rhgw7w2Rwzeqp6h3I Ni1Jn5tiEeQxrGqYvnkw30Hydm7eVHdmO17Rhkd+DgJRCWATlXJFMAYursOE5DdUk89K B/L/qSKWwhHpZF/9k8i3JLc9C6Blts05GI2eqvYHqb5KOSLR3E71DPgrC2iORrt2KUog MU/HfCmZcsgoNW27m/1tYCKZDxVacDHe7by+YdZLl5zBGrkNzb76iAraXdZMnjL721gm BYZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jg6erSt0; 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 f3si2033959uab.107.2021.06.03.14.45.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Jun 2021 14:45:10 -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=Jg6erSt0; 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]:33996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lov9J-0004yd-M9 for patch@linaro.org; Thu, 03 Jun 2021 17:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lov5v-00021f-GS for qemu-devel@nongnu.org; Thu, 03 Jun 2021 17:41:39 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:53094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lov5t-00011b-NH for qemu-devel@nongnu.org; Thu, 03 Jun 2021 17:41:39 -0400 Received: by mail-pj1-x1030.google.com with SMTP id h16so4445410pjv.2 for ; Thu, 03 Jun 2021 14:41:36 -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=keKjVz3imnmcUE3wTIllL+iQylaB2Eebnx0eXWC+uoM=; b=Jg6erSt06mrzVQ8iwCmUTSU+JmpntcyfKNOvUAEPdki+s6Of3krtkKHY12lyzaL0vE L5e40lnB7C6j/uHh7YQk7pfkQAaUCNIh3r05qFZRGUXbmR2FAUsNNhAPkRqDI1Bkn5XI 0thG+6ob0GwXYgeug/99gQm1pdey7Z/4cutfhFvdoSImSk7nfwTESNdG7/rakXEHC04h TRHGUvRuVkkO/lM7maNK7Ym7hVYiMK7CeAWZcz0VzpFcyLIahYA0H0qqk2s3+luFxqsW L7wpLubvhxzniHBzrqlnRSzgEpXIGAHjBFFETimxg7N65zIbZBDEkLITaSngAtG0xWuI xiTg== 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=keKjVz3imnmcUE3wTIllL+iQylaB2Eebnx0eXWC+uoM=; b=HBfZotLArGYevFsgkn8GxbfDVFOqdpzrNhtpHPlJEbxqSYjVxB+NNGhMx14SuTlk3r CKcUEgliiBlf0Lib15YVyq5PBsjeKQjMyB6ZQ9X/7xUp6qBtWhcmGCYHjRF6ktREDUYt YXfClmb1CnSvDFBeComGJIZ8xjx9pIlG4S5R/zlafV4hNulC4uImAJnOKPwwyacrAk4N BlSs9QnGT22JjhKmY9pFHLCf4FFnZTAKY6hJnzrh7M2+k9MH9dALG3xxMt7O0Emu2CEr SZYLhWdacooIik8maH11b5pyd9CgZR++k/ByGLIRCjqMHs1P2Z45Ybj1VSAFi0uJMu6i FHMQ== X-Gm-Message-State: AOAM5327B1DjiL5SthUaJChyt9X7YZ2gxGsfKs2pGE4HUp36z4qdRTVY uBpsMak8/xV+gRf++0LRI91GuBFFBFx5Ng== X-Received: by 2002:a17:902:ea92:b029:103:a022:c545 with SMTP id x18-20020a170902ea92b0290103a022c545mr1192574plb.43.1622756496107; Thu, 03 Jun 2021 14:41:36 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id p65sm40115pfb.62.2021.06.03.14.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 14:41:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/29] softfloat: Implement float128_(min|minnum|minnummag|max|maxnum|maxnummag) Date: Thu, 3 Jun 2021 14:41:07 -0700 Message-Id: <20210603214131.629841-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210603214131.629841-1-richard.henderson@linaro.org> References: <20210603214131.629841-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com 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: David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand The float128 implementation is straight-forward. Unfortuantely, we don't have any tests we can simply adjust/unlock. Signed-off-by: David Hildenbrand Message-Id: <20210517142739.38597-24-david@redhat.com> [rth: Update for changed parts_minmax return value] Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 6 ++++++ fpu/softfloat.c | 13 +++++++++++++ 2 files changed, 19 insertions(+) -- 2.25.1 diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 53f2c2ea3c..ed32040aa9 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -1204,6 +1204,12 @@ float128 float128_rem(float128, float128, float_status *status); float128 float128_sqrt(float128, float_status *status); FloatRelation float128_compare(float128, float128, float_status *status); FloatRelation float128_compare_quiet(float128, float128, float_status *status); +float128 float128_min(float128, float128, float_status *status); +float128 float128_max(float128, float128, float_status *status); +float128 float128_minnum(float128, float128, float_status *status); +float128 float128_maxnum(float128, float128, float_status *status); +float128 float128_minnummag(float128, float128, float_status *status); +float128 float128_maxnummag(float128, float128, float_status *status); bool float128_is_quiet_nan(float128, float_status *status); bool float128_is_signaling_nan(float128, float_status *status); float128 float128_silence_nan(float128, float_status *status); diff --git a/fpu/softfloat.c b/fpu/softfloat.c index ef750e1e95..4fee5a6cb7 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3324,6 +3324,18 @@ static float64 float64_minmax(float64 a, float64 b, float_status *s, int flags) return float64_round_pack_canonical(pr, s); } +static float128 float128_minmax(float128 a, float128 b, + float_status *s, int flags) +{ + FloatParts128 pa, pb, *pr; + + float128_unpack_canonical(&pa, a, s); + float128_unpack_canonical(&pb, b, s); + pr = parts_minmax(&pa, &pb, s, flags); + + return float128_round_pack_canonical(pr, s); +} + #define MINMAX_1(type, name, flags) \ type type##_##name(type a, type b, float_status *s) \ { return type##_minmax(a, b, s, flags); } @@ -3340,6 +3352,7 @@ MINMAX_2(float16) MINMAX_2(bfloat16) MINMAX_2(float32) MINMAX_2(float64) +MINMAX_2(float128) #undef MINMAX_1 #undef MINMAX_2