Previously this worked for array to vector where the element type
matched exactly (e.g `[4]u8` to `@Vector(4, u8)`) since that is
performed with a simple `.bitcast` operation, but now it also works for
types where the array is coercible to the vector type (e.g `[4]u8` to
`@Vector(4, u16)`).
This is consistent with how coercion for vectors work. So now you can do
this:
```
var a: @Vector(2, u16) = .{1, 2};
var b: @Vector(2, u8) = .{2, 1};
const c = @min(a, b);
```
where previously you had to cast explicitly:
```
var a: @Vector(2, u16) = .{1, 2};
var b: @Vector(2, u8) = .{2, 1};
var c: @Vector(2, u16) = b;
const c = @min(a, c);
```
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.
This reverts commit 3370d58956.
This commit was done with an LLVM build that did not have assertions
enabled. There are LLVM assertions being triggered due to this commit.
Reopens#10627Reopens#12013Reopens#12027
This change is the Zig counterpart to https://reviews.llvm.org/D110413
Since we lower some libcalls directly (just like clang does), we need to
make sure that the ABI we call with matches the ABI of the compiler-rt
we are providing (and also the ABI expected by LLVM).
While I was at it, I noticed some flawed vector handling in the binary
soft float ops in stage 1, so I shored up the logic a bit and expanded
an existing test to cover the missing functionality.
This follows LLVM14's lead on vector alignment, which computes byte
count based on the length premultiplied by bits.
This commit also disables behavior tests regressed by LLVM 14, only for
stage1. stage2 fortunately does not trip the regression.
Rename all references of sparcv9 to sparc64, to make Zig align more with
other projects. Also, added new function to convert glibc arch name to Zig
arch name, since it refers to the architecture as sparcv9.
This is based on the suggestion by @kubkon in PR 11847.
(https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)