mailing list of musl libc
 help / color / mirror / code / Atom feed
8da3c65a044eb6031fb67730d4d20e36294185db blob 343 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
#include <math.h>

#if __riscv_flen >= 32

float roundf(float x)
{
	if (isnan(x)) return x;
	if (x == INFINITY || x == -INFINITY) return x;
	float tmp;
	long n;
	__asm__ ("fcvt.w.s %0, %1, rmm" : "=r"(n) : "f"(x));
	__asm__ ("fcvt.s.w %0, %1" : "=f"(tmp) : "r"(n));
	x = copysign(tmp, x);		
	return x;
}

#else

#include "../roundf.c"

#endif
debug log:

solving 8da3c65a ...
found 8da3c65a in https://inbox.vuxu.org/musl/20240612090018.258573-2-mzh@mzh.io/

applying [1/1] https://inbox.vuxu.org/musl/20240612090018.258573-2-mzh@mzh.io/
diff --git a/src/math/riscv64/roundf.c b/src/math/riscv64/roundf.c
new file mode 100644
index 00000000..8da3c65a

1:19: trailing whitespace.
	x = copysign(tmp, x);		
Checking patch src/math/riscv64/roundf.c...
Applied patch src/math/riscv64/roundf.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 8da3c65a044eb6031fb67730d4d20e36294185db	src/math/riscv64/roundf.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).