21627 Commits

Author SHA1 Message Date
Andrew Kelley
cffbb32d31
Merge pull request #13872 from koachan/sparc64-codegen
stage2: sparc64: Some Air lowerings + skip unbuildable tests
2022-12-10 15:10:21 -05:00
Andrew Kelley
f1f17dc1c7
Merge pull request #13810 from r00ster91/old
Re-enable many previously failing tests and add test coverage
2022-12-10 15:07:51 -05:00
Andrew Kelley
023b597ab4
Merge pull request #13370 from r00ster91/newascii
std.ascii: remove LUT and deprecations
2022-12-10 14:53:41 -05:00
Andrew Kelley
ac0488430f Compilation: revert asking for exclusive locks on cache hits
We definitely want a shared lock on a cache hit. Without this, we get a
deadlock when Zig is asked to compile the same C source file multiple
times as part of the same compilation.

This is a partial revert of 8ccb9a6ad327a4d7fbc321b33d4aa66a27a1f5ee.

cc @kcbanner
2022-12-10 14:34:30 -05:00
Josh
a6a141bbe9 fix doc comments in bitset types 2022-12-10 14:32:24 -05:00
Koakuma
f9e9ba784f stage2: sparc64: Skip unimplemented tests 2022-12-10 21:51:46 +07:00
Koakuma
644593ab18 stage2: sparc64: Implement airMinMax 2022-12-10 21:32:00 +07:00
Koakuma
b4b7a404cf stage2: sparc64: Implement airBitReverse 2022-12-10 21:31:59 +07:00
Koakuma
a369e8af9e stage2: sparc64: Add more types for genTypedValue 2022-12-10 21:31:59 +07:00
Jacob Young
fc6d7d2799 CBE: fix compiling for aarch64-windows
These bugs were triggered in the C backend by aarch64-specific code in
os/windows.zig.  Intentionally not updating zig1.wasm yet because of
upcoming changes and since aarch64-windows is not tested on master yet.
2022-12-10 09:15:40 -05:00
Koakuma
e9204f84ad stage2: sparc64: Log generated function name for debug purposes 2022-12-10 21:11:14 +07:00
Koakuma
fb9357f06c stage2: sparc64: Implement atomic ops 2022-12-10 21:11:14 +07:00
Koakuma
219b5f0ad6 stage2: sparc64: Implement stack argument 2022-12-10 21:11:14 +07:00
Koakuma
a72362f395 stage2: sparc64: Implement airWrapErrUnionPayload 2022-12-10 21:11:14 +07:00
Koakuma
1b5b9eb365 stage2: sparc64: Add extra note about stack_offset MCV 2022-12-10 21:11:14 +07:00
Koakuma
57616debf9 stage2: sparc64: Implement airTrunc 2022-12-10 21:11:14 +07:00
Koakuma
ef532ada8a stage2: sparc64: Implement airSplat 2022-12-10 21:11:14 +07:00
Koakuma
4687bc2730 stage2: sparc64: Implement airUnionInit 2022-12-10 21:11:14 +07:00
Koakuma
0bc936685b stage2: sparc64: Implement airErrorName 2022-12-10 21:11:14 +07:00
Koakuma
4ddedb3885 stage2: sparc64: Implement get/setUnionTag 2022-12-10 21:11:14 +07:00
Manlio Perillo
f020734347 langref: remove HTML code from a shell node
Several <em> elements where added inside a shell node in the
Using--target-and--cflags section.  Remove them, since they are not
supposed to be handled by codegen.

For the original commit, see
0c091feb5 (Improve HTML semantics and a11y of language reference).

