| ... | ... | @@ -1727,7 +1727,6 @@ fn isByRef(ty: Type, mod: *Module) bool { |
| 1727 | 1727 | .Bool, |
| 1728 | 1728 | .ErrorSet, |
| 1729 | 1729 | .Fn, |
| 1730 | | .Enum, |
| 1731 | 1730 | .AnyFrame, |
| 1732 | 1731 | => return false, |
| 1733 | 1732 | |
| ... | ... | @@ -1750,6 +1749,7 @@ fn isByRef(ty: Type, mod: *Module) bool { |
| 1750 | 1749 | }, |
| 1751 | 1750 | .Vector => return determineSimdStoreStrategy(ty, mod) == .unrolled, |
| 1752 | 1751 | .Int => return ty.intInfo(mod).bits > 64, |
| 1752 | .Enum => return ty.intInfo(mod).bits > 64, |
| 1753 | 1753 | .Float => return ty.floatBits(target) > 64, |
| 1754 | 1754 | .ErrorUnion => { |
| 1755 | 1755 | const pl_ty = ty.errorUnionPayload(mod); |
| ... | ... | @@ -2404,7 +2404,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2404 | 2404 | return; |
| 2405 | 2405 | } |
| 2406 | 2406 | }, |
| 2407 | | .Int, .Float => if (abi_size > 8 and abi_size <= 16) { |
| 2407 | .Int, .Enum, .Float => if (abi_size > 8 and abi_size <= 16) { |
| 2408 | 2408 | try func.emitWValue(lhs); |
| 2409 | 2409 | const lsb = try func.load(rhs, Type.u64, 0); |
| 2410 | 2410 | 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( |
| 3187 | 3187 | return @as(WantedT, @intCast(result)); |
| 3188 | 3188 | } |
| 3189 | 3189 | |
| 3190 | | /// This function is intended to assert that `isByRef` returns `false` for `ty`. |
| 3191 | | /// However such an assertion fails on the behavior tests currently. |
| 3190 | /// Asserts that `isByRef` returns `false` for `ty`. |
| 3192 | 3191 | fn lowerConstant(func: *CodeGen, val: Value, ty: Type) InnerError!WValue { |
| 3193 | 3192 | const mod = func.bin_file.base.comp.module.?; |
| 3194 | | // TODO: enable this assertion |
| 3195 | | //assert(!isByRef(ty, mod)); |
| 3193 | assert(!isByRef(ty, mod)); |
| 3196 | 3194 | const ip = &mod.intern_pool; |
| 3197 | 3195 | if (val.isUndefDeep(mod)) return func.emitUndefined(ty); |
| 3198 | 3196 | |