mailing list of musl libc
 help / color / mirror / code / Atom feed
a34f4ce8b28d00fd9b308da655bc41348def144d blob 449 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 
#include "libm.h"

double sqrt(double x)
{
	union ldshape ux;
	unsigned short fpsr;
	__asm__ ("fsqrt; fnstsw %%ax": "=t"(ux.f), "=a"(fpsr) : "0"(x));
	if ((ux.i.m & 0x7ff) != 0x400)
		return (double)ux.f;
	/* Rounding to double would have encountered an exact halfway case.
	   Adjust mantissa downwards if fsqrt rounded up, else upwards.
	   (result of fsqrt could not have been exact) */
	ux.i.m ^= (fpsr & 0x200) + 0x300;
	return (double)ux.f;
}
debug log:

solving a34f4ce8 ...
found a34f4ce8 in https://inbox.vuxu.org/musl/20200322011958.GM11469@brightrain.aerifal.cx/
found 934fbcca in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 934fbccab82c993b51b9ee0d81b19826f73f56ff	src/math/i386/sqrt.c

applying [1/1] https://inbox.vuxu.org/musl/20200322011958.GM11469@brightrain.aerifal.cx/
diff --git a/src/math/i386/sqrt.c b/src/math/i386/sqrt.c
index 934fbcca..a34f4ce8 100644

Checking patch src/math/i386/sqrt.c...
Applied patch src/math/i386/sqrt.c cleanly.

index at:
100644 a34f4ce8b28d00fd9b308da655bc41348def144d	src/math/i386/sqrt.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).