Commit Graph

1645 Commits

Author SHA1 Message Date
antlilja 2396806165 Add LLVM bitcode writer 2024-02-21 16:24:59 +01:00
antlilja 4653fc4bb4 LLVM Builder: Add dbg.declare and dbg.value intrinsics 2024-02-21 16:24:59 +01:00
antlilja 15029590ee LLVM Builder: Add integer values to more enums fields 2024-02-21 16:24:59 +01:00
antlilja ec5a433fdf Fix FastMath packed struct
* Added missing legacy field (unused_algebra)
* Made struct correct size (u32 -> u8)
2024-02-21 16:24:59 +01:00
antlilja 7cb8813743 Added value_indices and valueIndex to Function
value_indices keeps track of the value index of
each instruction in the function (i.e skips
instruction which do not have a result)
2024-02-21 16:24:59 +01:00
antlilja 423c2c3a27 Made .block = false in WipFunction.hasResultWip 2024-02-21 16:24:59 +01:00
antlilja c57b4e70b0 Builder: Add function_attributes_set 2024-02-21 16:24:59 +01:00
antlilja 52e8434022 Added opcode functions to Instruction/Constant.Tag 2024-02-21 16:24:59 +01:00
antlilja ff76ba64d6 Added values to AtomicRmw.Operation enum fields 2024-02-21 16:24:59 +01:00
antlilja 6df8302be6 Fixed values in AtomicOrdering enum 2024-02-21 16:24:59 +01:00
antlilja fd3b81f93b LLVM Builder: Add toLlvm helper to Alignment 2024-02-21 16:24:59 +01:00
antlilja 2801bf6400 LLVM Builder: Add strtab helper to String 2024-02-21 16:24:59 +01:00
antlilja 9ccd7158b9 LLVM Builder: Make Type.Simple reflect LLVM codes 2024-02-21 16:24:59 +01:00
antlilja 1d94e9ef83 LLVM: Make sure child types get added first
The LLVM bitcode requires all type references in
structs to be to earlier defined types.

We make sure types are ordered in the builder
itself in order to avoid having to iterate the
types multiple times and changing the values
of type indicies.
2024-02-21 16:24:59 +01:00
antlilja 8feae5d2d5 LLVM: Assign correct values to enum/union tags 2024-02-21 16:24:59 +01:00
Jacob Young ec7293422d llvm: fix c abi for structs not passed in registers
Closes #18916
2024-02-20 23:36:47 +01:00
Jacob Young 97290e0bfc cbe: make more use of InternPool.Index.Slice
Attempts to fix the current CI failures introduced by #18983.
2024-02-19 19:32:06 -08:00
Robin Voetter dd4d320eb9 Merge pull request #18948 from alichraghi/vector
spirv: use extended instructions whenever possible
2024-02-17 14:01:07 +01:00
Jacob Young 6f08e17229 InternPool: make more use of NullTerminatedString.Slice
This should avoid the random pointer invalidation crashes.

Closes #18954
2024-02-16 00:27:25 -08:00
Ali Chraghi 23b7075656 spirv: add capability to compile with x86_64 backend 2024-02-15 17:28:15 +03:30
Ali Chraghi 44c31194e3 spirv: use extended instructions whenever possible 2024-02-15 17:25:44 +03:30
Jacob Young 6fe90a913a llvm: fix lowering of recursive debug info
This change allows recursing over types that are currently being
resolved fully with a second pass of forward resolution.

