21135 Commits

Author SHA1 Message Date
Stevie Hryciw
ca9e1760e8 fmt: canonicalize identifiers 2022-11-18 19:22:42 +00:00
Stevie Hryciw
d6d4f2481d translate-c: use .identifier tokens in .identifier AST nodes 2022-11-18 19:22:42 +00:00
Stevie Hryciw
be737bb5cc stage1: delete keywords
Backports 05cf449 to the C++ implementation.
2022-11-18 19:22:42 +00:00
remeh
e7424d5d2a std.array_list: add a comment on every methods invalidating pointers.
While it is already mentioned on the `items` attributes of the structs, it is
interesting to comment in every method potentially invalidating pointers to items
that they may do so.
2022-11-18 14:49:31 +02:00
Veikka Tuominen
3c0c0f899b
Merge pull request #13417 from InKryption/rand-deterministic-indexing
std.Random: add functions with explicit index type
2022-11-18 14:48:51 +02:00
Veikka Tuominen
8082323dfd
Merge pull request #13411 from dweiller/custom-test-runner
Custom test runner
2022-11-18 14:47:21 +02:00
Stevie Hryciw
5f6f38ff31 std.math.big.int: implement popCount() for Const 2022-11-18 14:31:30 +02:00
Guillaume Wenzek
5221c90164
add C ABI tests with double
const DC = extern struct { v1: f64, v2: u8 };
const CFF = extern struct { v1: u8, v2: f32, v3: f32 };
const PD = extern struct { v1: ?*anyopaque, v2: f64 };

