This was causing a zig2 miscomp, which emitted slightly broken debug
information, which caused extremely slow stack unwinding. We're working
on fixing or reporting this upstream, but we can use this workaround for
now, because GCC guarantees arithmetic signed shift.
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>
* Make it work for thumb and aarch64.
* Clean up std.os.windows.teb() a bit.
I also updated stage1/zig.h since the changes are backwards-compatible and are
necessary due to the std.os.windows changes that call the newly-added functions.
As well as being necessary for the `CallingConvention` changes, this
update includes the following notable changes:
* Fix unlabeled `break` targeting the wrong scope in the presence of
labeled continue, unblocking #21422
* Implement `@FieldType`
* Implement `@splat` on arrays
Signed-off-by: mlugg <mlugg@mlugg.co.uk>
This was causing zig2.exe to crash during bootstrap, because there was an atomic
load of read-only memory, and the attempt to write to it as part of the (idempotent)
atomic exchange was invalid.
Aligned reads (of u32 / u64) are atomic on x86 / x64, so this is replaced with an
optimization-proof load (`__iso_volatile_load8*`) and a reordering barrier.
Notable changes in this update:
127198e58c fixes building zig2 artifact on
macOS Sonoma 14.0 (more specifically the SDK 14.0 linker).
a8d2ed8065 fixed some alignment edge
cases which is needed to do the store_hash=false change in the compiler
source code.
df5f0517b3 preserves result type
information through the address-of operator.
Needed due to the breaking changes to `@splat` which are used by the
self-hosted compiler.
This update also includes the improvement that allows casting builtins
to infer the result type through optionals and error unions.
* `CMakeLists.txt`: support the weird `uname -m` output.
* `CMakeLists.txt`: detect and use the C compiler's default arm mode.
* cbe: support gcc with both `f128` and `u128` emulated.
* std.os.linux.thumb: fix incorrectly passed asm inputs.
This is needed in order to remove math.{min,max} from std in favour of
the builtins, since the builtins need the behavior fix from the previous
commit.
Note from Andrew: I updated this commit with zig1.wasm built by me.
Signed-off-by: Andrew Kelley <andrew@ziglang.org>
This is needed because bug fixes to the C backend are required in order
to actually update the standard library and compiler sources to use the
new `@memcpy` and `@memset` semantics.
This requires manual defines before C99 which may not have stdint.h.
Also have update-zig1 leave a copy of lib/zig.h in stage1/zig.h, which
allows lib/zig.h to be updated without needing to update zig1.wasm.
Note that since the object already existed with the exact same contents,
this completely avoids repo bloat due to zig.h changes.