20949 Commits

Author SHA1 Message Date
Cody Tapscott
98b60992b3 stage2: Ensure f128 alignment matches c_longdouble alignment
On platforms where c_longdouble is 128-bits, interop with C code
is simplified by making f128 match the alignment of c_longdouble.

I intended to make this change as part of #13257, but I missed this
part.
2022-11-02 16:58:56 -04:00
Andrew Kelley
e50789f1cb
Merge pull request #13389 from jacobly0/fix-only-c
cbe: enough fixes for `-Donly-c` to be able to produce an executable
2022-11-02 15:53:59 -04:00
Andrew Kelley
57dbeb90af
Merge pull request #13396 from Luukdegram/fix-12880
llvm: mangle extern function names for Wasm target
2022-11-02 14:10:07 -04:00
Jacob Young
37c104ade0 cbe: ignore comptime fields when generating tuple typedefs
This vastly reduces the amount of deduplication state we need to deal with.
2022-11-02 10:21:05 -04:00
Jacob Young
5f31070b8b cbe: hack around invalid Air
Can be changed to `!inst_ty.hisRuntimeBitsIgnoreComptime()` when the
"result location with inferred type ends up being pointer to comptime_int"
test stops producing Air containing a `bitcast(*comptime_int, ...)`.

See #13410
2022-11-02 10:20:31 -04:00
Cody Tapscott
c22f17e15f stage2 llvm: Respect alignment for .union_init
Resolves #13232.
2022-11-02 12:45:06 +02:00
Joachim Schmidt
81c27677d4
Merge pull request #13404 from joachimschmidt557/stage2-aarch64
stage2 aarch64: enable printing test results in the test runner
2022-11-02 09:59:15 +01:00
Jacob Young
d8635af1dc cbe: correctly implement volatile memset 2022-11-01 20:43:54 -04:00
Jacob Young
771dadc5e0 x86: cleanup inline asm
Multiple outputs work now, so use that instead of deleting clobbers.
2022-11-01 20:39:06 -04:00
Jacob Young
9b2db56d0f x86: remove inline asm clobbers that conflict with inputs or outputs 2022-11-01 20:39:06 -04:00
Jacob Young
4d594090b1 cbe: incorrectly implement volatile memset
This will have to be replaced with manual volatile stores.
2022-11-01 20:39:06 -04:00
Jacob Young
09763435a8 cbe: support arrays in more places 2022-11-01 20:39:06 -04:00
Jacob Young
071404ff65 cbe: fix optional access 2022-11-01 20:39:05 -04:00
Jacob Young
8e52be1602 cbe: avoid emitting code for zero-bit field access 2022-11-01 20:38:52 -04:00
Jacob Young
fb8c08d4ac cbe: disambiguate struct typedefs with decl index 2022-11-01 20:38:52 -04:00
Jacob Young
91fe0b80a2 cbe: fix threadlocal 2022-11-01 20:38:51 -04:00
Jacob Young
757db665a7 build: remove ofmt from LibExeObjStep which is redundant with target.ofmt 2022-11-01 20:38:37 -04:00
Jacob Young
93d60d0de7 std: avoid vector usage with the C backend
Vectors are not yet implemented in the C backend, so no reason to
prevent code using the standard library from compiling in the meantime.
2022-11-01 20:38:37 -04:00
Jakub Konka
ebf9ffd342 cli: set sysroot when --sysroot option was passed
Fixes regression introduced in 0b47e69b7c
2022-11-01 23:11:29 +01:00
joachimschmidt557
3051fab97c
stage2 AArch64: misc fixes, enable printing in test runner
- Fixed missing airRetPtr implementation
- Fixed wrong pop_regs order
- Fixed wrong source and destination register in store
2022-11-01 20:44:18 +01:00
joachimschmidt557
4e0779813b
stage2 AArch64: add inline memset 2022-11-01 20:43:27 +01:00
joachimschmidt557
8a022d9c92
stage2 AArch64: implement wrap_errunion_{err,payload} 2022-11-01 20:43:27 +01:00
joachimschmidt557
3ecec50f0c
stage2 AArch64: implement basic switch statements 2022-11-01 20:43:27 +01:00
joachimschmidt557
d2a5a36cab
stage2 AArch64: implement min/max 2022-11-01 20:43:27 +01:00
Frank Denis
0d192ee9ef
std.crypto.onetimeauth.Ghash: make GHASH 2 - 2.5x faster (#13374)
Rewrite GHASH to use 128-bit multiplication over non-reversed
integers, and up to 8 blocks aggregated reduction.

lib/std/crypto/benchmark.zig results:

Xeon E5:
  Before: 1604 MiB/s
   After: 4005 MiB/s

Apple M1:
  Before: 2769 MiB/s
   After: 6014 MiB/s

This also makes AES-GCM faster by the way.
2022-11-01 13:49:13 -04:00
Andrew Kelley
1780d7a348
Merge pull request #13368 from jacobly0/fix-aarch64-c 2022-11-01 13:28:40 -04:00
Luuk de Gram
ef0df24626
test/link: add linker test to verify mangling
This adds a simple linker test to ensure the built library contains
an import entry for each extern function call that was mangled.
2022-11-01 15:43:34 +01:00
Luuk de Gram
66bcc55e01
llvm: mangle extern Wasm functions
When Wasm extern functions contain the same name, but have a
different module name such as `extern "a"` vs `extern "b"` LLVM will
currently resolve the two functions to the same symbol. By mangling
the name of the symbol, we ensure the functions are resolved
seperately. We mangle the name by applying <name>|<module> where
module is also known as the library name.
2022-11-01 15:05:09 +01:00
mnordine
2943df016e
Fix variable name in documentation sample (#13391) 2022-11-01 12:49:13 +01:00
Frank Denis
ddb9eac05c ed25519: recommend using the seed to recover a key pair 2022-11-01 07:26:32 +01:00
Frank Denis
9e44710fc4
Ed25519.KeyPair.fromSecretKey() didn't compile after the API changes (#13386)
Fixes #13378
2022-11-01 07:10:40 +01:00
Jacob Young
ff83296256 cbe: fix gcc warnings 2022-10-31 21:01:47 -04:00
Jacob Young
b35514ecfe cbe: disable aarch64 behavior tests that are broken with gcc 2022-10-31 21:01:04 -04:00
Jacob Young
b945d3eb90 cbe: improve support for non-native float types
* Fix _start on aarch64.
 * Add fallbacks when a float type is unsupported.

Fixes #13357
2022-10-31 20:18:15 -04:00
Andrew Kelley
0bbb000359 ci: add 0.10.0 release data 2022-10-31 14:21:52 -07:00
Andrew Kelley
cbdc91eb1a stage2: fix compilation on 32-bit arm 2022-10-31 14:21:36 -07:00
Andrew Kelley
841235b3fd start the 0.11.0 release cycle 2022-10-31 10:25:46 -07:00
Andrew Kelley
0c1701768d Release 0.10.0 0.10.0 2022-10-31 10:24:38 -07:00
Cody Tapscott
049e6025f2 stage2: Add explicit type qualifier to workaround #13366
Depending on how #13366 is resolved, this code should arguably have
been rejected with a compile error in the first place.
2022-10-31 13:13:11 -04:00
Cody Tapscott
6f2408aab8 link/MachO: Avoid depending on host PATH_MAX
Repeat of a4eb221b9 for the newly-synchronized zld code.

Restores ability to compile Zig for WASI.
2022-10-31 13:12:37 -04:00
Andrew Kelley
d02242661e std.heap: make wasm32 PageAllocator handle large allocation
When a number of bytes to be allocated is so great that alignForward()
is not possible, return `error.OutOfMemory`.

Companion commit to 3f3003097cbf5a6ad9e0dfc29b2cafbe2e35dded.
2022-10-30 19:28:26 -07:00
Andrew Kelley
ef761c2cbc
Merge pull request #13360 from topolarity/comptime-bool-binops
Make `x and false` and `x or true` comptime-known
2022-10-30 22:11:44 -04:00
Andrew Kelley
6d999abba0 mingw-w64: add gdiplus def files
closes #13192
2022-10-30 19:04:00 -07:00
Andrew Kelley
d4f668b241
Merge pull request #13361 from jacobly0/while-cont-scope
AstGen: avoid access to capture defined in an inner scope from a continue expression
2022-10-30 21:44:07 -04:00
Andrew Kelley
3e126102b7 compiler_rt: fix gnu_f16_abi for i386-windows
closes #13333
2022-10-30 18:42:59 -07:00
Andrew Kelley
30b8b29f88 re-apply "Fix C include files not being in whole cache (#11365)"
This reverts commit 06310e3d4eb47fed88b175891cb5865bb050f020, reapplying
commit a430630002bf02162ccbf8d3eb10fd73e490cefd.

I deeply apologize to @moosichu and those affected by this bug. The
original fix was actually fine. When I reverted it, I misremembered
how the Cache API works. I thought the fix was going to introduce
nondeterminism into the hash, but I forgot that the order of files in
the manifest doesn't actually matter when checking for a cache hit.

Actually, it does matter a little bit. This fix has a subtle downside
which is that it does introduce the possibility of false negatives when
checking for cache hits of 2+ iterations ago. For example, if the code
goes from "foo", to "bar", and then back to "foo", it may look like a
cache miss when it should have been a hit because 2 iterations ago the
code was the same. However, this is an uncommon use case, and all it
does is cause a bit of wasted time and disk space. That said, my
suggestion from earlier still applies and would be a nice follow-up
enhancement to this fix:

The proper solution to this is to, in whole cache mode, append the hash
inputs to some data structure, and then after the compilation is
complete, do some kind of sorting on the hash inputs so that they will
be the same order every time, then apply them in sequence. No lock on
the Cache object is needed for this scheme.

closes #11063
2022-10-30 17:04:09 -07:00
Andrew Kelley
a5c96c49d0 langref: mention void{} and empty blocks
closes #11112
closes #12496
2022-10-30 16:33:22 -07:00
Andrew Kelley
3f3003097c std.heap.PageAllocator: add check for large allocation
Instead of making the memory alignment functions more complicated, I
added more API documentation for their existing semantics.

closes #12118
closes #12135
2022-10-30 16:10:20 -07:00
Andrew Kelley
9b54c9dee8 zig test: forward target CLI args to zig run when using -ofmt=c
Previously, if you used `zig test -ofmt=c -target foobar` then Zig would
try to compile the generated C code with the native target instead of
"foobar".

With this change, `--test-cmd` with e.g. QEMU still won't work, but at
least the binary will get compiled for the correct target.
2022-10-30 15:44:58 -07:00
Jacob Young
a77d89afe3 behavior: enable fixed cbe tests 2022-10-30 15:38:50 -04:00