Signed-off-by: Guillaume Wenzek <gwenzek@users.noreply.github.com>
2022-11-18 14:05:25 +02:00
Andrew Kelley
6c931c32bb
Merge pull request #13579 from jedisct1/ghash-fix-wasm32 2022-11-18 04:17:35 -05:00
Frank Denis
4dd061a7ac ghash: handle the .hi_lo case when no CLMUL acceleration is present, too 2022-11-17 23:54:21 +01:00
Frank Denis
3051e279a5 Reapply "std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs (#13566)"
This reapplies commit 72d3f4b5dc0dda9fd0a048c2391f03604f4b30ac.
2022-11-17 23:52:58 +01:00
Andrew Kelley
72d3f4b5dc Revert "std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs (#13566)"
This reverts commit 7cfeae1ce7aa9f1b3a219d032c43bc2e694ba63b which
is causing std lib tests to fail on wasm32-wasi.
2022-11-17 15:37:37 -07:00
kcbanner
88a0f3d0e5 windows: fix _tls_index not being defined if libc wasn't linked, and fix x86 name mangling 2022-11-17 11:08:21 -05:00
Frank Denis
7cfeae1ce7
std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs (#13566)
* std.crypto.onetimeauth.ghash: faster GHASH on modern CPUs

Carryless multiplication was slow on older Intel CPUs, justifying
the need for using Karatsuba multiplication.

This is not the case any more; using 4 multiplications to multiply
two 128-bit numbers is actually faster than 3 multiplications +
shifts and additions.

This is also true on aarch64.

Keep using Karatsuba only when targeting x86 (granted, this is a bit
of a brutal shortcut, we should really list all the CPU models that
had a slow clmul instruction).

Also remove useless agg_2 treshold and restore the ability to
precompute only H and H^2 in ReleaseSmall.

Finally, avoid using u256. Using 128-bit registers is actually faster.

* Use a switch, add some comments
2022-11-17 13:07:07 +01:00
Jonathan Marler
58d9004cea packed struct fix example and clarify least to most significant ordering
The packed struct example was mistakenly applying endianness where it
shouldn't have been.  This wasn't being caught because we don't currently
test the examples on Big-endian systems.

I updated the test to remove the endianness where it didn't apply, and
added a new part of the test to demonstrate when it would apply.
2022-11-17 12:11:43 +02:00
Björn Linse
a09a5ad574 stdlib: make linux.PERF.TYPE non-exhaustive
perf_event_attr.type needs to take a runtime defined value to enable
dynamic PMU:s, such as kprobe and uprobe. This value can exceed
predefined values defined in the linux headers.

reference: perf_event_open(2) man page
2022-11-16 19:02:24 -05:00
Eric Joldasov
3c3def6ac2 process.zig: remove unused function getSelfExeSharedLibPaths 2022-11-16 18:51:11 -05:00
Guillaume Wenzek
699e7f721b fix Nvptx backend outputing files at the top level of zig-cache 2022-11-16 18:49:04 -05:00
Andrew Kelley
07671838b0
Merge pull request #13561 from jacobly0/gcc-warnings 2022-11-16 10:38:44 -05:00
Eric Joldasov
684264908e compiler_rt: fix TODOs in udivmod.zig 2022-11-16 13:08:41 +02:00
Veikka Tuominen
eed82ca287
Merge pull request #13558 from Vexu/stage2-fixes
Stage2 bug fixes to get third party projects building
2022-11-16 12:56:51 +02:00
Jacob Young
3ae04ed949 cbe: fix identifiers colliding with the short keyword 2022-11-16 01:26:37 -05:00
Jacob Young
a9c005e0e4 cbe: fixed tagged union initializers of a zero-bit field type
Fixes missing braces warnings on gcc 11.3.0.
2022-11-15 23:33:48 -05:00
Jacob Young
b82aec5a15 cbe: fix indexing with a zero-bit element type
Fixes void dereference warnings on gcc 11.3.0.
2022-11-15 23:33:48 -05:00
Jacob Young
b5b507a742 zig.h: match float comparison signatures from compiler rt 2022-11-15 23:33:48 -05:00
mike
a93fa29d8f zig-cache: support windows drive + fwd-slash paths
closes #13539
2022-11-15 22:12:52 -05:00
Veikka Tuominen
28cbe5e92a Sema+llvm: improve handling of namespace-like unions
Closes #13557
2022-11-16 01:13:35 +02:00
Veikka Tuominen
fe6249348f Sema: ensure comptime reference to function points to original decl
This prevents sema from creating new decls for the functions and
passing them to the backends as non-function decls.

Closes #12501
2022-11-16 01:12:54 +02:00
Veikka Tuominen
fb09093d95 Module: call ensureDeclAnalyzed on builtin.test_functions
Previously the compiler would crash on branching on undefined values
if you tried using `zig test` with a freestanding target since there
was no start code referencing `builtin.test_functions`.

Closes #12554
2022-11-16 01:12:28 +02:00
Veikka Tuominen
2cfa7165e7 Sema: do not re-evaluate type of non-generic inline call parameters
Closes #13491
2022-11-16 01:12:27 +02:00
Veikka Tuominen
b6b3462796 std.mem.Allocator: do not return undefined pointers from create
Closes #13517
2022-11-16 01:12:27 +02:00
Veikka Tuominen
11c64bfe6e llvm: implement arbitrary precision debug enumerators
Closes #645
2022-11-16 01:12:27 +02:00
GethDW
024bac7f53 std.build: fix typo
This would only fail to compile when building *on* WASI.
2022-11-15 23:23:27 +02:00
mparadinha
c4f7663c92
Fix error reporting the wrong line for struct field inits (#13502)
* point to init part of field delc when that's where the error occurs

* update test to reflect fixed error message

* only lookup source location in case of error
2022-11-15 15:17:23 +02:00
Hayden Pope
ceb9fedb47 std.os.linux: Add setitimer and getitimer syscalls 2022-11-15 02:38:28 -05:00
Andrew Kelley
14986077ce CI: disable github workflows until it is working in the ci branch 2022-11-14 17:40:44 -07:00
Andrew Kelley
a50ad04e85 disable failing test on aarch64-macos 2022-11-14 16:07:52 -07:00
Andrew Kelley
5d7efa6d82 CI: aarch64-linux: init 2022-11-14 16:04:01 -07:00
Andrew Kelley
e14d135881 macos: x86_64: fix wrong path to cmake 2022-11-14 15:17:41 -07:00
Andrew Kelley
27e63bb59f CI: aarch64-macos: set PATH env var for cmake 2022-11-14 15:15:12 -07:00
Andrew Kelley
37402e4d17 CI: separate aarch64 and x86_64 macos scripts 2022-11-14 15:10:05 -07:00
Loris Cro
bbd0775d77 ci: init github actions support 2022-11-14 22:41:36 +01:00
Frank Denis
7eed028f9a
crypto.bcrypt: fix massive speed regression when using stage2 (#13518)
state: State -> state: *const State
Suggested by @nektro

Fixes #13510
2022-11-14 16:37:19 +01:00
Motiejus Jakštys
d823680e18
musl.zig: remove unused enum (#13545) 2022-11-14 16:35:25 +01:00
Naoki MATSUMOTO
b29057b6ab
std.crypto.ghash: fix uninitialized polynomial use (#13527)
In the process of 'remaining blocks',
the length of processed message can be from 1 to 79.
The value of 'n-1' is ranged from 0 to 3.
So, st.hx[i] must be initialized at least from st.hx[0] to st.hx[3]
2022-11-14 16:35:08 +01:00
Andrew Kelley
0b0292c456
Merge pull request #13536 from ziglang/cbe-zig-h
C backend: improve ergonomics of zig.h a little bit
2022-11-14 01:53:14 -05:00
Andrew Kelley
20e8c2df4e zig.h: remove redundant definition of u16/i16 2022-11-13 16:50:20 -07:00
Andrew Kelley
77e7d97725 C backend: improve ergonomics of zig.h a little bit
Partially implements #13528. Enough to unblock the wasi-bootstrap
branch.
2022-11-13 16:50:16 -07:00
Veikka Tuominen
0184c8d86f Sema: remove block and src parameters from getBuiltin
These parameters are only ever needed when `std.builtin` is out of sync
with the compiler in which case panicking is the only valid operation
anyways. Removing them causes a domino effect of functions no longer
needing a `src` and/or a `block` parameter resulting in handling
compilation errors where they are actually meaningful becoming simpler.
2022-11-13 15:45:25 -05:00
Halil
b2ffe113d3
x/os/Reactor: implement remove function (#13330)
* x/os/Reactor: implement remove function

* x/os/Reactor: update tests
2022-11-13 17:43:29 +02:00