On 1/1/25 2:16 PM, Keith Packard wrote:
I thought I had sent all of my m68k soft float fixes along last year, but it looks like I managed to leave some out. I had been building my toolchain from a private repo (oops), which masked my mistake. We're fixing that by automatically building toolchains from upstream source with a list of patches now, so this "shouldn't" happen again. Now to drive that list of patches to zero. 0001-libgcc-m68k-Fixes-for-soft-float.patch From 1a3e403603f5a687724c7e2f6625debc3d23d934 Mon Sep 17 00:00:00 2001 From: Keith Packard<kei...@keithp.com> Date: Sun, 29 Dec 2024 01:42:29 -0800 Subject: [PATCH] libgcc/m68k: Fixes for soft float Fix __extenddfxf2: * Remove bogus denorm handling block which would never execute -- the converted exp value is always positive as EXCESSX > EXCESSD. * Compute the whole significand in dl instead of doing part of it in ldl. * Mask off exponent from dl.l.upper so the denorm shift test works. * Insert the hidden one bit into dl.l.upper as needed. Fix __truncxfdf2 denorm handling. All that is required is to shift the significand right by the correct amount; it already has all of the necessary bits set including the explicit one. Compute the shift amount, then perform the wide shift across both elements of the significand. Fix __fixxfsi: * The value was off by a factor of two as the significand contains 32 bits, not 31 so we need to shift by one more than the equivalent code in __fixdfsi. * Simplify the code having realized that the lower 32 bits of the significand can never appear in the results. Return positive qNaN instead of negative. For floats, qNaN is 0x7fff_ffff. For doubles, qNaN is 0x7fff_ffff_ffff_ffff. Return correctly signed zero on float and double divide underflow. This means that Ld$underflow now expects d7 to contain the sign bit, just like the other return paths. Signed-off-by: Keith Packard<kei...@keithp.com>
Thanks. I pushed this to the trunk. jeff