20514 Commits

Author SHA1 Message Date
Robin Voetter
86f40d3ff6
zig_libc: do not call abort() on amdgpu 2022-10-12 20:36:15 +02:00
Robin Voetter
9006cd9d09
compiler_rt: cmpxchg-based atomic fetch/exchange for small types
Some architectures (AMDGPU) do not support atomic exchange/fetch for
small types (for AMDGPU: 8- and 16-bit ints). For these types
atomic fetch and atomic exchange needs to be implemeted using atomic
operations on a wider type using cmpxchg.
2022-10-12 20:36:14 +02:00
Robin Voetter
8894d1c45e
stage2: f128 improvements for targets that do not support it 2022-10-12 20:36:14 +02:00
Robin Voetter
76ad9cb10e
backport @addrSpaceCast to stage 1 2022-10-12 20:36:14 +02:00
Robin Voetter
fb9a7dad17
add @addrSpaceCast to langref 2022-10-12 20:36:14 +02:00
Robin Voetter
9f14681473
stage2: check address space cast validity 2022-10-12 20:36:14 +02:00
Robin Voetter
5d429b03e3
stage2: add @addrSpaceCast builtin 2022-10-12 20:36:12 +02:00
Robin Voetter
5f3b91437f
stage2: improve addrspace handling
This commit changes the way Zig is intended to deal with variable
declaration for exotic targets. Where previously the idea was to
enfore local/global variables to be placed into their respective
address spaces, depending on the target, this is now fixed to the
generic address space.

To facilitate this for targets where local variables _must_ be
generated into a specific address space (ex. amdgcn where locals
must be generated into the private address space), the variable
allocations (alloca) are generated into the right address space
and then addrspace-casted back to the generic address space. While this
could be less efficient in theory, LLVM will hopefull deal with figuring
out the actual correct address space for a pointer for us. HIP seems to
do the same thing in this regard.

Global variables are handled in a similar way.
2022-10-12 20:34:42 +02:00
Robin Voetter
3392de87dc
allow global/local/shared address spaces on amdgcn 2022-10-12 20:34:41 +02:00
Robin Voetter
5859d8458f
big int: make Mutable.normalize const 2022-10-12 20:34:41 +02:00
Robin Voetter
d638b2e29f
stage 2: grammar 2022-10-12 20:34:41 +02:00
Robin Voetter
6b69dcfdd2
amdgpu: add AmdgpuKernel calling convention 2022-10-12 20:34:41 +02:00
Robin Voetter
5dd3d17c20
amdgpu: add amdhsa/amdpal ctype abi sizes 2022-10-12 20:34:40 +02:00
Michael Dusan
0b47e69b7c improve header searchlist handling in build, main
build.zig:
- use "-I" instead of "-isystem" for `b.addSearchPrefix()`

main.zig:
- silently ignore superfluous search dirs
- warn when a dir is added to multiple searchlists
- consolidate "expected paramter after {s}" fatal error messages
- rename command-line switch `-dirafter` → `-idirafter`

