authorgravatar for paul@plutojl.orgPaul Berg <paul@plutojl.org> 2024-02-12 14:05:34+01:00
committergravatar for paul@plutojl.orgPaul Berg <paul@plutojl.org> 2024-02-14 09:28:20+01:00
log11381662896e1961df2f94a5f044e892d9baf93a
tree9d90cbbbefb5078da27508d977ed3af72064e0ef
parent3f5593205dd687e9c637d7c34bd05b3ba53c2312

wasm: allow non-int vectors

The current Wasm ABI classification function fails to handle non-integer vectors because of the call to `intInfo`.

1 files changed, 2 insertions(+), 1 deletions(-)

src/arch/wasm/abi.zig+2-1
......@@ -45,7 +45,7 @@ pub fn classifyType(ty: Type, mod: *Module) [2]Class {
4545 }
4646 return classifyType(field_ty, mod);
4747 },
48 .Int, .Enum, .ErrorSet, .Vector => {
48 .Int, .Enum, .ErrorSet => {
4949 const int_bits = ty.intInfo(mod).bits;
5050 if (int_bits <= 64) return direct;
5151 if (int_bits <= 128) return .{ .direct, .direct };
......@@ -58,6 +58,7 @@ pub fn classifyType(ty: Type, mod: *Module) [2]Class {
5858 return memory;
5959 },
6060 .Bool => return direct,
61 .Vector => return direct,
6162 .Array => return memory,
6263 .Optional => {
6364 assert(ty.isPtrLikeOptional(mod));