| Age | Commit message (Collapse) | Author |
|
|
|
|
|
CBE: minor optimizations to output source
|
|
change semantics of `@memcpy` and `@memset`
|
|
|
|
Pointer comparisons were triggering `-Wcompare-distinct-pointer-types`
before this fix, which adds `(void*)` casts if the lhs type and rhs type
do not match pointer sizeness.
|
|
store:
The value to store may be undefined, in which case the destination
memory region has undefined bytes after this instruction is
evaluated. In such case ignoring this instruction is legal
lowering.
store_safe:
Same as `store`, except if the value to store is undefined, the
memory region should be filled with 0xaa bytes, and any other
safety metadata such as Valgrind integrations should be notified of
this memory region being undefined.
|
|
It does the same thing but has fewer bytes in the output.
|
|
Previously, this code casted the array pointer to u8 pointer, but I
removed that in a different commit. This commit restores the cast, but
instead of hard-coding u8, it uses the destination element pointer,
since memset now supports arbitrary element types.
|
|
Also introduce memset_safe AIR tag and support it in C backend and LLVM
backend.
|
|
|
|
* Sema: upgrade operands to array pointers if possible when emitting
AIR.
* Implement safety checks for length mismatch and aliasing.
* AIR: make ptrtoint support slice operands. Implement in LLVM backend.
* C backend: implement new `@memset` semantics. `@memcpy` is not done
yet.
|
|
|
|
|
|
|
|
|
|
* Disable 128-bit atomics for x86_64 generic (currently also baseline)
because they require heavy abi agreement to correctly lower.
** This is a breaking change **
* Enable 128-bit atomics for aarch64 in Sema since it just works.
|
|
These need `zig_atomic`, unlike int min/max.
|
|
Fixes bugs with a previous fix to the f16 abi on x86 darwin.
|
|
|
|
Since the Zig language documentation claims support for `.Min` and
`.Max` in `@atomicRmw` with floats, allow in Sema and implement for both
the llvm and C backends.
|
|
|
|
|
|
This is a partial rewrite of Liveness, so has some other notable changes:
- A proper multi-pass system to prevent code duplication
- Better logging
- Minor bugfixes
|
|
Also fix the many revealed bugs.
|
|
|
|
|
|
|
|
This lets us generate the store with knowledge of the type to be stored.
Therefore, we can avoid generating garbage Air with stores through
pointers to comptime-only types which backends cannot lower.
Closes #13410
Closes #15122
|
|
* @workItemId returns the index of the work item in a work group for a
dimension.
* @workGroupId returns the index of the work group in the kernel dispatch for a
dimension.
* @workGroupSize returns the size of the work group for a dimension.
These builtins are mainly useful for GPU backends. They are currently only
implemented for the AMDGCN LLVM backend.
|
|
We just checked that inst_child_ty was effectively a zero-bit type, so
it is certainly not the non-zero alignment we are looking for.
Closes #15085
|
|
fixes `error(compilation): clang failed with stderr: error: array type 'uint32_t[10]' (aka 'unsigned int[10]') is not assignable`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also, bigint add and sub which is all I was actually trying to do.
|
|
|
|
|
|
|
|
|
|
This introduces a new builtin function that compiles down to something that results in an illegal instruction exception/interrupt.
It can be used to exit a program abnormally.
This implements the builtin for all backends.
|
|
Replace `ArrayList` with `ArrayHashMap` since we want to be able to
remove by element.
|
|
Many `Type`s can correspond to the same `CType`, so this reduces the
number of used locals by 27760 when compiling only-c.
Also, disabled some tests that were only passing by accident and
shouldn't really be considered working.
|
|
Turns out f(...) will be supported one day.
|
|
|
|
It should be Sema's job to check this anyway.
|