fixups for @splat
* Fix codegen for splat - instead of giving vectors of length N to shufflevector for both of the operands, it gives vectors of length 1. The mask vector is the only one that needs N elements. * Separate Splat into SplatSrc and SplatGen; the `len` is not needed once it gets to codegen since it is redundant with the result type. * Refactor compile error for wrong vector element type so that the compile error message is not duplicated in zig source code * Improve implementation to correctly handle comptime values such as undefined and lazy values. * Improve compile error for bad vector element type to point to the correct place. * Delete dead code. * Modify behavior test to use an array cast instead of vector element indexing since I'm merging this splat commit out-of-order from Shawn's patch set.
This commit is contained in:
@@ -6514,7 +6514,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
\\ var v = @splat(4, c);
|
||||
\\}
|
||||
,
|
||||
"tmp.zig:3:20: error: vector element type must be integer, float, bool, or pointer; 'comptime_int' is invalid",
|
||||
"tmp.zig:3:23: error: vector element type must be integer, float, bool, or pointer; 'comptime_int' is invalid",
|
||||
);
|
||||
|
||||
cases.add("compileLog of tagged enum doesn't crash the compiler",
|
||||
|
||||
Reference in New Issue
Block a user