mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
base: add bitvec256 type
This commit is contained in:
1 parent
310f5011b5
commit
e0636e3255
7 files changed
+62
No files matched your search
@@ -1091,6 +1091,27 @@ wuffs_base__multiply_u64(uint64_t x, uint64_t y) {
|
||||
|
||||
// --------
|
||||
|
||||
typedef struct wuffs_base__bitvec256__struct {
|
||||
// elements_u64[0] holds the LSBs (least significant bits) and
|
||||
// elements_u64[3] holds the MSBs (most significant bits).
|
||||
uint64_t elements_u64[4];
|
||||
} wuffs_base__bitvec256;
|
||||
|
||||
static inline wuffs_base__bitvec256 //
|
||||
wuffs_base__make_bitvec256(uint64_t e00,
|
||||
uint64_t e01,
|
||||
uint64_t e02,
|
||||
uint64_t e03) {
|
||||
wuffs_base__bitvec256 res;
|
||||
res.elements_u64[0] = e00;
|
||||
res.elements_u64[1] = e01;
|
||||
res.elements_u64[2] = e02;
|
||||
res.elements_u64[3] = e03;
|
||||
return res;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
// The "defined(__clang__)" isn't redundant. While vanilla clang defines
|
||||
// __GNUC__, clang-cl (which mimics MSVC's cl.exe) does not.
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && (__SIZEOF_LONG__ == 8)
|
||||
@@ -13758,6 +13779,9 @@ wuffs_base__u64__sat_sub_indirect(uint64_t* x, uint64_t y) {
|
||||
#define wuffs_base__utility__sign_extend_rshift_u64(a, n) \
|
||||
((uint64_t)(((int64_t)(a)) >> (n)))
|
||||
|
||||
#define wuffs_base__utility__make_bitvec256(e00, e01, e02, e03) \
|
||||
wuffs_base__make_bitvec256(e00, e01, e02, e03)
|
||||
|
||||
// ---------------- Slices and Tables
|
||||
|
||||
// wuffs_base__slice_u8__prefix returns up to the first up_to bytes of s.
|
||||
|
||||
Reference in new issue
Block a user