21044 Commits

Author SHA1 Message Date
Jakub Konka
4b3637820d
Merge pull request #13495 from ziglang/macho-dsym
stage2: misc DWARF debug info fixes and additions for x86_64 and aarch64
2022-11-10 16:50:57 +01:00
Jakub Konka
0914e0a4ec dwarf: do not assume unsigned 64bit integer for the enum value 2022-11-10 09:36:45 +01:00
Jakub Konka
2d5fbbb44e
Merge pull request #13485 from ziglang/arm64-non-null-actual
aarch64: optionals
2022-11-09 21:13:50 +01:00
Jakub Konka
31e755df6f aarch64: handle .stack_argument_offset as a valid local var 2022-11-09 19:58:14 +01:00
Jakub Konka
df09d9c14a x86_64: add DWARF encoding for vector registers
Clean up how we handle emitting of DWARF debug info for `x86_64`
codegen.
2022-11-09 18:35:06 +01:00
Jakub Konka
02852098ee aarch64: emit DWARF debug info for fn params and locals
We postpone emitting debug info until *after* we generate the function
so that we have an idea of the consumed stack space. The stack offsets
encoded within DWARF are with respect to the frame pointer `.fp`.
2022-11-09 18:35:06 +01:00
Jakub Konka
7007ecdc05 macho: create dSYM bundle directly in the emit dir 2022-11-09 18:35:06 +01:00
Veikka Tuominen
41b7e40d75
Merge pull request #13418 from ryanschneider/signal-alignment-13216
std.os: fix alignment of Sigaction.handler_fn
2022-11-09 17:36:40 +02:00
IntegratedQuantum
d1e7be0bd1
Handle sentinel slices in std.mem.zeroes
Fixes #13256
2022-11-09 17:33:48 +02:00
Veikka Tuominen
61842da9f7 llvm: implement packed unions
Closes #13340
2022-11-09 17:14:38 +02:00
bfredl
95f989a05b Fixes to linux/bpf/btf.zig
- the meaning of packed structs changed in zig 0.10. adjust accordingly.
  Use "extern struct" for the cases that directly map to C structs.

- Add new type info kinds, like enum64 and DeclTag

- change the Type enum to use the canonical names from libbpf.
  This is more predictable when comparing with external BPF
  documentation (than invented synonyms that need to be guessed)