Closes #16414
2024-02-15 02:46:18 -08:00
Jacob Young a9f738e56b x86_64: implement c abi for bool vectors 2024-02-12 05:25:07 +01:00
Ali Chraghi 72bd1cd378 spirv: remove now-redundant isUnused calls from AIR handler functions 2024-02-10 09:50:02 +03:30
Ali Chraghi 5ee96688a7 spirv: emit vectorized operations 2024-02-09 16:40:34 +03:30
Veikka Tuominen ddcea2cad4 Merge pull request #18857 from alichraghi/shader
spirv: make rusticl the primary testing implementation
2024-02-09 14:11:31 +02:00
Ali Chraghi 37b0aa600a spirv: make rusticl the primary testing implementation 2024-02-09 09:27:08 +03:30
Ali Chraghi eb2d61d02e spirv: merge construct(Struct/Vector/Array) into constructComposite 2024-02-09 09:27:05 +03:30
Andrew Kelley 3122fd0ba0 Merge pull request #17634 from ianprime0509/type-erased-writer
Add type-erased writer and GenericWriter
2024-02-07 23:52:53 -08:00
Jacob Young 38c2a25735 Builder: fix memory leaks 2024-02-06 22:31:13 -05:00
Andrew Kelley 78f15bc714 compiler: rename value.zig to Value.zig
This commit only does the file rename to be friendlier to version
control conflicts.
2024-02-05 18:13:07 -07:00
Ali Chraghi 739108c9f0 spirv: support enum integer values in Assembler 2024-02-05 11:55:14 +03:30
Ali Chraghi b41aad0193 spirv: emit vectors whenever we can 2024-02-05 11:55:14 +03:30
Ali Chraghi afa7793351 spirv: basic shader support 2024-02-05 11:55:14 +03:30
Robin Voetter 7634a115c5 Merge pull request #18580 from Snektron/spirv-more-vectors
spirv: more vector operations
2024-02-05 09:24:49 +01:00
Jacob Young eaa6218f09 x86_64: fix errors compiling the compiler
This fixes issues targetting both `x86_64-linux` and `x86_64-macos` with
the self-hosted backend.
2024-02-04 22:58:38 -05:00
Robin Voetter 2511106150 spirv: air vector_store_element 2024-02-04 19:09:34 +01:00
Robin Voetter 1d548aa2aa spirv: air splat 2024-02-04 19:09:33 +01:00
Robin Voetter 76d5696434 spirv: air abs 2024-02-04 19:09:32 +01:00
Robin Voetter 631d1b63a8 spirv: fix shuffle properly 2024-02-04 19:09:32 +01:00
Robin Voetter 9641d2ebdb spirv: vectorize max, min 2024-02-04 19:09:31 +01:00
Robin Voetter 9f0227a326 spirv: vectorize int_cast, trunc 2024-02-04 19:09:31 +01:00
Robin Voetter 408c117246 spirv: air is_(non_)null_ptr, optional_payload_ptr 2024-02-04 19:09:30 +01:00
Robin Voetter 7dfd403da1 spirv: air mul_add 2024-02-04 19:09:30 +01:00
Robin Voetter 345d6e280d spirv: air int_from_bool 2024-02-04 19:09:29 +01:00
Robin Voetter 77ef78a0ef spirv: clean up arithmeticTypeInfo a bit
- No longer returns an error
- Returns more useful vector info
2024-02-04 19:09:29 +01:00
Robin Voetter 54ec936549 spirv: wrap strange its before instead of after operation
Wrapping strange integers before an operation was initially
done as an attempt to minimize the amount of normalizations
required: This way, there would not be a normalization
necessary between two modular operations. This was a
premature optimization, since the resulting logic is more
complicated than naive way of wrapping the result after
the operation.

This commit updates handling of strange integers to do
wrapping after each operation. It also seems slightly
more efficient in terms of size of generated code, as
it reduces the size of the behavior tests binary by
about 1%.
2024-02-04 19:09:28 +01:00
Robin Voetter b67d983abd spirv: vectorize add/sub overflow 2024-02-04 19:09:27 +01:00
Robin Voetter 761594e226 spirv: reduce, reduce_optimized 2024-02-04 19:09:27 +01:00
Robin Voetter 2f815853dc spirv: shlWithOverflow 2024-02-04 19:09:26 +01:00