diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-30 11:58:32 -0500 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-01-31 23:00:34 -0500 |
| commit | afa74c6b213efb1ff85b86ce4a9edd5cc03e5a9b (patch) | |
| tree | 6a4d326e31eda55c359ec1e2aef05681bbef0298 /src/Zcu.zig | |
| parent | 8195b64f575acaed9dbc59e745a98acebb71dc60 (diff) | |
| download | zig-afa74c6b213efb1ff85b86ce4a9edd5cc03e5a9b.tar.gz zig-afa74c6b213efb1ff85b86ce4a9edd5cc03e5a9b.zip | |
Sema: introduce all_vector_instructions backend feature
Sema is arbitrarily scalarizing some operations, which means that when I
try to implement vectorized versions of those operations in a backend,
they are impossible to test due to Sema not producing them. Now, I can
implement them and then temporarily enable the new feature for that
backend in order to test them. Once the backend supports all of them,
the feature can be permanently enabled.
This also deletes the Air instructions `int_from_bool` and
`int_from_ptr`, which are just bitcasts with a fixed result type, since
changing `un_op` to `ty_op` takes up the same amount of memory.
Diffstat (limited to 'src/Zcu.zig')
| -rw-r--r-- | src/Zcu.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Zcu.zig b/src/Zcu.zig index 13b302180d..74653bce01 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -3336,6 +3336,15 @@ pub const Feature = enum { safety_checked_instructions, /// If the backend supports running from another thread. separate_thread, + /// If the backend supports the following AIR instructions with vector types: + /// * `Air.Inst.Tag.bit_and` + /// * `Air.Inst.Tag.bit_or` + /// * `Air.Inst.Tag.bitcast` + /// * `Air.Inst.Tag.float_from_int` + /// * `Air.Inst.Tag.fptrunc` + /// * `Air.Inst.Tag.int_from_float` + /// If not supported, Sema will scalarize the operation. + all_vector_instructions, }; pub fn backendSupportsFeature(zcu: *const Zcu, comptime feature: Feature) bool { |
