Commit Graph

36606 Commits

Author SHA1 Message Date
pfg c748eb2416 std.Build: fix setLibCFile() to add step dependencies 2025-01-17 20:42:55 +01:00
Andrew Kelley 4bace0f621 Merge pull request #22386 from jacobly0/x86_64-rewrite
x86_64: begin rewriting instruction selection
2025-01-17 01:20:11 -05:00
Jacob Young 8c8dfb35f3 x86_64: fix crashes compiling the compiler and tests 2025-01-16 20:47:30 -05:00
Jacob Young c3d33440f0 x86_64: pass more behavior tests 2025-01-16 20:47:30 -05:00
Jacob Young 666d76d85c x86_64: implement load and store 2025-01-16 20:47:30 -05:00
Jacob Young 6d1fc0f51c x86_64: implement aggregate access 2025-01-16 20:47:30 -05:00
Jacob Young 63730441d0 x86_64: implement union access 2025-01-16 20:47:30 -05:00
Jacob Young 5069f574f4 x86_64: remove pointless jump to epilogue 2025-01-16 20:47:30 -05:00
Jacob Young 3240adfa16 x86_64: implement pointer addition and subtraction 2025-01-16 20:47:30 -05:00
Jacob Young 0d9079f466 x86_64: implement element access 2025-01-16 20:47:30 -05:00
Jacob Young 870443f7fa x86_64: implement passing undefined as a call arg with the new cc 2025-01-16 20:47:30 -05:00
Jacob Young 094ac8c3dc x86_64: fix f16 miscomp exposed by new calling convention 2025-01-16 20:47:30 -05:00
Jacob Young b7acd97789 x86_64: fix hazards exposed by new calling convention 2025-01-16 20:47:30 -05:00
Jacob Young 074232b3e5 x86_64: implement a custom calling convention for the Zig language 2025-01-16 20:47:30 -05:00
Jacob Young 3c74a478a4 x86_64: fix unnecessary register saving 2025-01-16 20:42:08 -05:00
Jacob Young 7f22c41e09 x86_64: add some ReleaseSmall support 2025-01-16 20:42:08 -05:00
Jacob Young df7661b8d3 x86_64: optimize value copying slightly 2025-01-16 20:42:08 -05:00
Jacob Young e5d5a8bc4e x86_64: implement switch jump tables 2025-01-16 20:42:08 -05:00
Jacob Young ac1a975f9b x86_64: implement clz and not 2025-01-16 20:42:08 -05:00
Jacob Young a7efc56d86 x86_64: the previous loop abstraction was too confusing
The temp usage was non-obvious, and implicit instructions hard to
reason about.
2025-01-16 20:42:08 -05:00
Jacob Young a1828ebcda x86_64: demolish the old 2025-01-16 20:42:08 -05:00
Jacob Young 73a42953c9 x86_64: 2 means better 2025-01-16 20:42:08 -05:00
Jacob Young b9c4400776 x86_64: implement fallback for pcmpeqq 2025-01-16 20:42:08 -05:00
Jacob Young c4b93555b0 x86_64: testing 2025-01-16 20:42:08 -05:00
Jacob Young 7c713251ca x86_64: looped instructions 2025-01-16 20:42:08 -05:00
Jacob Young beadf702b8 x86_64: rewrite arithmetic 2025-01-16 20:42:08 -05:00
Jacob Young af1191ea8b x86_64: rewrite 2025-01-16 20:42:07 -05:00
Jacob Young 257054a146 Revert "disable flaky incremental compilation tests"
This reverts commit 133abdeda2 but keeps
the tests disabled for the wasm target, which is the only configuration
that seems to fail, even though the error looks like a frontend error.
2025-01-16 20:02:49 -05:00
Matthew Lugg 4d8c24c6c5 Merge pull request #22505 from mlugg/easier-modify-builtin
std.builtin.Type renames, and make it easier to modify std.builtin
2025-01-16 22:20:02 +00:00
Andrew Kelley 133abdeda2 disable flaky incremental compilation tests
tracking issue #22510
2025-01-16 13:13:11 -08:00
nobkd 4e8c436f69 autodoc: fix device width 2025-01-16 21:15:48 +01:00
max 961fc0e140 std.fs.Dir: update deleteTree doc comment to match function signature (#22509)
the actual parameter name is `sub_path` which is also referenced in other
comments describing the fuction.
2025-01-16 20:11:42 +00:00
mlugg 9804cc8bc6 all: update to std.builtin.Type.{Pointer,Array,StructField} field renames 2025-01-16 12:49:58 +00:00
mlugg 89a9cabafd std.builtin.Type: improve ergonomics of *const anyopaque fields
For representing struct field default values and array/pointer type
sentinel values, we use `*const anyopaque`, since there is no way for
`std.builtin.Type.StructField` etc to refer back to its `type` field.
However, when introspecting a type, this is quite awkward due to the
pointer casts necessary.

As such, this commit renames the `sentinel` fields to `sentinel_ptr`,
and the `default_value` field to `default_value_ptr`, and introduces
helper methods `sentinel()` and `defaultValue()` to load the values.
These methods are marked as `inline` because their return value, which
is always comptime-known, is very often required at comptime by use
sites, so this avoids having to annotate such calls with `comptime`.

This is a breaking change, although note that 0.14.0 is already a
breaking release for all users of `std.builtin.Type` due to the union
fields being renamed.
2025-01-16 12:49:58 +00:00
mlugg 0cc9d68b77 stage1: update zig1.wasm
Implementing the changes from the prior commit, to prepare for the
following commit.

This also means that zig1 now uses the new value interpret mode, so
that adding and removing fields from `std.builtin` types is easier.

Signed-off-by: mlugg <mlugg@mlugg.co.uk>
2025-01-16 12:49:58 +00:00
mlugg 726c94d5f1 Sema: prepare for sentinel -> sentinel_ptr field rename
The commit 2 after this will explain this diff.
2025-01-16 12:49:58 +00:00
mlugg b6abe1dbf7 compiler: make it easier to apply breaking changes to std.builtin
Documentation for this will be on the wiki shortly.

Resolves: #21842
2025-01-16 12:49:48 +00:00
mlugg d00e05f186 all: update to std.builtin.Type.Pointer.Size field renames
This was done by regex substitution with `sed`. I then manually went
over the entire diff and fixed any incorrect changes.

This diff also changes a lot of `callconv(.C)` to `callconv(.c)`, since
my regex happened to also trigger here. I opted to leave these changes
in, since they *are* a correct migration, even if they're not the one I
was trying to do!
2025-01-16 12:46:29 +00:00
mlugg af6bad46cd std.builtin.Type: rename Pointer.Size fields to lowercase
This matches established naming conventions. Now is an opportune time to
make this change, since we're already performing breaking changes to
`std.builtin.Type`.
2025-01-16 11:37:46 +00:00
Andrew Kelley d4fe4698d9 Merge pull request #22220 from ziglang/wasm-linker
wasm linker: aggressive rewrite towards Data-Oriented Design
2025-01-16 04:20:41 -05:00
Andrew Kelley eda8b6e137 link.MachO: fix error reporting in flushModule 2025-01-15 20:21:33 -08:00
Andrew Kelley ed810eeb06 link.Elf: fix error reporting for failed hot swap 2025-01-15 20:16:40 -08:00
Andrew Kelley e4868693a5 Compilation: windows doesn't prelink yet 2025-01-15 19:59:53 -08:00
Andrew Kelley 24bdb42a23 test/link/wasm/shared-memory: update to better linker behavior
now it's smarter about omitting tls stuff if there end up being no
TLS data sections
2025-01-15 19:44:20 -08:00
Andrew Kelley cf898e242a std.Build.Step.CheckObject: better EOF handling
when unexpected end of stream occurs, just add that as a token into the
text
2025-01-15 19:43:46 -08:00
Andrew Kelley 605311211b wasm linker: omit data count section when value is zero 2025-01-15 19:43:31 -08:00
Andrew Kelley 744bb5d16a wasm linker: change rules about symbol visibility
export by default means export, as expected. if you want hidden
visibility then use hidden visibility.
2025-01-15 18:31:44 -08:00
Andrew Kelley dcb4134835 wasm linker: delete commented out code
this logic has not yet been ported to the new design, but the logic is
safe and sound in the git history and does not need to also live as
commented out code
2025-01-15 18:19:46 -08:00
Andrew Kelley 9dd6efb7e4 wasm linker: fix TLS data segments
fix calculation of alignment and size

include __tls_align and __tls_size globals along with __tls_base

include them only if the TLS segment is emitted

add missing reloc logic for memory_addr_tls_sleb

fix name of data segments to include only the prefix
2025-01-15 18:17:37 -08:00
Andrew Kelley 10db1b9eda wasm linker: fix explicit exports not affecting object files 2025-01-15 18:17:20 -08:00