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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
#include <fenv.h>
#define KVX_SFR_CS 4
#define EMPTY_MASK 0

static inline void set_clr_cs(int setmask, int clrmask)
{
	__builtin_kvx_wfxl(KVX_SFR_CS, ((long long)setmask << 32) | clrmask);
}

int feclearexcept(int excepts)
{
	excepts &= FE_ALL_EXCEPT;
	set_clr_cs(EMPTY_MASK, excepts);
	return 0;
}

int feraiseexcept(int excepts)
{
	excepts &= FE_ALL_EXCEPT;
	set_clr_cs(excepts, EMPTY_MASK);
	return 0;
}

int fetestexcept(int excepts)
{
	fexcept_t flags;
	excepts &= FE_ALL_EXCEPT;
	flags = __builtin_kvx_get(KVX_SFR_CS);
	return (flags & excepts);
}

int fegetround(void)
{
	fenv_t rm;
	rm = __builtin_kvx_get(KVX_SFR_CS);
	return rm & FE_RND_MASK;
}

int __fesetround(int r)
{
	r &= FE_RND_MASK;
	set_clr_cs(r, FE_RND_MASK);
	return 0;
}

int fegetenv(fenv_t *envp)
{
	fenv_t fe;
	fe = __builtin_kvx_get(KVX_SFR_CS);
	*envp = (fe & (FE_ALL_EXCEPT | FE_RND_MASK));
	return 0;
}

int fesetenv(const fenv_t *envp)
{
	fenv_t fe = (envp != FE_DFL_ENV ? *envp : 0);
	fe &= (FE_ALL_EXCEPT | FE_RND_MASK);
	set_clr_cs(fe, FE_ALL_EXCEPT | FE_RND_MASK);
	return 0;
}
debug log:

solving aca9dd9c ...
found aca9dd9c in https://inbox.vuxu.org/musl/20220711152322.23418-1-jborne@kalray.eu/

applying [1/1] https://inbox.vuxu.org/musl/20220711152322.23418-1-jborne@kalray.eu/
diff --git a/src/fenv/kvx/fenv.c b/src/fenv/kvx/fenv.c
new file mode 100644
index 00000000..aca9dd9c

Checking patch src/fenv/kvx/fenv.c...
Applied patch src/fenv/kvx/fenv.c cleanly.

index at:
100644 aca9dd9c9fe1fa870f66b231c9b539bdee614c46	src/fenv/kvx/fenv.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).