2022-11-09 17:14:22 +02:00
Jakub Konka
a2e67173d1
Merge pull request #13487 from ziglang/zld-dwarf-string
macho: misc DWARF parser fixes
2022-11-09 06:53:24 +01:00
Jakub Konka
188ad31cf3 macho: fix 32bit build 2022-11-08 21:21:25 +01:00
Andrew Kelley
a65ba6c85a CI: stop using cloud.drone.io
This service stopped working two days ago for unknown reasons. Until it
is determined how to get it working again, or we switch to a different
CI provider for aarch64, this CI test coverage is disabled so that
we can continue to use the CI for other targets.
2022-11-08 11:04:33 -07:00
Jakub Konka
9db63d4f1d macho: fix handling of DW_FORM_block* forms 2022-11-08 17:45:28 +01:00
Frank Denis
36e618aef1 crypto.ghash: compatibility with stage1
Defining the selector enum outside the function definition is
required for stage1.
2022-11-08 16:59:53 +01:00
Jakub Konka
7145064efd macho: fix parsing len of DW_FORM_string 2022-11-08 15:45:15 +01:00
Jakub Konka
e83590d0e8 aarch64: pass some tests dealing with optionals 2022-11-08 13:59:47 +01:00
Jakub Konka
179f16904f aarch64: circumvent zig0 inference problems 2022-11-08 13:59:06 +01:00
Jakub Konka
32ad218f5a aarch64: revert changes to .call 2022-11-08 13:50:30 +01:00
Jakub Konka
45f65c8445 aarch64: fix implementation of .is_null and .is_non_null 2022-11-08 13:42:58 +01:00
Jakub Konka
0d556877af aarch64: implement .wrap_optional always saving to the stack 2022-11-08 13:42:58 +01:00
Jakub Konka
a07449450f aarch64: implement optionalPayload when mcv is register 2022-11-08 13:42:58 +01:00
Jakub Konka
35bd5363ee aarch64: implement isNull() for non-pointer optionals 2022-11-08 13:42:58 +01:00
Jakub Konka
0de56d1722 aarch64: partially implement optionalPayload() 2022-11-08 13:42:58 +01:00
Jakub Konka
cd7cbed651 aarch64: partially implement isNull() 2022-11-08 13:42:58 +01:00
Frank Denis
7d48cb1138
std.crypto: make ghash faster, esp. for small messages (#13464)
* std.crypto: make ghash faster, esp. for small messages

Aggregated reduction requires 5 additional multiplications (to
precompute the powers of H), in order to save 2 multiplications
per batch.

So, only use large batches when it's actually interesting to do so.

For the last blocks, reuse the precomputations in order to perform
a single reduction.

Also, even in .ReleaseSmall, allow 2-block aggregation.
The speedup is worth it, and the code increase is reasonable.

And in .ReleaseFast, bump the upper batch size up to 16.

Leverage comptime by the way instead of duplicating code.

std/crypto/benchmark.zig on Apple M1:

    Zig 0.10.0: 2769 MiB/s
        Before: 6014 MiB/s
         After: 7334 MiB/s

Normalize function names by the way.

* Change clmul() to accept the half to be processed

This avoids a bunch of truncate() calls.

* Add more ghash tests to check all code paths
2022-11-07 21:45:29 +01:00
Ganesan Rajagopal
88d2e4f66a langref.html.in: Simplify printing types in examples
zig stdlib fmt has a formatter for types which prints the type name.  So,
just use @TypeOf(type) instead of the longer @typeInfo(@TypeOf(type)).
2022-11-07 15:07:21 +02:00
Veikka Tuominen
dc128f403b
Merge pull request #13446 from Vexu/stage2-fixes
Stage2 bug fixes
2022-11-07 14:17:26 +02:00
Frank Denis
32563e6829
crypto.core.aes: process 6 block in parallel instead of 8 on aarch64 (#13473)
* crypto.core.aes: process 6 block in parallel instead of 8 on aarch64

At least on Apple Silicon, this is slightly faster than 8 blocks.

* AES: add parallel blocks for tigerlake, rocketlake, alderlake, zen3
2022-11-07 12:28:37 +01:00
Frank Denis
907f3ef887
crypto.salsa20: make the number of rounds a comptime parameter (#13442)
...instead of hard-coding it to 20.

- This is consistent with the ChaCha implementation
- NaCl and libsodium, that this API is designed to interop with,
also support 8 and 12 round variants. The 12 round variant, in
particular, provides the same security level as the 20 round variant,
but is obviously faster.
- scrypt currently uses its own non optimized version of Salsa, just
because it use 8 rounds instead of 20. This will help remove code
duplication.

No behavior nor public API changes. The Salsa20 and XSalsa20 still
represent the 20-round variant.
2022-11-06 23:52:41 +01:00
Jakub Konka
4c719ad338
Merge pull request #13463 from ziglang/fix-13056
macho: parse weak imports in tbd descriptors
2022-11-06 22:44:58 +01:00
r00ster91
b83e4d9656 std.os.linux.T: translate more MIPS values
This fixes the broken terminal for me and thus fixes #13198.
2022-11-06 16:33:50 +02:00
Jakub Konka
72769f6cec link-tests: add test case for parsing weak imports 2022-11-06 15:21:28 +01:00
Jakub Konka
351031b6c7 macho: parse weak symbols in tbds
However, we will treat them as standard imports rather than refs
to weak imports until I investigate more how it actually works
underneath.
2022-11-06 15:19:17 +01:00
Jay Petacat
694d8831c3 Revert "x86" CPU model (not arch) back to "i386"
PR #13101 recently renamed the "i386" architecture to "x86", and it
seems the specific CPU model got swept up in that. "x86" is an umbrella
term that describes a family of CPUs, and the "i386" is the oldest
supported model under that umbrella.
2022-11-06 13:39:03 +01:00
Jakub Konka
1aeef29733 coff: move relocation in its own module 2022-11-06 08:41:43 +01:00
Jakub Konka
5ef33e7c7e
Merge pull request #13459 from ziglang/issue-13457
macho: do not zero-out file if there are no nonzerofill sects
2022-11-06 08:39:13 +01:00
Jakub Konka
76fb3e0621 macho: do not zero-out file if there are no nonzerofill sects
If the `__DATA` segment comprises of only zerofill sections, do not
accidentally zero out all of file.
2022-11-06 00:36:27 +01:00
Jakub Konka
aaaa7df152 macho: add linker test case for issue 13457 2022-11-06 00:10:12 +01:00
delitako
c8a5ad6d9d
Improve doc comments for two functions (#13456)
* std.heap: fix function name in doc comment

* std.mem: document return value of `replace`
2022-11-05 22:55:50 +01:00
Ali Chraghi
aea617c60b std.os: take advantage of the freebsd's copy_file_range 2022-11-05 15:43:39 -04:00
Veikka Tuominen
5d28d171df Sema: adjust result type of anyerror field access
Closes #13448
2022-11-05 13:22:21 +02:00
Veikka Tuominen
ea48f06fc2 stage2: address of threadlocal variable is not comptime known
Closes #13215
2022-11-05 13:22:21 +02:00
Veikka Tuominen
f96748ebc1 Sema: coerce elements of array cat
Closes #13347
2022-11-05 13:22:21 +02:00
Jakub Konka
28288dcbbf
Merge pull request #13444 from ziglang/arm64-coff
aarch64,coff: lift-off!
2022-11-05 12:19:45 +01:00
Veikka Tuominen
f92e7bed7b stage2: bitsize of packed struct should trigger backing int ty check
Closes #13398
2022-11-05 12:54:38 +02:00
Jakub Konka
165ae04a03 coff: use .x86 instead of .i386 2022-11-05 10:35:04 +01:00
Jakub Konka
59fa0499c9 coff: tentatively handle Obj in getImageBase() func 2022-11-05 10:15:01 +01:00
Jakub Konka
9618fdc8a2 coff: circumvent stage1 inference problems 2022-11-05 10:15:01 +01:00