diff options
| author | Pavel Verigo <paul.verigo@gmail.com> | 2024-06-14 20:28:50 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2024-06-15 11:28:16 +0200 |
| commit | 7829be6ee07aba6574fa5035c3d33023b3e23de7 (patch) | |
| tree | 5ed05356ba74f0fe2ac6e07de7d9199a0f71a154 /src/arch | |
| parent | 82a934bb912241809ac8029e1fa5843092a7fdf6 (diff) | |
| download | zig-7829be6ee07aba6574fa5035c3d33023b3e23de7.tar.gz zig-7829be6ee07aba6574fa5035c3d33023b3e23de7.zip | |
stage2-wasm: enum bigint <= 128 bits
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/wasm/CodeGen.zig | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig index fe94c06136..23ca2e1075 100644 --- a/src/arch/wasm/CodeGen.zig +++ b/src/arch/wasm/CodeGen.zig @@ -1727,7 +1727,6 @@ fn isByRef(ty: Type, mod: *Module) bool { .Bool, .ErrorSet, .Fn, - .Enum, .AnyFrame, => return false, @@ -1750,6 +1749,7 @@ fn isByRef(ty: Type, mod: *Module) bool { }, .Vector => return determineSimdStoreStrategy(ty, mod) == .unrolled, .Int => return ty.intInfo(mod).bits > 64, + .Enum => return ty.intInfo(mod).bits > 64, .Float => return ty.floatBits(target) > 64, .ErrorUnion => { const pl_ty = ty.errorUnionPayload(mod); @@ -2404,7 +2404,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE return; } }, - .Int, .Float => if (abi_size > 8 and abi_size <= 16) { + .Int, .Enum, .Float => if (abi_size > 8 and abi_size <= 16) { try func.emitWValue(lhs); const lsb = try func.load(rhs, Type.u64, 0); try func.store(.{ .stack = {} }, lsb, Type.u64, 0 + lhs.offset()); @@ -3187,12 +3187,10 @@ fn toTwosComplement(value: anytype, bits: u7) std.meta.Int(.unsigned, @typeInfo( return @as(WantedT, @intCast(result)); } -/// This function is intended to assert that `isByRef` returns `false` for `ty`. -/// However such an assertion fails on the behavior tests currently. +/// Asserts that `isByRef` returns `false` for `ty`. fn lowerConstant(func: *CodeGen, val: Value, ty: Type) InnerError!WValue { const mod = func.bin_file.base.comp.module.?; - // TODO: enable this assertion - //assert(!isByRef(ty, mod)); + assert(!isByRef(ty, mod)); const ip = &mod.intern_pool; if (val.isUndefDeep(mod)) return func.emitUndefined(ty); |
