|
Message-ID: <20200320181250.GC11469@brightrain.aerifal.cx> Date: Fri, 20 Mar 2020 14:12:50 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: Q: dealing with missing removal of excess precision On Sun, Feb 23, 2020 at 07:14:08PM +0300, Alexander Monakov wrote: > On Sat, 22 Feb 2020, Rich Felker wrote: > > > I'm not well acquainted with SSE, and only so-so with x87, so pretty > > much I'm reading them for higher-level issues with tooling > > compatibility (like the concerns I already raised and looked up and > > seem to have resolved about x87 constraints and non-GCC compilers) and > > logic, then planning to apply and test them. I think being aware of > > non-obvious mistake modes that have already been found would be a lot > > more useful than staring at things, especially if the bugs you've > > found are in subtleties of the insn behavior or constraint behavior. > > Okay, thanks. I found two issues: > > 1. i386 lrint* functions mistakenly used fistpll instead of fistpl (I > posted the fix for x32 asm after noticing my own mistake). > > 2. Some functions bind a 32-bit lvalue as output for fnstsw %ax, which > as the operand says writes only 16 bits. They should be changed to either > use a 16-bit lvalue, or a zero-initialized 32-bit lvalue with "+a" constraint. > > Plus, not bugs, but still worth mentioning: > > 3. The new remquol in C could alternatively be implemented by using fxam > to extract sign bits instead of loading them from stack slots. The current > approach makes sense given the ABI, but an implementation aiming for better > code after inlining could choose to use fxam instead of forcing a spill. > > 4. I did not manage to find a copy of Figueroa's "When is double rounding > innocuous", but I could cite e.g. "Innocuous Double Rounding of Basic > Arithmetic Operations" by Pierre Roux instead (in i386/sqrtf.c). > > If you like you can fetch a Git tree with my patches from > > https://git.sr.ht/~amonakov/musl > > (issue 1 is already corrected in that repo) Hi. I'm trying to catch up on this and other patches after being sick and not getting much done for a while. Is there anything else I should be aware of before going forward with these? One minor cosmetic change I'd like to make to commit names if you don't object is changing "x86-family" to "x87-family" for the commits that are "i386 + long double functions on x86_64" since I found it confusing when there's one commit for "x86 family" then a separate one for x86_64 versions of the same function. Let me know if you think of any alternative that might be more clear than "x87" Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.