From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jE1GCKTj82pO4AAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2026 22:40:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 1D443378002; Tue, 10 Nov 2026 22:40:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C0A331E043 for ; Tue, 10 Nov 2026 22:40:18 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8DB8F4BA23DF for ; Wed, 11 Nov 2026 03:40:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DB8F4BA23DF Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 55EB44BA2E22 for ; Wed, 11 Nov 2026 03:39:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55EB44BA2E22 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dubner.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 55EB44BA2E22 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=166.84.1.89 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794368390; cv=none; b=ERp1nLRIsFxt3igrIKeQeq66FAvqErBhfkYuZE9T9s3whRbzsap0P1UE3OYkcQWyxUW+RP58x1VFOt2461j4hIbeyAyrkcfw50Q5JwIiqj9t+efr/7N056gnmV5fZ+mb2nJ12/yweb3Md7MnzPyS/10qwNt3buotFmgx5NMJxDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794368390; c=relaxed/simple; bh=fMZwYPjCvsyUSmKfcdvFzVCiEiwaKK01DGYgiTHIKvM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=THkXOaGnkXxRiX8ap3HDSdApS/CniZtgsovbo9CaIEaihPRwdpSUJM99+RWBp/3TDDpoGxo1gOXXs91DXZWmzcv6P0VzZleexbhy4G6uywGZ6B+qZz7a8Ii1r4OSIp8xSV7z1pbFtdBX8nLxYqybfD2bAffCRNyULrCqfOsZ9yQ= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55EB44BA2E22 Received: from doobie (unknown [67.245.74.220]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4jPTmQ0BStz43Hg; Tue, 10 Nov 2026 22:39:50 -0500 (EST) Received: by doobie (Postfix, from userid 1000) id B194628E902A; Tue, 10 Nov 2026 22:39:49 -0500 (EST) From: Robert Dubner To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com Subject: [PATCH v3 2/2] gdb: Preserve subnormal values in target floating-point operations Date: Tue, 10 Nov 2026 22:39:38 -0500 Message-Id: <20261111033938.3306719-3-rdubner@symas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261111033938.3306719-1-rdubner@symas.com> References: <20261111033938.3306719-1-rdubner@symas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org The MPFR encoder can flush representable subnormal values to zero or encode their significands incorrectly. Encode subnormals with a zero exponent field and align their fractions to the minimum normal exponent. Discard the implicit leading bit only for normal values. Carry MPFR's ternary results through parsing, conversions, and arithmetic to avoid double rounding. Temporarily adjust the minimum exponent while rounding, restoring it afterward. Preserve flush-to-zero behavior for formats without subnormal support. Explain the subnormal boundary, minimum-exponent calculation, and significand scaling. Add unit tests covering both byte orders, exact subnormals, rounding boundaries, narrowing conversions, arithmetic, explicit integer bits, and restoration of MPFR's exponent range. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34927 --- gdb/target-float.c | 319 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 282 insertions(+), 37 deletions(-) diff --git a/gdb/target-float.c b/gdb/target-float.c index 836f79b8e31..e9d9e283a48 100644 --- a/gdb/target-float.c +++ b/gdb/target-float.c @@ -21,8 +21,13 @@ #include "floatformat.h" #include "target-float.h" #include "gdbarch.h" +#include "gdbsupport/scope-exit.h" #include "gdbsupport/selftest.h" +#if GDB_SELF_TEST +#include "arch-utils.h" +#endif + /* Target floating-point operations. We provide multiple implementations of those operations, which differ @@ -1219,10 +1224,12 @@ class mpfr_float_ops : public target_float_ops void from_target (const struct type *type, const gdb_byte *from, gdb_mpfr &to) const; + /* INEXACT is the MPFR ternary result of the computation producing FROM. + Carry it into subnormal rounding to avoid rounding twice. */ void to_target (const struct type *type, - const gdb_mpfr &from, gdb_byte *to) const; + const gdb_mpfr &from, gdb_byte *to, int inexact = 0) const; void to_target (const struct floatformat *fmt, - const gdb_mpfr &from, gdb_byte *to) const; + const gdb_mpfr &from, gdb_byte *to, int inexact = 0) const; }; @@ -1345,12 +1352,14 @@ mpfr_float_ops::from_target (const struct type *type, void mpfr_float_ops::to_target (const struct floatformat *fmt, - const gdb_mpfr &from, gdb_byte *orig_to) const + const gdb_mpfr &from, gdb_byte *orig_to, + int inexact) const { unsigned char *to = orig_to; mpfr_exp_t exponent; unsigned int mant_bits, mant_off; int mant_bits_left; + bool subnormal; enum floatformat_byteorders order = fmt->byteorder; unsigned char newto[FLOATFORMAT_LARGEST_BYTES]; @@ -1403,8 +1412,37 @@ mpfr_float_ops::to_target (const struct floatformat *fmt, { put_field (to, order, fmt->totalsize, fmt->sign_start, 1, 1); mpfr_neg (tmp.val, tmp.val, MPFR_RNDN); + inexact = -inexact; } + /* MPFR represents a nonzero finite value as M * 2^E, where + 0.5 <= abs (M) < 1. The smallest normal target value is + 2^(1 - exp_bias), so its MPFR exponent is 2 - exp_bias. + Smaller exponents (E + exp_bias <= 1) require subnormal rounding. + Formats without an infinity/NaN exponent do not support subnormals. */ + if (!mpfr_inf_p (tmp.val) && fmt->exp_nan != 0 + && mpfr_get_exp (tmp.val) + fmt->exp_bias <= 1) + { + mpfr_exp_t saved_emin = mpfr_get_emin (); + SCOPE_EXIT + { + mpfr_set_emin (saved_emin); + }; + + /* With precision P, the least subnormal is + 2^(1 - exp_bias - (P - 1)). MPFR's exponent is one greater + than the power of two, giving emin = 3 - exp_bias - P. + Restrict the range only while rounding: the encoding below needs + intermediates outside the target's range (e.g. for binary16). + Use the operation's ternary result to avoid double rounding. */ + mpfr_set_emin (3 - fmt->exp_bias - floatformat_precision (fmt)); + inexact = mpfr_check_range (tmp.val, inexact, MPFR_RNDN); + mpfr_subnormalize (tmp.val, inexact, MPFR_RNDN); + } + + if (mpfr_zero_p (tmp.val)) + goto finalize_byteorder; + if (mpfr_inf_p (tmp.val)) /* Result is Infinity. */ { /* Infinity exponent is same as NaN's. */ @@ -1418,14 +1456,28 @@ mpfr_float_ops::to_target (const struct floatformat *fmt, mpfr_frexp (&exponent, tmp.val, tmp.val, MPFR_RNDN); - if (exponent + fmt->exp_bias <= 0) - { - /* The value is too small to be expressed in the destination - type (not enough bits in the exponent. Treat as 0. */ - put_field (to, order, fmt->totalsize, fmt->exp_start, - fmt->exp_len, 0); - put_field (to, order, fmt->totalsize, fmt->man_start, - fmt->man_len, 0); + /* Test to see if the value is subnormal after it was rounded. For example, + a value halfway between the largest subnormal and the smallest normal + tests as subnormal up above, but after rounding will test as normal + here. So this second test has to be done.*/ + subnormal = fmt->exp_nan != 0 && exponent + fmt->exp_bias <= 1; + if (subnormal) + { + /* Subnormals use the minimum normal exponent, but have no leading + one. Scale the fraction returned by mpfr_frexp to that exponent, + leaving the leading zero explicit, even for formats with an + implicit integer bit. The loop below extracts successive 32-bit + chunks of this fraction. An explicit integer bit occupies its + first bit, so shift one place further right for those formats. */ + mpfr_mul_2si (tmp.val, tmp.val, + exponent + fmt->exp_bias + - (fmt->intbit == floatformat_intbit_no ? 1 : 2), + MPFR_RNDN); + } + else if (exponent + fmt->exp_bias <= 0) + { + /* Formats without subnormals flush values that are too small to + represent to zero. The exponent and mantissa are already zero. */ goto finalize_byteorder; } @@ -1441,7 +1493,7 @@ mpfr_float_ops::to_target (const struct floatformat *fmt, } put_field (to, order, fmt->totalsize, fmt->exp_start, fmt->exp_len, - exponent + fmt->exp_bias - 1); + subnormal ? 0 : exponent + fmt->exp_bias - 1); mant_bits_left = fmt->man_len; mant_off = fmt->man_start; @@ -1455,11 +1507,8 @@ mpfr_float_ops::to_target (const struct floatformat *fmt, mant_long = mpfr_get_ui (tmp.val, MPFR_RNDZ) & 0xffffffffL; mpfr_sub_ui (tmp.val, tmp.val, mant_long, MPFR_RNDZ); - /* If the integer bit is implicit, then we need to discard it. - If we are discarding a zero, we should be (but are not) creating - a denormalized number which means adjusting the exponent - (I think). */ - if (mant_bits_left == fmt->man_len + /* Only normal values have an implicit leading one to discard. */ + if (!subnormal && mant_bits_left == fmt->man_len && fmt->intbit == floatformat_intbit_no) { mant_long <<= 1; @@ -1496,12 +1545,13 @@ mpfr_float_ops::to_target (const struct floatformat *fmt, void mpfr_float_ops::to_target (const struct type *type, - const gdb_mpfr &from, gdb_byte *to) const + const gdb_mpfr &from, gdb_byte *to, + int inexact) const { /* Ensure possible padding bytes in the target buffer are zeroed out. */ memset (to, 0, type->length ()); - to_target (floatformat_from_type (type), from, to); + to_target (floatformat_from_type (type), from, to, inexact); } /* Convert the byte-stream ADDR, interpreted as floating-point type TYPE, @@ -1559,13 +1609,13 @@ mpfr_float_ops::from_string (gdb_byte *addr, gdb_mpfr tmp (type); char *endptr; - mpfr_strtofr (tmp.val, in.c_str (), &endptr, 0, MPFR_RNDN); + int inexact = mpfr_strtofr (tmp.val, in.c_str (), &endptr, 0, MPFR_RNDN); /* We only accept the whole string. */ if (*endptr) return false; - to_target (type, tmp, addr); + to_target (type, tmp, addr, inexact); return true; } @@ -1588,8 +1638,8 @@ mpfr_float_ops::from_longest (gdb_byte *addr, LONGEST val) const { gdb_mpfr tmp (type); - mpfr_set_sj (tmp.val, val, MPFR_RNDN); - to_target (type, tmp, addr); + int inexact = mpfr_set_sj (tmp.val, val, MPFR_RNDN); + to_target (type, tmp, addr, inexact); } /* Convert unsigned integer VAL to a target floating-number of type TYPE @@ -1600,8 +1650,8 @@ mpfr_float_ops::from_ulongest (gdb_byte *addr, ULONGEST val) const { gdb_mpfr tmp (type); - mpfr_set_uj (tmp.val, val, MPFR_RNDN); - to_target (type, tmp, addr); + int inexact = mpfr_set_uj (tmp.val, val, MPFR_RNDN); + to_target (type, tmp, addr, inexact); } /* Convert the byte-stream ADDR, interpreted as floating-point type TYPE, @@ -1623,8 +1673,8 @@ mpfr_float_ops::from_host_double (gdb_byte *addr, double val) const { gdb_mpfr tmp (type); - mpfr_set_d (tmp.val, val, MPFR_RNDN); - to_target (type, tmp, addr); + int inexact = mpfr_set_d (tmp.val, val, MPFR_RNDN); + to_target (type, tmp, addr, inexact); } /* Convert a floating-point number of type FROM_TYPE from the target @@ -1638,8 +1688,8 @@ mpfr_float_ops::convert (const gdb_byte *from, { gdb_mpfr from_tmp (from_type), to_tmp (to_type); from_target (from_type, from, from_tmp); - mpfr_set (to_tmp.val, from_tmp.val, MPFR_RNDN); - to_target (to_type, to_tmp, to); + int inexact = mpfr_set (to_tmp.val, from_tmp.val, MPFR_RNDN); + to_target (to_type, to_tmp, to, inexact); } /* Perform the binary operation indicated by OPCODE, using as operands the @@ -1657,34 +1707,35 @@ mpfr_float_ops::binop (enum exp_opcode op, from_target (type_x, x, x_tmp); from_target (type_y, y, y_tmp); + int inexact; switch (op) { case BINOP_ADD: - mpfr_add (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_add (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_SUB: - mpfr_sub (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_sub (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_MUL: - mpfr_mul (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_mul (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_DIV: - mpfr_div (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_div (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_EXP: - mpfr_pow (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_pow (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_MIN: - mpfr_min (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_min (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; case BINOP_MAX: - mpfr_max (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); + inexact = mpfr_max (tmp.val, x_tmp.val, y_tmp.val, MPFR_RNDN); break; default: @@ -1692,7 +1743,7 @@ mpfr_float_ops::binop (enum exp_opcode op, break; } - to_target (type_res, tmp, res); + to_target (type_res, tmp, res, inexact); } /* Compare the two target byte streams X and Y, interpreted as floating-point @@ -2576,6 +2627,194 @@ put_field_test () SELF_CHECK (data[6] == 0x34); } } +/* Exercise the MPFR implementation directly, independently of the host's + floating-point formats. Each pair contains big- and little-endian + forms. */ + +static const floatformat *const subnormal_formats[][2] = + { + {&floatformat_ieee_half_big, &floatformat_ieee_half_little}, + {&floatformat_ieee_single_big, &floatformat_ieee_single_little}, + {&floatformat_ieee_double_big, &floatformat_ieee_double_little}, + {&floatformat_ieee_quad_big, &floatformat_ieee_quad_little} + }; + +static type * +subnormal_type (const floatformat *fmt) +{ + /* Supply FMT in both slots so it can be selected independently of the + architecture's byte order. init_float_type retains only that format. */ + const floatformat *pair[] = {fmt, fmt}; + type_allocator alloc (get_current_arch ()); + return init_float_type (alloc, -1, "selftest_float", pair, BFD_ENDIAN_BIG); +} + +/* Encode integer BITS independently of the floating-point encoder. */ + +static std::vector +subnormal_bytes (const gdb_mpz &bits, const type *ftype) +{ + std::vector bytes (ftype->length ()); + bfd_endian order = + (floatformat_from_type (ftype)->byteorder == floatformat_big + ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE); + bits.write (bytes, order, true); + return bytes; +} + +/* Spell COEFFICIENT * 2^EXPONENT exactly, without host floating-point + math. */ + +static std::string +subnormal_string (const gdb_mpz &coefficient, int exponent) +{ + return coefficient.hex () + "p" + std::to_string (exponent); +} + +/* Check exact subnormals, text round trips, byte-order conversion, and the + boundary between normal and subnormal arithmetic. */ + +static void +subnormal_test () +{ + mpfr_float_ops ops; + for (const auto &formats : subnormal_formats) + for (int endian = 0; endian < 2; ++endian) + { + const floatformat *fmt = formats[endian]; + type *ftype = subnormal_type (fmt); + type *opposite = subnormal_type (formats[1 - endian]); + int quantum = 1 - fmt->exp_bias - (int) fmt->man_len; + gdb_mpz normal = gdb_mpz (1) << fmt->man_len; + gdb_mpz sign = gdb_mpz (1) << (fmt->totalsize - 1); + for (const gdb_mpz &magnitude : {gdb_mpz (1), gdb_mpz (2), + normal - gdb_mpz (1), normal}) + for (bool negative : {false, true}) + { + gdb_mpz bits = negative ? magnitude | sign : magnitude; + auto expected = subnormal_bytes (bits, ftype); + std::vector actual (ftype->length ()); + std::string text = subnormal_string (magnitude, quantum); + if (negative) + text.insert (0, "-"); + SELF_CHECK (ops.from_string (actual.data (), ftype, text)); + SELF_CHECK (actual == expected); + text = ops.to_string (expected.data (), ftype, nullptr); + SELF_CHECK (ops.from_string (actual.data (), ftype, text)); + SELF_CHECK (actual == expected); + ops.convert (expected.data (), ftype, actual.data (), opposite); + SELF_CHECK (actual == subnormal_bytes (bits, opposite)); + } + + auto least = subnormal_bytes (gdb_mpz (1), ftype); + auto largest = subnormal_bytes (normal - gdb_mpz (1), ftype); + auto minimum = subnormal_bytes (normal, ftype); + std::vector actual (ftype->length ()); + ops.binop (BINOP_SUB, minimum.data (), ftype, least.data (), ftype, + actual.data (), ftype); + SELF_CHECK (actual == largest); + ops.binop (BINOP_ADD, largest.data (), ftype, least.data (), ftype, + actual.data (), ftype); + SELF_CHECK (actual == minimum); + } +} + +/* Test halfway values and both sides of each tie, including digits lost by + rounding to normal precision before subnormal rounding. Expected results + follow round-to-nearest, ties-to-even, without using MPFR as an oracle. */ + +static void +subnormal_rounding_test () +{ + mpfr_float_ops ops; + mpfr_exp_t saved_emin = mpfr_get_emin (), saved_emax = mpfr_get_emax (); + type *wide = subnormal_type (&floatformat_ieee_quad_big); + for (const auto &formats : subnormal_formats) + for (const floatformat *fmt : formats) + { + type *ftype = subnormal_type (fmt); + int quantum = 1 - fmt->exp_bias - (int) fmt->man_len; + int tail = fmt->man_len + 9; + gdb_mpz normal = gdb_mpz (1) << fmt->man_len; + gdb_mpz sign = gdb_mpz (1) << (fmt->totalsize - 1); + for (const gdb_mpz &lower : {gdb_mpz (0), gdb_mpz (1), gdb_mpz (2), + normal - gdb_mpz (1)}) + for (int side : {-1, 0, 1}) + for (bool negative : {false, true}) + { + gdb_mpz coefficient = ((lower * gdb_mpz (2) + 1) << (tail - 1)) + + gdb_mpz (side); + gdb_mpz expected = lower; + if (side > 0 || (side == 0 && (lower & gdb_mpz (1)) == 1)) + expected += 1; + if (negative) + expected = expected | sign; + auto bytes = subnormal_bytes (expected, ftype); + std::string text + = subnormal_string (coefficient, quantum - tail); + if (negative) + text.insert (0, "-"); + std::vector actual (ftype->length ()); + SELF_CHECK (ops.from_string (actual.data (), ftype, text)); + SELF_CHECK (actual == bytes); + + /* Binary128 represents these binary16/32/64 cases exactly. + Check the ternary result from narrowing and each operation, + as well as parsing directly at the destination + precision. */ + if (fmt->man_len < floatformat_ieee_quad_big.man_len) + { + std::vector source (wide->length ()); + SELF_CHECK (ops.from_string (source.data (), wide, text)); + ops.convert (source.data (), wide, actual.data (), ftype); + SELF_CHECK (actual == bytes); + for (exp_opcode op : {BINOP_ADD, BINOP_SUB, BINOP_MUL, + BINOP_DIV, BINOP_EXP, BINOP_MIN, + BINOP_MAX}) + { + std::vector right (wide->length ()); + LONGEST rhs = op == BINOP_ADD || op == BINOP_SUB ? 0 + : op == BINOP_MAX ? -1 : 1; + ops.from_longest (right.data (), wide, rhs); + ops.binop (op, source.data (), wide, right.data (), + wide, actual.data (), ftype); + SELF_CHECK (actual == bytes); + } + } + SELF_CHECK (mpfr_get_emin () == saved_emin); + SELF_CHECK (mpfr_get_emax () == saved_emax); + } + } +} + +/* Also check encoding with explicit integer bits and preserve the existing + flush-to-zero policy of formats without subnormal support. */ + +static void +subnormal_other_formats_test () +{ + mpfr_float_ops ops; + for (const floatformat *fmt : {&floatformat_i387_ext}) + { + type *ftype = subnormal_type (fmt); + std::vector actual (ftype->length ()); + std::vector expected (ftype->length ()); + expected[fmt->byteorder == floatformat_little ? 0 : 11] = 1; + int quantum = 2 - fmt->exp_bias - floatformat_precision (fmt); + SELF_CHECK (ops.from_string (actual.data (), ftype, + subnormal_string (gdb_mpz (1), quantum))); + SELF_CHECK (actual == expected); + } + + type *ftype = subnormal_type (&floatformat_vax_f); + std::vector actual (ftype->length ()); + std::vector zero (ftype->length ()); + SELF_CHECK (ops.from_string (actual.data (), ftype, "0x1p-200")); + SELF_CHECK (actual == zero); + SELF_CHECK (ops.from_string (actual.data (), ftype, "0.125")); + SELF_CHECK (actual == std::vector ({0, 0x3f, 0, 0})); +} + } /* namespace selftests */ #endif /* GDB_SELF_TEST */ @@ -2584,5 +2823,11 @@ INIT_GDB_FILE (target_float) #if GDB_SELF_TEST selftests::register_test ("target-float-put-field", selftests::put_field_test); + selftests::register_test ("target-float-subnormal", + selftests::subnormal_test); + selftests::register_test ("target-float-subnormal-rounding", + selftests::subnormal_rounding_test); + selftests::register_test ("target-float-subnormal-other-formats", + selftests::subnormal_other_formats_test); #endif } -- 2.34.1