closes #12888
2022-10-12 13:50:25 -04:00
Andrew Kelley
c23b3e6fd9
Merge pull request #13073 from squeek502/fs-delete-tree-2
`fs.Dir.deleteTree`: Optimize for non-deeply-nested directories
2022-10-12 13:37:06 -04:00
Veikka Tuominen
260b0ff7c5 Sema: add reference trace before checking for cached value
Closes #13143
2022-10-12 18:57:31 +03:00
Veikka Tuominen
3a8777a8bb fix hyphenation in test case
Follow up to 51d9db856978610c24b3fed50a9550455a2eb64b
2022-10-12 16:10:57 +03:00
jacobly0
562ac8be48
codegen: add support for lowering .field_ptr on a slice
Closes #13068
2022-10-12 12:40:59 +03:00
Andrew Kelley
b47e54ed3f CI: windows: update tarball
Needed due to the --strip/-fstrip breaking changes.
2022-10-12 02:34:26 -07:00
kcbanner
28b7fa1d13 msvc: fixup compiler arg generation, as /O2 is incompatible with /RTC1 2022-10-12 05:31:48 -04:00
Andrew Kelley
d08191e146
Merge pull request #12897 from r00ster91/uefi
std.os.uefi: fix some mistakes
2022-10-12 05:28:13 -04:00
Andrew Kelley
7ce1ee1bce
Merge pull request #13081 from r00ster91/docs
fix(text): hyphenation and other fixes
2022-10-12 05:26:11 -04:00
Ryan Liptak
bec40a89c2 Windows: Fix stage1.zig's main failing to receive non-ASCII args
Closes #10506
2022-10-12 05:21:48 -04:00
Luuk de Gram
1f196b9e2f
stage2: implement exporting using field access (#13136)
This implements `@export(a.b, .{..});` in semantic analysis,
allowing users to directly export a variable from a namespace.

* add test case for exporting using field access
2022-10-12 04:38:07 -04:00
Gaëtan
62258555b6 Make CompressorOptions public 2022-10-12 04:04:43 -04:00
Andrew Kelley
a3c9c154b4
Merge pull request #13089 from ziglang/update-mingw 2022-10-12 03:17:52 -04:00
Cody Tapscott
e6ebdcb82e stage2 LLVM: Use a packed aggregate for union payload init
Without the packed qualifier, the type layout that we use to
initialize doesn't match the correct layout of the underlying
storage, causing corrupted data and past-the-end writes.
2022-10-11 15:42:01 -04:00
Luuk de Gram
8635c18e40
test/link: don't strip producers section for wasm
When testing the Wasm linker for the producers section
we do not ever want to strip the binary as this will remove
the producers section in release-small.

This fixes the CI errors by d086b371f0e21e5029e1b0d05838b87502eb63e6
2022-10-11 21:27:09 +02:00
GethDW
01b9fa2c25
std: fix memory leak on OutOfMemory error in math.big.int and math.big.rationa 2022-10-11 20:12:03 +03:00
Veikka Tuominen
a72b584c76
Merge pull request #13126 from tau-dev/master
translate-c: Fix function pointers, add cast to subscripts in macros
2022-10-11 19:04:44 +02:00
Ali Chraghi
d086b371f0 Compilation: strip debug info from ReleaseSmall by default 2022-10-11 17:51:25 +02:00
mllken
42a3b60c33 io_uring: allow for nullable arguments 2022-10-11 17:49:30 +02:00
r00ster91
697e22caa4 fix: resolve data race in std.Progress.maybeRefresh()
It seems we can simply lock the update mutex a little earlier.
2022-10-11 17:46:39 +02:00
Eric Milliken
0b7b4b7e97
std: add linux support for packet sockaddr 2022-10-11 18:46:24 +03:00
Andrew Kelley
c3d67c5c4e
Merge pull request #13117 from topolarity/compiler-rt-cmul
compiler-rt: Implement complex multiply/division
2022-10-11 05:51:47 -04:00
Andrew Kelley
b020d83265 mingw-w64: pass -D__USE_MINGW_ANSI_STDIO=0 for crt files
Thanks to Martin Storsjö for explaining this to me on IRC:

__USE_MINGW_ANSI_STDIO redirects stdio functions towards mingw-w64
reimplementations of them (since msvcrt.dll lacks lots of things). For
x86 with "long double", this is also needed to get long doubles
formatted properly. It's enabled by default by headers when building in
C99 mode, unless you're targeting UCRT. The headers normally enable this
automatically - or you can request it enabled with
-D__USE_MINGW_ANSI_STDIO=1. However, the mingw-w64-crt files are
expected to be built with this explicitly turned off. Since there's a
half dozen various ways of configuring the CRT and various features, the
mingw-w64-crt files specifically need to be built in a very hardcoded
configuration, which is different from how end user source files are
compiled.

This commit removes a patch that we were carrying previously.

See #7356
2022-10-11 01:59:39 -07:00
Andrew Kelley
3108b8010e CI: windows: update tarball 2022-10-11 01:51:49 -07:00
Andrew Kelley
85f4e579d8 stage2: update mingw-w64 build logic to v10.0.0 2022-10-11 01:05:42 -07:00
Andrew Kelley
e4ed8c3f37 update mingw-w64 crt files to v10.0.0 2022-10-11 01:05:42 -07:00
Andrew Kelley
e52931e50f update mingw-w64 headers to v10.0.0 2022-10-11 01:05:42 -07:00
Tau
85b105d4f9 Update translate-c tests 2022-10-11 00:43:53 +02:00
Veikka Tuominen
b316c25cc6
Merge pull request #13075 from Vexu/stage2-fixes
Stage2 misc fixes
2022-10-10 23:27:17 +02:00
Veikka Tuominen
1f8ae10a38
Merge pull request #13091 from Vexu/small-proposals
Implement some small proposals
2022-10-10 23:26:56 +02:00
Rekai Nyangadzayi Musuka
dacdc95ea2
std/math.zig: use previous rotate code with non-power-of-two integers 2022-10-11 00:22:35 +03:00
Tau
770a1aa967 translate-c: fix #5305 2022-10-10 22:50:22 +02:00
Tau
6be16eeae9 translate-c: fix the remaining function pointer issues 2022-10-10 22:30:33 +02:00
Tau
2ca503ec05 translate-c: Fix #12263 2022-10-10 22:29:56 +02:00
Eric Joldasov
02fff6fd01 Fix building with Clang 16
Related:
https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
2022-10-10 02:31:09 -04:00
Cody Tapscott
a06185f362 C ABI: Add tests for complex float/double support
These tests will be failing on many platforms until #8465 is resolved.

Luckily, the particular function signature used for __divXc3 and __mulXc3
seems to be OK on x86-64.
2022-10-09 23:24:29 -07:00
Cody Tapscott
879fb0c57c Manually construct denormal constants in tests
Constructing these at runtime can cause them to be flushed to zero,
which was triggering a CI failure for Windows.
2022-10-09 20:29:30 -07:00