From patchwork Sat May 8 01:46:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 432519 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp841576jao; Fri, 7 May 2021 18:51:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySy/gYC0eRJmc7X0dgExaBcfrcSYBzjJ8tO9h1MAsTVNvktbRnc0MMne6bKz9LDPy1evzV X-Received: by 2002:a05:6638:3f2:: with SMTP id s18mr11544989jaq.63.1620438688822; Fri, 07 May 2021 18:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620438688; cv=none; d=google.com; s=arc-20160816; b=aNO7auXCFdePtjIjvZuvlzQ2r3m+XdMPm68+UgQSJpgqp0j3cBk2afU43qKN/Mfiab kPjZMzhrjJutDhtCX0RHUL7RlmKTyRHTFR/RvLf/XMlD7gkcXcBGDVADVvp96MSALgCy znvPdc0uJjZgliSANo4TjWzws8NlKQb52gg9PVd6roXCif9Ul4atlpK0H0C5wgJMwDVj dlhE58nezLdzR4nQLCIJcKAjdw573ExBldIERkI4/roUy5FQ3MOc4SXblgSaE9LSqhQz 7Bsfiaz/ClSzIWLtMLsM3ArF9U5wpwRW51L40tYhmNxK7OtsOb/LPCTV0aR2ergYwdJR sFOQ== 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:message-id:date:subject:to:from:dkim-signature; bh=/Mpqsl6ZXk9A8jU5cS9KzGLD3JWl8vKGch9eyqc3DFM=; b=EmdCS8i5sFG3SxwDEAOqayWWBht0ykKGz+kejHQ+PVM3A0FQM5x0LL3WFhWfRrBtaC C3N0MtObTk+Eh3ZsRHjPqt38clb+Q0wTrRcd6OWPhrJvfDKzG06dhu7y0t2FWH7rhcdf oDjSo1GisebiB7ZDyQxMMU/xd0uP0sGphSdZzkRO20FcPC5X6mNuQzEZ4GuG9LvqCABO ERByDI1QKE3lcDQJQYWSYOpboKDkw5oQfgpEx5jXEZKPa4dcR8ODTFowSx3Q0zmI5V0q xHGk3/lFA7ZlUKKCHfmP3xjvpQjCp+z3110MccAqYpYOKPRbqotDNZfRpubmxQzFSgYf cErw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iZ3oP1NJ; 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=fail (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 w14si8932565ilu.141.2021.05.07.18.51.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 May 2021 18:51:28 -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=fail header.i=@linaro.org header.s=google header.b=iZ3oP1NJ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfC7s-0001RW-5c for patch@linaro.org; Fri, 07 May 2021 21:51:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfC4g-0003wR-Cn for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:10 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:55155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfC4b-0003Ty-VU for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:10 -0400 Received: by mail-pj1-x1031.google.com with SMTP id g24so6197568pji.4 for ; Fri, 07 May 2021 18:48:05 -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:mime-version :content-transfer-encoding; bh=/Mpqsl6ZXk9A8jU5cS9KzGLD3JWl8vKGch9eyqc3DFM=; b=iZ3oP1NJBSMZbnlOXIPpqLJGNZGAXBdkI6/bmR24LXkcBlZoPC9TOwSR6+d94Doib2 0JvRwDTYFAEjw/tD+22GjSSCxMWcst/Tibud+2orxHSbNw8vNJO1gUtNkfA2SjsjS7c8 +3jFR9c8seIYsGyvzFPegg8PTHdtb/U20HMWWC/K3Is3HN/A2dOt+wrKxfUz5sXMa64m 42buLEy713G0CEeSM4U2PRgPAqofM6XJy02rT1LkTk+O0OPo97T4guN3gn4C+/JJ0bQn N5rYp7vgSy11KgBn2qvFM9tKRtPy7453KIpFo/qOa2VMGkJCHVE6PBEBG5ei2toTXWU4 G0tg== 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:mime-version :content-transfer-encoding; bh=/Mpqsl6ZXk9A8jU5cS9KzGLD3JWl8vKGch9eyqc3DFM=; b=rUFDGGUEVcffB/fuickI0lBPG3NN6JrwHhTioyTwCZDU825SwD6yEYMzOKPvibj3dc Al06rnZT3ESlDuJYDr9ovovJMFQ9kqK5CHdRprqAKnxYRpFVgNmW5Pn5JA984QAfWmHW 0s9tduN+bVgVnOa6x6lm5JP1qfQCoQq7nIvGBf2HVhVw42S/QQGRr1sJ1dF6mTDab60U elWysAcTB51HYHvW837csYRLRN9KiAv+5BXrpvU9184OtxQ5KfJwdOvIM0XQvxdBTWBG EYlbt80yHKkehOJmU8UI6HTOf4BTv6zmjdi3E1q+xyXxpJ6A9TQ7yHVD/qED02ZAik/u 6iiA== X-Gm-Message-State: AOAM530pjRz05CuRukqrnERkStlPPWvxp2FKRWXpgEq1t2t7XCXg/ICC 9OSlkPNnz1OZW6+AbAuH65Q8Ry/4vHm1kw== X-Received: by 2002:a17:90a:3948:: with SMTP id n8mr14292920pjf.32.1620438484152; Fri, 07 May 2021 18:48:04 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id t4sm5819681pfq.165.2021.05.07.18.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 18:48:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 00/72] Convert floatx80 and float128 to FloatParts Date: Fri, 7 May 2021 18:46:50 -0700 Message-Id: <20210508014802.892561-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reorg everything using QEMU_GENERIC and multiple inclusion to reduce the amount of code duplication between the formats. The use of QEMU_GENERIC means that we need to use pointers instead of structures, which means that even the smaller float formats need rearranging. I've carried it through to completion within fpu/, so that we don't have (much) of the legacy code remaining. There is some floatx80 stuff in target/m68k and target/i386 that's still hanging around. r~ Alex Bennée (1): tests/fp: add quad support to the benchmark utility Richard Henderson (71): qemu/host-utils: Use __builtin_bitreverseN qemu/host-utils: Add wrappers for overflow builtins qemu/host-utils: Add wrappers for carry builtins accel/tcg: Use add/sub overflow routines in tcg-runtime-gvec.c softfloat: Move the binary point to the msb softfloat: Inline float_raise softfloat: Use float_raise in more places softfloat: Tidy a * b + inf return softfloat: Add float_cmask and constants softfloat: Use return_nan in float_to_float softfloat: fix return_nan vs default_nan_mode target/mips: Set set_default_nan_mode with set_snan_bit_is_one softfloat: Do not produce a default_nan from parts_silence_nan softfloat: Rename FloatParts to FloatParts64 softfloat: Move type-specific pack/unpack routines softfloat: Use pointers with parts_default_nan softfloat: Use pointers with unpack_raw softfloat: Use pointers with ftype_unpack_raw softfloat: Use pointers with pack_raw softfloat: Use pointers with ftype_pack_raw softfloat: Use pointers with ftype_unpack_canonical softfloat: Use pointers with ftype_round_pack_canonical softfloat: Use pointers with parts_silence_nan softfloat: Rearrange FloatParts64 softfloat: Convert float128_silence_nan to parts softfloat: Convert float128_default_nan to parts softfloat: Move return_nan to softfloat-parts.c.inc softfloat: Move pick_nan to softfloat-parts.c.inc softfloat: Move pick_nan_muladd to softfloat-parts.c.inc softfloat: Move sf_canonicalize to softfloat-parts.c.inc softfloat: Move round_canonical to softfloat-parts.c.inc softfloat: Use uadd64_carry, usub64_borrow in softfloat-macros.h softfloat: Move addsub_floats to softfloat-parts.c.inc softfloat: Implement float128_add/sub via parts softfloat: Move mul_floats to softfloat-parts.c.inc softfloat: Move muladd_floats to softfloat-parts.c.inc softfloat: Use mulu64 for mul64To128 softfloat: Use add192 in mul128To256 softfloat: Tidy mul128By64To192 softfloat: Introduce sh[lr]_double primitives softfloat: Move div_floats to softfloat-parts.c.inc softfloat: Split float_to_float softfloat: Convert float-to-float conversions with float128 softfloat: Move round_to_int to softfloat-parts.c.inc softfloat: Move rount_to_int_and_pack to softfloat-parts.c.inc softfloat: Move rount_to_uint_and_pack to softfloat-parts.c.inc softfloat: Move int_to_float to softfloat-parts.c.inc softfloat: Move uint_to_float to softfloat-parts.c.inc softfloat: Move minmax_flags to softfloat-parts.c.inc softfloat: Move compare_floats to softfloat-parts.c.inc softfloat: Move scalbn_decomposed to softfloat-parts.c.inc softfloat: Move sqrt_float to softfloat-parts.c.inc softfloat: Split out parts_uncanon_normal softfloat: Reduce FloatFmt softfloat: Introduce Floatx80RoundPrec softfloat: Adjust parts_uncanon_normal for floatx80 tests/fp/fp-test: Reverse order of floatx80 precision tests softfloat: Convert floatx80_add/sub to FloatParts softfloat: Convert floatx80_mul to FloatParts softfloat: Convert floatx80_div to FloatParts softfloat: Convert floatx80_sqrt to FloatParts softfloat: Convert floatx80_round to FloatParts softfloat: Convert floatx80_round_to_int to FloatParts softfloat: Convert integer to floatx80 to FloatParts softfloat: Convert floatx80 float conversions to FloatParts softfloat: Convert floatx80 to integer to FloatParts softfloat: Convert floatx80_scalbn to FloatParts softfloat: Convert floatx80 compare to FloatParts softfloat: Convert float32_exp2 to FloatParts softfloat: Move floatN_log2 to softfloat-parts.c.inc softfloat: Convert modrem operations to FloatParts include/fpu/softfloat-helpers.h | 5 +- include/fpu/softfloat-macros.h | 247 +- include/fpu/softfloat-types.h | 10 +- include/fpu/softfloat.h | 11 +- include/qemu/host-utils.h | 291 ++ target/mips/fpu_helper.h | 10 +- accel/tcg/tcg-runtime-gvec.c | 36 +- fpu/softfloat.c | 7760 ++++++++++-------------------- linux-user/arm/nwfpe/fpa11.c | 41 +- target/i386/tcg/fpu_helper.c | 79 +- target/m68k/fpu_helper.c | 50 +- target/m68k/softfloat.c | 90 +- tests/fp/fp-bench.c | 88 +- tests/fp/fp-test-log2.c | 118 + tests/fp/fp-test.c | 11 +- fpu/softfloat-parts-addsub.c.inc | 62 + fpu/softfloat-parts.c.inc | 1480 ++++++ fpu/softfloat-specialize.c.inc | 424 +- tests/fp/wrap.c.inc | 12 + tests/fp/meson.build | 11 + 20 files changed, 4886 insertions(+), 5950 deletions(-) create mode 100644 tests/fp/fp-test-log2.c create mode 100644 fpu/softfloat-parts-addsub.c.inc create mode 100644 fpu/softfloat-parts.c.inc -- 2.25.1 Signed-off-by: Alex Bennée