| Age | Commit message (Collapse) | Author |
|
Instead of doing everything at once which is a hopelessly large task,
this introduces a piecemeal transition that can be done in small
increments at a time.
This is a minimal changeset that keeps the compiler compiling. It only
uses the InternPool for a small set of types.
Behavior tests are not passing.
Air.Inst.Ref and Zir.Inst.Ref are separated into different enums but
compile-time verified to have the same fields in the same order.
The large set of changes is mainly to deal with the fact that most Type
and Value methods now require a Module to be passed in, so that the
InternPool object can be accessed.
|
|
Fixes https://github.com/ziglang/zig/issues/14465
For aarch64, LLVM was crashing because Zig commands it to generate FPU code
even when there is no FPU present. This commit implements the necessary checks
to avoid this undesired situation and aarch64 can be compiled again with
no FPU.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* move `ptrBitWidth` from Arch to Target since it needs to know about the abi
* double isn't always 8 bits
* AVR uses 1-byte alignment for everything in GCC
|
|
Closes #15848
|
|
|
|
add runtime safety for noreturn function returning
|
|
Signed-off-by: Tw <tw19881113@gmail.com>
|
|
spirv: make more tests pass
|
|
This is in preparation of removing indirect lowering again. Also
modifies constant() to accept a repr so that both direct as well
as indirect representations can be generated. Indirect is not yet
used, but will be used for globals.
|
|
Previously the tag type was generated even if it was nonexistant,
triggering an assertion that an integer type should never have
zero bits. Now its only generated when the tag type is actually emitted.
|
|
Implements the ptr_elem_val air tag. Implementation is unified
with ptr_elem_ptr.
|
|
Implments the ptr_sub air tag. The code is unified with that of ptr_add.
|
|
|
|
|
|
Implements the ptr_add air tag for spirv.
The implementation for slices is probably wrong, but there seems to be no test for this...
|
|
reduce some code duplication
|
|
The first dereference of PtrAccessChain returns a pointer of the same type
as the base pointer, in contrast to AccessChain, where the first dereference
returns a pointer of the dereferenced type of the base pointer.
|
|
This instruction is not really working well in the LLVM SPIRV translator,
as it is not implemented.
This commit also intruces the constructStruct helper function to initialize
structs at runtime. This is ALSO buggy in the translator, and we must work
around OpCompositeConstruct not working when some of the constituents are
runtime-known only.
Some other improvements are made:
- improved variable() so that it is more useful and no longer requires the
address space. It always puts values in the Function address space,
and returns a pointer to the Generic address space
- adds a boolToInt utility function
|
|
This ensures that we can also cast enums and error sets here. In the future
this function will need to be changed to support composite and strange
integers, but that is fine.
|
|
It turns out that the Khronos LLVM SPIRV translator does not support OpPtrEqual.
Therefore, this instruction is emitted using a series of conversions.
This commit breaks intToEnum, because enum was removed from the arithmetic type
info. The enum should be converted to an int before this function is called.
|
|
|
|
Closes #15221
|
|
|
|
|
|
|
|
spirv: attempting to get the 'basic' behavior tests running
|
|
|
|
|
|
The same declaration can be added to the dependency set multiple
times, and in this case we still need to emit it once. By making
this list a hash map instead, we can do that quite easily.
This commit also introduces some additional debug logging regarding
decls.
|
|
This implements the wrap_optional AIR instruction.
|
|
Implements lowering the AIR tag optional_payload.
Also fixes an issue with lowering constant ints.
|
|
Implements AIR lowering for is_null and is_non_null tags.
Additionally this cleans up and centralizes the logic to convert from 'direct'
representation to 'indirect' representation and vice-versa. The related functions,
as well as the functions that use it, are all moved near eachother so that the
conversion logic remains in a central place. Extracting/inserting fields
and loading/storing pointers should go through these functions.
|
|
The result-id and result-type-id of the OpPhi used to merge the
break values was not properly emitted, as some of the operands
were not written out. This caused an invalid spir-v module.
|
|
|
|
|
|
Implements code generation for the try air tag. This commit also adds
a utility `errorUnionLayout` function that helps keeping the layout
of a spir-v error union consistent.
|
|
resolve() is now able to emit instructions. If usage of this function is
interleaved with calls to emitRaw() and writeOperand(), then an
instruction may get inserted between operands, causing an invalid module.
The solution here is to just perform a temporary allocation.
|