mailing list of musl libc
 help / color / mirror / code / Atom feed
f6a029349b23a0815c94dbac9a7b605c2b5c60fe blob 1869 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
 
#include <features.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>

typedef union uwide128 uwide128;
union uwide128 {
	uint64_t v64[2];
	uint32_t v32[4];
};

#define word64(X) (__BYTE_ORDER == __LITTLE_ENDIAN ? (X) : (2-(X)))
#define lo64 word64(0)
#define hi64 word64(1)

#define word32(X) (__BYTE_ORDER == __LITTLE_ENDIAN ? (X) : (4-(X)))
#define wo32_0 word32(0)
#define wo32_1 word32(1)
#define wo32_2 word32(2)
#define wo32_3 word32(3)


#define comp2(LO, HI) { { [lo64] = (LO), [hi64] = (HI), }, }

#if __STDC_VERSION__ >= 202311L
constexpr uwide128 __uwide128_max = { -1, -1, };
#define UWIDE128_MAX __uwide128_max
#else
#define UWIDE128_MAX ((void)0, (uwide128)comp2(-1, -1))
#endif

static __inline uwide128 __uwide128_i64(int64_t a)  __unsequenced;
static __inline uwide128 __uwide128_u64(uint64_t a) __unsequenced;

static __inline uwide128 __uwide128_i64(int64_t a)
{
	return (uwide128)comp2(a, (a < 0) ? UINT64_MAX : 0);
}

static __inline uwide128 __uwide128_u64(uint64_t a)
{
	return (uwide128)comp2(a, 0);
}

_Bool __uwide128_le(uwide128, uwide128)    __unsequenced; // intscan
_Bool __uwide128_iszero(uwide128)          __unsequenced; // vfprintf
uwide128 __uwide128_neg(uwide128)          __unsequenced; // intscan
uwide128 __uwide128_add(uwide128, uint8_t) __unsequenced; // intscan
uwide128 __uwide128_sub(uwide128, uint8_t) __unsequenced; // intscan
uwide128 __uwide128_mul(uwide128, uint8_t) __unsequenced; // intscan
uint8_t __uwide128_div10(uwide128*);           // vfprintf
uint8_t __uwide128_div2(uwide128*);            // vfprintf
uint8_t __uwide128_div8(uwide128*);            // vfprintf
uint8_t __uwide128_div16(uwide128*);           // vfprintf
uwide128 __uwide128_pop(va_list *ap);          // vfprintf
uwide128 __uwide128_i64(int64_t);              // vfprintf
uwide128 __uwide128_u64(uint64_t);             // vfprintf
debug log:

solving f6a02934 ...
found f6a02934 in https://inbox.vuxu.org/musl/04d1def74188d4783389363c4a3a0e1d942d7e36.1685536608.git.Jens.Gustedt@inria.fr/

applying [1/1] https://inbox.vuxu.org/musl/04d1def74188d4783389363c4a3a0e1d942d7e36.1685536608.git.Jens.Gustedt@inria.fr/
diff --git a/src/internal/uwide128.h b/src/internal/uwide128.h
new file mode 100644
index 00000000..f6a02934

Checking patch src/internal/uwide128.h...
Applied patch src/internal/uwide128.h cleanly.

index at:
100644 f6a029349b23a0815c94dbac9a7b605c2b5c60fe	src/internal/uwide128.h

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).