20767 Commits

Author SHA1 Message Date
Jacob Young
9b45dc1608 stage2: fix emitting asm and bin at the same time
This logic is copied from stage1.

Fixes #12800
2022-10-14 14:46:50 -04:00
Andrew Kelley
cb257d59f9
Merge pull request #13148 from r00ster91/progressfollowup
fix(std.Progress): some follow-ups
2022-10-14 14:43:34 -04:00
r00ster91
ab4e696e1f fix: handle larger window sizes more robustly
We should now be able to handle virtually any window size gracefully.
2022-10-14 09:38:09 +02:00
Cody Tapscott
34863224c3 Re-enable mulAdd f128 tests on i386-linux 2022-10-13 12:53:30 -07:00
Cody Tapscott
1e278131e3 Re-enable @mulAdd f128 tests on aarch64-darwin
Closes #9900
2022-10-13 12:53:29 -07:00
Cody Tapscott
f035437b5d Re-enable Vector f16 tests on Windows
Closes #4952
2022-10-13 12:53:20 -07:00
Cody Tapscott
b8c587eb40 tests: Enable PPC64LE as a test target 2022-10-13 12:53:20 -07:00
Cody Tapscott
46fb730712 stage2: Use softfloat for f16 on MIPS targets 2022-10-13 12:53:20 -07:00
Cody Tapscott
db9058e41a Disable llvm.prefetch for PowerPC
This instruction is not supported on this backend, so should
just be a noop.
2022-10-13 12:53:20 -07:00
Cody Tapscott
6e6ae8886e stage1: Add softfloat support for @reduce 2022-10-13 12:53:20 -07:00
Cody Tapscott
f0d12dd82b stage2: Add softfloat support for @reduce 2022-10-13 12:53:20 -07:00
Cody Tapscott
b992ea1b07 stage1: Rely on softfloat for f16 on non-arm targets 2022-10-13 12:53:20 -07:00
Cody Tapscott
37c6fcafa2 stage2 LLVM: Correct long double for WASM
Also, f16 is not supported on this backend.
2022-10-13 12:53:20 -07:00
Cody Tapscott
0d533433e2 compiler_rt: Add missing f16 functions
This change also exposes some of the existing functions under both the
PPC-style names symbols and the compiler-rt-style names, since Zig
currently lowers softfloat calls to the latter.
2022-10-13 12:53:20 -07:00
Cody Tapscott
aedafb20cf stage2: Fix softfloat support for PPC64(LE)
Stage 2's softfloat support still had a couple of gaps, which were
preventing us from lowering `f16` on this target. With any luck,
this is enough to get PPC64 working as a Tier 2 target again.
2022-10-13 12:53:20 -07:00
Cody Tapscott
83e2d3fb37 stage1: Skip new tests that never passed in stage1
This gets the behavior tests passing for stage1 again.
2022-10-13 12:53:20 -07:00
r00ster91
4ae8717fb3 test: uncomment print
For general output testing, this shouldn't always be required and is only sometimes useful.
2022-10-13 16:06:51 +02:00
r00ster91
cbe6872518 refactor: max_width calculation
I think this may be helpful in the future when we might want to calculate this again at some other point.
It also makes it more clear that the other two functions below it are only required for this calculation.
2022-10-13 16:06:51 +02:00
r00ster91
e484e75969 docs: add notes 2022-10-13 16:06:46 +02:00
Jacob Young
f5f28e0d2c io_uring: ignore SOCK_NONEMPTY for reproducible tests
Fixes #12670
2022-10-13 14:58:06 +02:00
Ali Chraghi
0eb3b8fa44 std.SegmentedList: fix compilation error 2022-10-13 13:57:20 +02:00
Bill Nagel
ea23217751 enable event loop for ios, tvos, and watchos 2022-10-13 13:33:45 +02:00
Ali Chraghi
fb366f3cd4 std.c: fix incorrect return types
Closes #12964
2022-10-13 13:21:19 +02:00
cod1r
6af0eeb58d adding static and dynamic ZigEquivalent enums so that we can branch to set link_mode properly when we iterate over the clang arguments. also replaced dynamic flag in clang_options_data.zig with proper definition similarly to static. 2022-10-13 13:12:17 +02:00
kkHAIKE
d987bf859e Sema: add float128IntPartToBigInt to fix compare comptime float with int 2022-10-13 13:11:13 +02:00
Marijn Stollenga
3a9344d8fc Return invalid argument in sendto instead of unreachable, since this can happen with user-side errors 2022-10-13 13:10:29 +02:00
zooster
cd3d8f3a4e
std.Progress: fix inaccurate line truncation and use optimal max terminal width (#12079)
* prep: output_buffer -> output_buffer_slice

* fix: truncate lines accurately

Currently, the code assumes a terminal width of 100.

If we look at what's printed for the last test:
```
Test [1/1] test "basic functionality"... [101/100] this is a really long name designed to activate the truncation code. let's fi...
```
No, it does not really work because the relevant part here is `"[101/100] this is a really long name designed to activate the truncation code. let's fi... "`,
which is 90 characters, but we expect 100 because that's the width that is assumed.
The reason is that it also measures **unprintable characters** (escape sequences) at least non-Windows systems.
With this commit the output is now:
```
Test [1/1] test "basic functionality"... [101/100] this is a really long name designed to activate the truncation code. let's find out if...
```
Of which `"[101/100] this is a really long name designed to activate the truncation code. let's find out if... "`
is the actual output of *our* `std.Progress` (remember that `zig test` has an `std.Progress` and our test itself does).
The length of that string is 100. Now the length is consistent with Windows where we don't use escape sequences. This issue was only present on non-Windows systems.

* feat: decide optimal maximum width

This is done by 1. getting the current terminal width and 2. subtracting that by the current cursor column. This accounts for previous output from someone else.

* test: add more tests

They make it easier to see how the progress line is printed in different cases.

* style: fix typo and improve docs

It also expands an acronym used as a variable name. It confused me.

* cleanup: import std.time

* test: add test

* fix: limit termios usage to Linux only for now

* fix: missing cast on Windows

* test: try to debug failure

* fix: fix off-by-one and disable tests

* docs: make comment clearer

* fix: more durability

* fix(getTerminalWidth): change order
2022-10-13 06:39:24 -04:00
Jacob Young
02d7292a8c build.zig: Forward LLVM lib/include dirs from CMake
Previously, you might obtain `-lLLVM-15` from the CMake configuration,
but we might not be able to locate the library if it's not in your
system library path.
2022-10-12 18:11:46 -04:00
Cody Tapscott
50a6dc8496 build.zig: Parse CMAKE_PREFIX_PATH with multiple entries
CMAKE_PREFIX_PATH is a semicolon separated list.
2022-10-12 12:01:44 -07:00
Robin Voetter
9ff60e356e
typo 2022-10-12 20:38:43 +02:00
Robin Voetter
e90a42a808
stage2: improve globals with address spaces a little 2022-10-12 20:36:15 +02:00
Robin Voetter
ad74773959
make addrSpaceCast work with optionals; forbid ptrCast'ing address spaces 2022-10-12 20:36:15 +02:00
Robin Voetter
aa20295d24
compiler_rt: apply protty suggestions 2022-10-12 20:36:15 +02:00
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