Merge pull request #18729 from Vexu/fixes

Fix some generic{Reader,Writer} related issues
This commit is contained in:
Andrew Kelley
2024-01-29 13:07:37 -08:00
committed by GitHub
6 changed files with 113 additions and 3 deletions

View File

@@ -8694,10 +8694,10 @@ pub const FuncGen = struct {
if (!result_is_ref) {
return self.dg.todo("implement bitcast vector to non-ref array", .{});
}
const array_ptr = try self.buildAllocaWorkaround(inst_ty, .default);
const alignment = inst_ty.abiAlignment(mod).toLlvm();
const array_ptr = try self.buildAllocaWorkaround(inst_ty, alignment);
const bitcast_ok = elem_ty.bitSize(mod) == elem_ty.abiSize(mod) * 8;
if (bitcast_ok) {
const alignment = inst_ty.abiAlignment(mod).toLlvm();
_ = try self.wip.store(.normal, operand, array_ptr, alignment);
} else {
// If the ABI size of the element type is not evenly divisible by size in bits;