Fixes #13846
2022-12-10 14:39:40 +02:00
r00ster91
654e30069d behavior and cases: more test coverage for old issues
Closes #2622
Closes #2727
Closes #6047
Closes #6947
Closes #6656
2022-12-10 12:34:42 +01:00
r00ster91
bf863878ac behavior: add test coverage for slice and array-related issues
Closes #10684
Closes #6905
Closes #8646
2022-12-10 12:34:42 +01:00
r00ster91
7a8f7dcb8c behavior: add test coverage for corrupted slice in release
Closes #7325
2022-12-10 12:34:42 +01:00
r00ster91
01947bfe92 behavior: add test coverage for previous i128 regression on aarch64
Closes #8429
2022-12-10 12:34:42 +01:00
r00ster91
981cfd9c1c behavior and langref: reenable previously-regressed tests on aarch64 and powerpc64le
Closes #3282
2022-12-10 12:34:42 +01:00
r00ster91
3370d58956 aarch64: reenable tests that are no longer regressed
Closes #12013
Closes #10627
Closes #12027
2022-12-10 12:34:34 +01:00
r00ster91
75f8c04d6d behavior: add test coverage for slicing zero length array field of struct
Closes #11787
2022-12-10 12:33:17 +01:00
Andrew Kelley
7637ac584f
Merge pull request #13821 from Vexu/eliminate-bound-fn
Eliminate `BoundFn` type from the language
2022-12-10 06:14:57 -05:00
Evin Yulo
e4874d842e Remove unneeded else unreachable in docgen.zig
See #707
2022-12-10 05:50:56 -05:00
Andrew Kelley
02b221051a fix aarch64-windows-gnu libc
We were missing some math functions. After this enhancement I verified
that I was able to cross-compile ninja.exe for aarch64-windows and
produce a viable binary.
2022-12-10 03:06:17 -05:00
Veikka Tuominen
89d1ccc477 replace zig1.wasm to the removal of BoundFn
This also no longer uses zstd compression on this file. The reasoning
for this is:

 * It has been demonstrated that the release tarballs are actually
   smaller if zig1.wasm gets compressed along with the other files
   rather than separately compressed.

 * More importantly, leaving zig1.wasm uncompressed may result in a
   smaller git repository size, since the repository as a whole could
   have savings across the multiple versions of zig1.wasm, which would
   not be possible if each one was independently compressed.

 * When in doubt, do what is simpler, which is to not have this extra
   zstd mechanism. This will remove the only "vendored" code from our
   build process, which is a nice property to have.

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2022-12-09 20:59:13 -07:00
Andrew Kelley
c51288f1f6 remove the zstd mechanism from the build process 2022-12-09 20:59:13 -07:00
Veikka Tuominen
9d93b2ccf1 Eliminate BoundFn type from the language
Closes #9484
2022-12-09 20:37:18 -07:00
Veikka Tuominen
5831b68341 AstGen: add check for missing builtin argument
Closes #13817
2022-12-09 20:37:18 -07:00
h57624paen
b483c796c6 fix building wasm2c output with msvc
cmake tweaks to allow zig1 to compile successfully with msvc
2022-12-09 22:35:05 -05:00
Andrew Kelley
e945045437
Merge pull request #13850 from jacobly0/builtin-fallback
zig.h: fix and add builtin fallbacks
2022-12-09 22:19:40 -05:00
r00ster91
a01993e908 std.fmt escape functions: reflect printability of space in test 2022-12-09 21:57:17 +01:00
r00ster91
37b1707370 DepTokenizer.printUnderstandableChar: consider space printable
This makes the function consider space to be printable as well (because it is)
and simplifies that function.
2022-12-09 21:57:17 +01:00
r00ster91
45650f7003 std.ascii: more tests 2022-12-09 21:57:17 +01:00
r00ster91
0162a0868c isHex, isAlphanumeric: prong reorder
On x86 interestingly I can see a reduction in codesize by 1 instruction with this.
While not necessarily faster, it might still reduce codesize a bit and this ordering is also more logical
because it follows ASCII table order. Rust's std uses this ordering too.
See https://zig.godbolt.org/z/PqodY8YqY for the difference.
2022-12-09 21:57:17 +01:00
r00ster91
19dbc5805c fix(perf): remove LUT
This makes it so that we no longer use a LUT (Look-Up Table):
* The code is much simpler and easier to understand now.
* Using a LUT means we rely on a warm cache.
  Relying on the cache like this results in inconsistent performance and in many cases codegen will be worse.
  Also as @topolarity once pointed out, in some cases while it seems like the code may branch, it actually doesn't:
  https://github.com/ziglang/zig/pull/11629#issuecomment-1213641429
* Other languages' standard libraries don't do this either.
  JFF I wanted to see what other languages codegen compared to us now:
  https://rust.godbolt.org/z/Te4ax9Edf, https://zig.godbolt.org/z/nTbYedWKv
  So we are pretty much on par or better than other languages now.
2022-12-09 21:57:17 +01:00
r00ster91
626e02a429 docs: minor improvements 2022-12-09 21:57:17 +01:00
r00ster91
6b7d9b34e8 api(std.ascii): remove deprecated decls 2022-12-09 21:57:17 +01:00
Jakub Konka
f7fea080b2 macho+zld: skip atomless synthetic globals in dead_strip
They are implicitly marked live.
2022-12-09 21:12:38 +01:00
Jacob Young
a2854f71dc zig.h: fix and add builtin fallbacks 2022-12-09 13:40:55 -05:00
Jakub Konka
bd5a8f86a1
Merge pull request #13843 from ziglang/dwarf-abs-paths
debug info: resolve relative paths to source files into absolute paths
2022-12-09 19:18:06 +01:00
Evin Yulo
d0172488b2 langref: update anonymous struct naming
Closes #13841
2022-12-09 19:59:47 +02:00
Frank Denis
c49e4d534f
Improve and remove duplicate doNotOptimizeAway() implementations (#13790)
* Improve and remove duplicate doNotOptimizeAway() implementations

We currently have two doNotOptimizeAway() implementations, one in
std.math and the other one in std.mem.

Maybe we should deprecate one. In the meantime, the std.math one
now just calls the std.mem one.

In a comptime environment, just ignore the value. Previously,
std.mem.doNotOptimizeAway() did not work at comptime.

If the value fits in a CPU register, just tell the compiler we
need that value to be computed, without clobbering anything else.

Only clobber all possibly escaped memory on pointers or large arrays.

Add tests by the way since we didn't had any (we had, but only
indirect ones).
2022-12-09 18:22:50 +01:00
Manlio Perillo
65f35a76f9 langref: consistently use comptime-known and runtime-known 2022-12-09 18:24:40 +02:00