| author | |
| committer | |
| log | 22945fbbdc1ec89def58f39ddc8c35502b6e05dd |
| tree | 2d30a01ac77771db9f74f3927fa86969f6fa94a9 |
| parent | 36faf76fe1eeb3aafcc4de94fc83fd8ca3b18b25 |
30 files changed, 547 insertions(+), 453 deletions(-)
src/Air/Legalize.zig+9-4| ... | ... | @@ -1503,7 +1503,7 @@ fn scalarizeBitcastBlockPayload(l: *Legalize, orig_inst: Air.Inst.Index) Error!? |
| 1503 | 1503 | l, |
| 1504 | 1504 | .store, |
| 1505 | 1505 | index_ptr, |
| 1506 | .fromValue(try pt.intValue(.usize, operand_ty.arrayLen(zcu))), | |
| 1506 | .fromValue(try pt.intValue(.usize, operand_ty.arrayLen(zcu) - 1)), | |
| 1507 | 1507 | ); |
| 1508 | 1508 | _ = uint_block.addBinOp(l, .store, result_ptr, .fromValue(try pt.intValue(uint_ty, 0))); |
| 1509 | 1509 | |
| ... | ... | @@ -1811,6 +1811,7 @@ fn scalarizeReduceBlockPayload(l: *Legalize, orig_inst: Air.Inst.Index, optimize |
| 1811 | 1811 | .Or, .Xor, .Add => switch (scalar_ty.zigTypeTag(zcu)) { |
| 1812 | 1812 | .int => try pt.intValue(scalar_ty, 0), |
| 1813 | 1813 | .float => try pt.floatValue(scalar_ty, 0.0), |
| 1814 | .bool => .false, | |
| 1814 | 1815 | else => unreachable, |
| 1815 | 1816 | }, |
| 1816 | 1817 | // identity for multiplication is 1 |
| ... | ... | @@ -1820,9 +1821,13 @@ fn scalarizeReduceBlockPayload(l: *Legalize, orig_inst: Air.Inst.Index, optimize |
| 1820 | 1821 | else => unreachable, |
| 1821 | 1822 | }, |
| 1822 | 1823 | // identity for AND is all 1 bits |
| 1823 | .And => switch (scalar_ty.intInfo(zcu).signedness) { | |
| 1824 | .unsigned => try scalar_ty.maxIntScalar(pt, scalar_ty), | |
| 1825 | .signed => try pt.intValue(scalar_ty, -1), | |
| 1824 | .And => switch (scalar_ty.zigTypeTag(zcu)) { | |
| 1825 | .int => switch (scalar_ty.intInfo(zcu).signedness) { | |
| 1826 | .unsigned => try scalar_ty.maxIntScalar(pt, scalar_ty), | |
| 1827 | .signed => try pt.intValue(scalar_ty, -1), | |
| 1828 | }, | |
| 1829 | .bool => .true, | |
| 1830 | else => unreachable, | |
| 1826 | 1831 | }, |
| 1827 | 1832 | // identity for @min is maximum value |
| 1828 | 1833 | .Min => switch (scalar_ty.zigTypeTag(zcu)) { |
src/Type.zig+2-2| ... | ... | @@ -935,7 +935,7 @@ pub fn abiAlignment(ty: Type, zcu: *const Zcu) Alignment { |
| 935 | 935 | const bytes = ((elem_bits * vector_type.len) + 7) / 8; |
| 936 | 936 | return .fromByteUnits(std.math.ceilPowerOfTwoAssert(u32, bytes)); |
| 937 | 937 | }, |
| 938 | .stage2_c => return Type.fromInterned(vector_type.child).abiAlignment(zcu), | |
| 938 | .stage2_c, .stage2_wasm => return Type.fromInterned(vector_type.child).abiAlignment(zcu), | |
| 939 | 939 | .stage2_x86_64 => { |
| 940 | 940 | if (vector_type.child == .bool_type) { |
| 941 | 941 | if (vector_type.len > 256 and target.cpu.has(.x86, .avx512f)) return .@"64"; |
| ... | ... | @@ -1084,7 +1084,7 @@ pub fn abiSize(ty: Type, zcu: *const Zcu) u64 { |
| 1084 | 1084 | const elem_ty: Type = .fromInterned(vec.child); |
| 1085 | 1085 | const bytes = switch (zcu.comp.getZigBackend()) { |
| 1086 | 1086 | else => std.math.divCeil(u64, vec.len * elem_ty.bitSize(zcu), 8) catch unreachable, |
| 1087 | .stage2_c => vec.len * elem_ty.abiSize(zcu), | |
| 1087 | .stage2_c, .stage2_wasm => vec.len * elem_ty.abiSize(zcu), | |
| 1088 | 1088 | .stage2_x86_64 => switch (elem_ty.toIntern()) { |
| 1089 | 1089 | .bool_type => std.math.divCeil(u64, vec.len, 8) catch unreachable, |
| 1090 | 1090 | else => vec.len * elem_ty.abiSize(zcu), |
src/codegen.zig+5-1| ... | ... | @@ -484,7 +484,11 @@ pub fn generateSymbol( |
| 484 | 484 | }, |
| 485 | 485 | .vector_type => |vector_type| { |
| 486 | 486 | const abi_size = math.cast(usize, ty.abiSize(zcu)) orelse return error.Overflow; |
| 487 | if (vector_type.child == .bool_type) { | |
| 487 | const vector_bool_bitpacked = switch (zcu.comp.getZigBackend()) { | |
| 488 | .stage2_wasm => false, | |
| 489 | else => true, | |
| 490 | }; | |
| 491 | if (vector_type.child == .bool_type and vector_bool_bitpacked) { | |
| 488 | 492 | const bytes = try w.writableSlice(abi_size); |
| 489 | 493 | @memset(bytes, 0xaa); |
| 490 | 494 | var index: usize = 0; |
src/codegen/wasm/CodeGen.zig+369-262| ... | ... | @@ -43,6 +43,83 @@ pub fn legalizeFeatures(_: *const std.Target) *const Air.Legalize.Features { |
| 43 | 43 | .expand_packed_store, |
| 44 | 44 | .expand_packed_struct_field_val, |
| 45 | 45 | .expand_packed_aggregate_init, |
| 46 | ||
| 47 | .scalarize_add, | |
| 48 | .scalarize_add_optimized, | |
| 49 | .scalarize_add_wrap, | |
| 50 | .scalarize_add_sat, | |
| 51 | .scalarize_sub, | |
| 52 | .scalarize_sub_optimized, | |
| 53 | .scalarize_sub_wrap, | |
| 54 | .scalarize_sub_sat, | |
| 55 | .scalarize_mul, | |
| 56 | .scalarize_mul_optimized, | |
| 57 | .scalarize_mul_wrap, | |
| 58 | .scalarize_mul_sat, | |
| 59 | .scalarize_div_float, | |
| 60 | .scalarize_div_float_optimized, | |
| 61 | .scalarize_div_trunc, | |
| 62 | .scalarize_div_trunc_optimized, | |
| 63 | .scalarize_div_floor, | |
| 64 | .scalarize_div_floor_optimized, | |
| 65 | .scalarize_div_exact, | |
| 66 | .scalarize_div_exact_optimized, | |
| 67 | .scalarize_rem, | |
| 68 | .scalarize_rem_optimized, | |
| 69 | .scalarize_mod, | |
| 70 | .scalarize_mod_optimized, | |
| 71 | .scalarize_max, | |
| 72 | .scalarize_min, | |
| 73 | .scalarize_add_with_overflow, | |
| 74 | .scalarize_sub_with_overflow, | |
| 75 | .scalarize_mul_with_overflow, | |
| 76 | .scalarize_shl_with_overflow, | |
| 77 | .scalarize_bit_and, | |
| 78 | .scalarize_bit_or, | |
| 79 | .scalarize_shr, | |
| 80 | .scalarize_shr_exact, | |
| 81 | .scalarize_shl, | |
| 82 | .scalarize_shl_exact, | |
| 83 | .scalarize_shl_sat, | |
| 84 | .scalarize_xor, | |
| 85 | .scalarize_not, | |
| 86 | .scalarize_bitcast, | |
| 87 | .scalarize_clz, | |
| 88 | .scalarize_ctz, | |
| 89 | .scalarize_popcount, | |
| 90 | .scalarize_byte_swap, | |
| 91 | .scalarize_bit_reverse, | |
| 92 | .scalarize_sqrt, | |
| 93 | .scalarize_sin, | |
| 94 | .scalarize_cos, | |
| 95 | .scalarize_tan, | |
| 96 | .scalarize_exp, | |
| 97 | .scalarize_exp2, | |
| 98 | .scalarize_log, | |
| 99 | .scalarize_log2, | |
| 100 | .scalarize_log10, | |
| 101 | .scalarize_abs, | |
| 102 | .scalarize_floor, | |
| 103 | .scalarize_ceil, | |
| 104 | .scalarize_round, | |
| 105 | .scalarize_trunc_float, | |
| 106 | .scalarize_neg, | |
| 107 | .scalarize_neg_optimized, | |
| 108 | .scalarize_cmp_vector, | |
| 109 | .scalarize_cmp_vector_optimized, | |
| 110 | .scalarize_fptrunc, | |
| 111 | .scalarize_fpext, | |
| 112 | .scalarize_intcast, | |
| 113 | .scalarize_trunc, | |
| 114 | .scalarize_int_from_float, | |
| 115 | .scalarize_int_from_float_optimized, | |
| 116 | .scalarize_float_from_int, | |
| 117 | .scalarize_reduce, | |
| 118 | .scalarize_reduce_optimized, | |
| 119 | .scalarize_shuffle_one, | |
| 120 | .scalarize_shuffle_two, | |
| 121 | .scalarize_select, | |
| 122 | .scalarize_mul_add, | |
| 46 | 123 | }); |
| 47 | 124 | } |
| 48 | 125 | |
| ... | ... | @@ -217,8 +294,7 @@ const WValue = union(enum) { |
| 217 | 294 | try gen.addLocal(.local_set, new_local.local.value); |
| 218 | 295 | return new_local; |
| 219 | 296 | }, |
| 220 | .local, .stack_offset => return value, | |
| 221 | else => unreachable, | |
| 297 | else => return value, | |
| 222 | 298 | } |
| 223 | 299 | } |
| 224 | 300 | |
| ... | ... | @@ -765,7 +841,8 @@ fn generateInner(cg: *CodeGen, any_returns: bool) InnerError!Mir { |
| 765 | 841 | // In case we have a return value, but the last instruction is a noreturn (such as a while loop) |
| 766 | 842 | // we emit an unreachable instruction to tell the stack validator that part will never be reached. |
| 767 | 843 | if (any_returns and cg.air.instructions.len > 0) { |
| 768 | const inst: Air.Inst.Index = @enumFromInt(cg.air.instructions.len - 1); | |
| 844 | const main_body = cg.air.getMainBody(); | |
| 845 | const inst: Air.Inst.Index = main_body[main_body.len - 1]; | |
| 769 | 846 | const last_inst_ty = cg.typeOfIndex(inst); |
| 770 | 847 | if (!last_inst_ty.hasRuntimeBits(zcu)) { |
| 771 | 848 | try cg.addTag(.@"unreachable"); |
| ... | ... | @@ -1032,10 +1109,6 @@ fn allocStackPtr(cg: *CodeGen, inst: Air.Inst.Index) !WValue { |
| 1032 | 1109 | try cg.initializeStack(); |
| 1033 | 1110 | } |
| 1034 | 1111 | |
| 1035 | if (!pointee_ty.hasRuntimeBits(zcu)) { | |
| 1036 | return cg.allocStack(Type.usize); // create a value containing just the stack pointer. | |
| 1037 | } | |
| 1038 | ||
| 1039 | 1112 | const abi_alignment = ptr_ty.ptrAlignment(zcu); |
| 1040 | 1113 | const abi_size = std.math.cast(u32, pointee_ty.abiSize(zcu)) orelse { |
| 1041 | 1114 | return cg.fail("Type {f} with ABI size of {d} exceeds stack frame size", .{ |
| ... | ... | @@ -1050,157 +1123,67 @@ fn allocStackPtr(cg: *CodeGen, inst: Air.Inst.Index) !WValue { |
| 1050 | 1123 | return .{ .stack_offset = .{ .value = offset, .references = 1 } }; |
| 1051 | 1124 | } |
| 1052 | 1125 | |
| 1053 | /// Performs a copy of bytes for a given type. Copying all bytes | |
| 1054 | /// from rhs to lhs. | |
| 1055 | fn memcpy(cg: *CodeGen, dst: WValue, src: WValue, len: WValue) !void { | |
| 1126 | fn emitMemoryCopy(cg: *CodeGen, dst: WValue, src: WValue, len: WValue) !void { | |
| 1056 | 1127 | const len_known_neq_0 = switch (len) { |
| 1057 | 1128 | .imm32 => |val| if (val != 0) true else return, |
| 1058 | 1129 | .imm64 => |val| if (val != 0) true else return, |
| 1059 | 1130 | else => false, |
| 1060 | 1131 | }; |
| 1061 | // When bulk_memory is enabled, we lower it to wasm's memcpy instruction. | |
| 1062 | // If not, we lower it ourselves manually | |
| 1063 | if (cg.target.cpu.has(.wasm, .bulk_memory)) { | |
| 1064 | const len0_ok = cg.target.cpu.has(.wasm, .nontrapping_bulk_memory_len0); | |
| 1065 | const emit_check = !(len0_ok or len_known_neq_0); | |
| 1132 | const len0_ok = cg.target.cpu.has(.wasm, .nontrapping_bulk_memory_len0); | |
| 1133 | const emit_check = !(len0_ok or len_known_neq_0); | |
| 1066 | 1134 | |
| 1067 | if (emit_check) { | |
| 1068 | try cg.startBlock(.block, .empty); | |
| 1069 | ||
| 1070 | // Even if `len` is zero, the spec requires an implementation to trap if `src + len` or | |
| 1071 | // `dst + len` are out of memory bounds. This can easily happen in Zig in a case such | |
| 1072 | // as: | |
| 1073 | // | |
| 1074 | // const dst: [*]u8 = undefined; | |
| 1075 | // const src: [*]u8 = undefined; | |
| 1076 | // var len: usize = runtime_zero(); | |
| 1077 | // @memcpy(dst[0..len], src[0..len]); | |
| 1078 | // | |
| 1079 | // So explicitly avoid using `memory.copy` in the `len == 0` case. Lovely design. | |
| 1080 | try cg.emitWValue(len); | |
| 1081 | try cg.addTag(.i32_eqz); | |
| 1082 | try cg.addLabel(.br_if, 0); | |
| 1083 | } | |
| 1135 | if (emit_check) { | |
| 1136 | try cg.startBlock(.block, .empty); | |
| 1084 | 1137 | |
| 1085 | try cg.lowerToStack(dst); | |
| 1086 | try cg.lowerToStack(src); | |
| 1138 | // Even if `len` is zero, the spec requires an implementation to trap if `src + len` or | |
| 1139 | // `dst + len` are out of memory bounds. This can easily happen in Zig in a case such | |
| 1140 | // as: | |
| 1141 | // | |
| 1142 | // const dst: [*]u8 = undefined; | |
| 1143 | // const src: [*]u8 = undefined; | |
| 1144 | // var len: usize = runtime_zero(); | |
| 1145 | // @memcpy(dst[0..len], src[0..len]); | |
| 1146 | // | |
| 1147 | // So explicitly avoid using `memory.copy` in the `len == 0` case. Lovely design. | |
| 1087 | 1148 | try cg.emitWValue(len); |
| 1088 | try cg.addExtended(.memory_copy); | |
| 1089 | ||
| 1090 | if (emit_check) { | |
| 1091 | try cg.endBlock(); | |
| 1092 | } | |
| 1093 | ||
| 1094 | return; | |
| 1149 | try cg.addTag(.i32_eqz); | |
| 1150 | try cg.addLabel(.br_if, 0); | |
| 1095 | 1151 | } |
| 1096 | 1152 | |
| 1097 | // when the length is comptime-known, rather than a runtime value, we can optimize the generated code by having | |
| 1098 | // the loop during codegen, rather than inserting a runtime loop into the binary. | |
| 1099 | switch (len) { | |
| 1100 | .imm32, .imm64 => blk: { | |
| 1101 | const length = switch (len) { | |
| 1102 | .imm32 => |val| val, | |
| 1103 | .imm64 => |val| val, | |
| 1104 | else => unreachable, | |
| 1105 | }; | |
| 1106 | // if the size (length) is more than 32 bytes, we use a runtime loop instead to prevent | |
| 1107 | // binary size bloat. | |
| 1108 | if (length > 32) break :blk; | |
| 1109 | var offset: u32 = 0; | |
| 1110 | const lhs_base = dst.offset(); | |
| 1111 | const rhs_base = src.offset(); | |
| 1112 | while (offset < length) : (offset += 1) { | |
| 1113 | // get dst's address to store the result | |
| 1114 | try cg.emitWValue(dst); | |
| 1115 | // load byte from src's address | |
| 1116 | try cg.emitWValue(src); | |
| 1117 | switch (cg.ptr_size) { | |
| 1118 | .wasm32 => { | |
| 1119 | try cg.addMemArg(.i32_load8_u, .{ .offset = rhs_base + offset, .alignment = 1 }); | |
| 1120 | try cg.addMemArg(.i32_store8, .{ .offset = lhs_base + offset, .alignment = 1 }); | |
| 1121 | }, | |
| 1122 | .wasm64 => { | |
| 1123 | try cg.addMemArg(.i64_load8_u, .{ .offset = rhs_base + offset, .alignment = 1 }); | |
| 1124 | try cg.addMemArg(.i64_store8, .{ .offset = lhs_base + offset, .alignment = 1 }); | |
| 1125 | }, | |
| 1126 | } | |
| 1127 | } | |
| 1128 | return; | |
| 1129 | }, | |
| 1130 | else => {}, | |
| 1131 | } | |
| 1153 | try cg.lowerToStack(dst); | |
| 1154 | try cg.lowerToStack(src); | |
| 1155 | try cg.emitWValue(len); | |
| 1156 | try cg.addExtended(.memory_copy); | |
| 1132 | 1157 | |
| 1133 | // allocate a local for the offset, and set it to 0. | |
| 1134 | // This to ensure that inside loops we correctly re-set the counter. | |
| 1135 | var offset = try cg.allocLocal(Type.usize); // local for counter | |
| 1136 | defer offset.free(cg); | |
| 1137 | switch (cg.ptr_size) { | |
| 1138 | .wasm32 => try cg.addImm32(0), | |
| 1139 | .wasm64 => try cg.addImm64(0), | |
| 1158 | if (emit_check) { | |
| 1159 | try cg.endBlock(); | |
| 1140 | 1160 | } |
| 1141 | try cg.addLocal(.local_set, offset.local.value); | |
| 1142 | ||
| 1143 | // outer block to jump to when loop is done | |
| 1144 | try cg.startBlock(.block, .empty); | |
| 1145 | try cg.startBlock(.loop, .empty); | |
| 1161 | } | |
| 1146 | 1162 | |
| 1147 | // loop condition (offset == length -> break) | |
| 1148 | { | |
| 1149 | try cg.emitWValue(offset); | |
| 1150 | try cg.emitWValue(len); | |
| 1151 | switch (cg.ptr_size) { | |
| 1152 | .wasm32 => try cg.addTag(.i32_eq), | |
| 1153 | .wasm64 => try cg.addTag(.i64_eq), | |
| 1154 | } | |
| 1155 | try cg.addLabel(.br_if, 1); // jump out of loop into outer block (finished) | |
| 1163 | fn memcpy(cg: *CodeGen, dst: WValue, src: WValue, len: WValue) !void { | |
| 1164 | if (cg.target.cpu.has(.wasm, .bulk_memory)) { | |
| 1165 | try cg.emitMemoryCopy(dst, src, len); | |
| 1166 | return; | |
| 1156 | 1167 | } |
| 1157 | 1168 | |
| 1158 | // get dst ptr | |
| 1159 | { | |
| 1160 | try cg.emitWValue(dst); | |
| 1161 | try cg.emitWValue(offset); | |
| 1162 | switch (cg.ptr_size) { | |
| 1163 | .wasm32 => try cg.addTag(.i32_add), | |
| 1164 | .wasm64 => try cg.addTag(.i64_add), | |
| 1165 | } | |
| 1166 | } | |
| 1169 | try cg.lowerToStack(dst); | |
| 1170 | try cg.lowerToStack(src); | |
| 1171 | try cg.emitWValue(len); | |
| 1172 | try cg.addCallIntrinsic(.memcpy); | |
| 1173 | try cg.addTag(.drop); | |
| 1174 | } | |
| 1167 | 1175 | |
| 1168 | // get src value and also store in dst | |
| 1169 | { | |
| 1170 | try cg.emitWValue(src); | |
| 1171 | try cg.emitWValue(offset); | |
| 1172 | switch (cg.ptr_size) { | |
| 1173 | .wasm32 => { | |
| 1174 | try cg.addTag(.i32_add); | |
| 1175 | try cg.addMemArg(.i32_load8_u, .{ .offset = src.offset(), .alignment = 1 }); | |
| 1176 | try cg.addMemArg(.i32_store8, .{ .offset = dst.offset(), .alignment = 1 }); | |
| 1177 | }, | |
| 1178 | .wasm64 => { | |
| 1179 | try cg.addTag(.i64_add); | |
| 1180 | try cg.addMemArg(.i64_load8_u, .{ .offset = src.offset(), .alignment = 1 }); | |
| 1181 | try cg.addMemArg(.i64_store8, .{ .offset = dst.offset(), .alignment = 1 }); | |
| 1182 | }, | |
| 1183 | } | |
| 1176 | fn memmove(cg: *CodeGen, dst: WValue, src: WValue, len: WValue) !void { | |
| 1177 | if (cg.target.cpu.has(.wasm, .bulk_memory)) { | |
| 1178 | try cg.emitMemoryCopy(dst, src, len); | |
| 1179 | return; | |
| 1184 | 1180 | } |
| 1185 | 1181 | |
| 1186 | // increment loop counter | |
| 1187 | { | |
| 1188 | try cg.emitWValue(offset); | |
| 1189 | switch (cg.ptr_size) { | |
| 1190 | .wasm32 => { | |
| 1191 | try cg.addImm32(1); | |
| 1192 | try cg.addTag(.i32_add); | |
| 1193 | }, | |
| 1194 | .wasm64 => { | |
| 1195 | try cg.addImm64(1); | |
| 1196 | try cg.addTag(.i64_add); | |
| 1197 | }, | |
| 1198 | } | |
| 1199 | try cg.addLocal(.local_set, offset.local.value); | |
| 1200 | try cg.addLabel(.br, 0); // jump to start of loop | |
| 1201 | } | |
| 1202 | try cg.endBlock(); // close off loop block | |
| 1203 | try cg.endBlock(); // close off outer block | |
| 1182 | try cg.lowerToStack(dst); | |
| 1183 | try cg.lowerToStack(src); | |
| 1184 | try cg.emitWValue(len); | |
| 1185 | try cg.addCallIntrinsic(.memmove); | |
| 1186 | try cg.addTag(.drop); | |
| 1204 | 1187 | } |
| 1205 | 1188 | |
| 1206 | 1189 | fn ptrSize(cg: *const CodeGen) u16 { |
| ... | ... | @@ -1310,14 +1293,34 @@ fn genInst(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 1310 | 1293 | const zcu = cg.pt.zcu; |
| 1311 | 1294 | const air_tags = cg.air.instructions.items(.tag); |
| 1312 | 1295 | return switch (air_tags[@intFromEnum(inst)]) { |
| 1313 | // No "scalarize" legalizations are enabled, so these instructions never appear. | |
| 1314 | .legalize_vec_elem_val => unreachable, | |
| 1315 | .legalize_vec_store_elem => unreachable, | |
| 1316 | 1296 | // No soft float legalizations are enabled. |
| 1317 | 1297 | .legalize_compiler_rt_call => unreachable, |
| 1318 | 1298 | |
| 1319 | 1299 | .inferred_alloc, .inferred_alloc_comptime => unreachable, |
| 1320 | 1300 | |
| 1301 | .legalize_vec_elem_val => cg.airArrayElemVal(inst), | |
| 1302 | .legalize_vec_store_elem => { | |
| 1303 | const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op; | |
| 1304 | const bin_op = cg.air.extraData(Air.Bin, pl_op.payload).data; | |
| 1305 | const vec_ptr = try cg.resolveInst(pl_op.operand); | |
| 1306 | const elem_idx = try cg.resolveInst(bin_op.lhs); | |
| 1307 | const elem_val = try cg.resolveInst(bin_op.rhs); | |
| 1308 | ||
| 1309 | const elem_ty = cg.typeOf(bin_op.rhs); | |
| 1310 | const elem_size = elem_ty.abiSize(zcu); | |
| 1311 | ||
| 1312 | try cg.lowerToStack(vec_ptr); | |
| 1313 | try cg.emitWValue(elem_idx); | |
| 1314 | try cg.addImm32(@intCast(elem_size)); | |
| 1315 | try cg.addTag(.i32_mul); | |
| 1316 | try cg.addTag(.i32_add); | |
| 1317 | const ptr = try WValue.toLocal(.stack, cg, Type.usize); | |
| 1318 | ||
| 1319 | try cg.store(ptr, elem_val, elem_ty, 0); | |
| 1320 | ||
| 1321 | return cg.finishAir(inst, .none, &.{ pl_op.operand, bin_op.lhs, bin_op.rhs }); | |
| 1322 | }, | |
| 1323 | ||
| 1321 | 1324 | .add, |
| 1322 | 1325 | .sub, |
| 1323 | 1326 | .mul, |
| ... | ... | @@ -1818,7 +1821,8 @@ fn genInst(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 1818 | 1821 | .wasm_memory_size => cg.airWasmMemorySize(inst), |
| 1819 | 1822 | .wasm_memory_grow => cg.airWasmMemoryGrow(inst), |
| 1820 | 1823 | |
| 1821 | .memcpy, .memmove => cg.airMemcpy(inst), | |
| 1824 | .memcpy => cg.airMemcpy(inst), | |
| 1825 | .memmove => cg.airMemmove(inst), | |
| 1822 | 1826 | |
| 1823 | 1827 | .ret_addr => cg.airRetAddr(inst), |
| 1824 | 1828 | .tag_name => cg.airTagName(inst), |
| ... | ... | @@ -2105,7 +2109,7 @@ fn airStore(cg: *CodeGen, inst: Air.Inst.Index, safety: bool) InnerError!void { |
| 2105 | 2109 | return cg.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); |
| 2106 | 2110 | } |
| 2107 | 2111 | |
| 2108 | assert(ptr_info.packed_offset.host_size == 0); // legalize .expand_packed_store | |
| 2112 | assert(!(ptr_info.packed_offset.host_size > 0 and ptr_info.flags.vector_index == .none)); // legalize .expand_packed_store | |
| 2109 | 2113 | |
| 2110 | 2114 | try cg.store(lhs, rhs, ty, 0); |
| 2111 | 2115 | |
| ... | ... | @@ -2180,35 +2184,22 @@ fn airLoad(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 2180 | 2184 | |
| 2181 | 2185 | if (!ty.hasRuntimeBits(zcu)) return cg.finishAir(inst, .none, &.{ty_op.operand}); |
| 2182 | 2186 | |
| 2183 | assert(ptr_info.packed_offset.host_size == 0); // legalize .expand_packed_load | |
| 2184 | ||
| 2185 | const result = result: { | |
| 2186 | if (isByRef(ty, zcu, cg.target)) { | |
| 2187 | const new_local = try cg.allocStack(ty); | |
| 2188 | try cg.store(new_local, operand, ty, 0); | |
| 2189 | break :result new_local; | |
| 2190 | } | |
| 2187 | assert(!(ptr_info.packed_offset.host_size > 0 and ptr_info.flags.vector_index == .none)); // legalize .expand_packed_load | |
| 2191 | 2188 | |
| 2192 | const loaded = try cg.load(operand, ty, 0); | |
| 2193 | const ty_size = ty.abiSize(zcu); | |
| 2194 | if (ty.isAbiInt(zcu) and ty_size * 8 > ty.bitSize(zcu)) { | |
| 2195 | const int_info = ty.intInfo(zcu); | |
| 2196 | const loaded_int_ty: IntType = .{ | |
| 2197 | .is_signed = int_info.signedness == .signed, | |
| 2198 | .bits = @intCast(ty_size * 8), | |
| 2199 | }; | |
| 2200 | break :result try cg.intTrunc(.fromType(cg, ty), loaded_int_ty, loaded); | |
| 2201 | } else { | |
| 2202 | break :result loaded; | |
| 2203 | } | |
| 2204 | }; | |
| 2189 | const result = try cg.load(operand, ty, 0); | |
| 2205 | 2190 | return cg.finishAir(inst, result, &.{ty_op.operand}); |
| 2206 | 2191 | } |
| 2207 | 2192 | |
| 2208 | 2193 | /// Loads an operand from the linear memory section. |
| 2209 | /// NOTE: Leaves the value on the stack. | |
| 2194 | /// NOTE: Leaves the value on the stack, if isByRef == false. | |
| 2210 | 2195 | fn load(cg: *CodeGen, operand: WValue, ty: Type, offset: u32) InnerError!WValue { |
| 2211 | 2196 | const zcu = cg.pt.zcu; |
| 2197 | if (isByRef(ty, zcu, cg.target)) { | |
| 2198 | const val = try cg.allocStack(ty); | |
| 2199 | try cg.store(val, try operand.toLocal(cg, .usize), ty, 0); | |
| 2200 | return val; | |
| 2201 | } | |
| 2202 | ||
| 2212 | 2203 | // load local's value from memory by its stack position |
| 2213 | 2204 | try cg.emitWValue(operand); |
| 2214 | 2205 | |
| ... | ... | @@ -2254,6 +2245,14 @@ fn load(cg: *CodeGen, operand: WValue, ty: Type, offset: u32) InnerError!WValue |
| 2254 | 2245 | }, |
| 2255 | 2246 | ); |
| 2256 | 2247 | |
| 2248 | if (ty.isAbiInt(zcu)) { | |
| 2249 | const int_info: IntType = .fromType(cg, ty); | |
| 2250 | switch (int_info.bits) { | |
| 2251 | 8, 16, 32, 64 => {}, | |
| 2252 | else => _ = try cg.intWrap(int_info, .stack), | |
| 2253 | } | |
| 2254 | } | |
| 2255 | ||
| 2257 | 2256 | return .stack; |
| 2258 | 2257 | } |
| 2259 | 2258 | |
| ... | ... | @@ -2321,7 +2320,7 @@ const IntType = struct { |
| 2321 | 2320 | .hasRuntimeBits(zcu)) .{ .is_signed = false, .bits = zcu.errorSetBits() } else unreachable, |
| 2322 | 2321 | .simple_type => |simple_type| return switch (simple_type) { |
| 2323 | 2322 | .bool => .{ .is_signed = false, .bits = 1 }, |
| 2324 | .anyerror => .{ .is_signed = false, .bits = zcu.errorSetBits() }, | |
| 2323 | .anyerror, .adhoc_inferred_error_set => .{ .is_signed = false, .bits = zcu.errorSetBits() }, | |
| 2325 | 2324 | .isize => .{ .is_signed = true, .bits = cg.target.ptrBitWidth() }, |
| 2326 | 2325 | .usize => .{ .is_signed = false, .bits = cg.target.ptrBitWidth() }, |
| 2327 | 2326 | .c_char => .{ .is_signed = cg.target.cCharSignedness() == .signed, .bits = cg.target.cTypeBitSize(.char) }, |
| ... | ... | @@ -2334,7 +2333,7 @@ const IntType = struct { |
| 2334 | 2333 | .c_longlong => .{ .is_signed = true, .bits = cg.target.cTypeBitSize(.longlong) }, |
| 2335 | 2334 | .c_ulonglong => .{ .is_signed = false, .bits = cg.target.cTypeBitSize(.longlong) }, |
| 2336 | 2335 | .f16, .f32, .f64, .f80, .f128, .c_longdouble => unreachable, |
| 2337 | .anyopaque, .void, .type, .comptime_int, .comptime_float, .noreturn, .null, .undefined, .enum_literal, .adhoc_inferred_error_set, .generic_poison => unreachable, | |
| 2336 | .anyopaque, .void, .type, .comptime_int, .comptime_float, .noreturn, .null, .undefined, .enum_literal, .generic_poison => unreachable, | |
| 2338 | 2337 | }, |
| 2339 | 2338 | .struct_type => { |
| 2340 | 2339 | const loaded_struct = ip.loadStructType(ty_index); |
| ... | ... | @@ -3069,7 +3068,13 @@ fn intClz(cg: *CodeGen, ty: IntType, operand: WValue) InnerError!WValue { |
| 3069 | 3068 | var msb = try (try cg.load(operand, Type.u64, 8)).toLocal(cg, Type.u64); |
| 3070 | 3069 | defer msb.free(cg); |
| 3071 | 3070 | |
| 3072 | try cg.emitWValue(msb); | |
| 3071 | if (ty.is_signed and ty.bits < 128) { | |
| 3072 | const mask: u64 = ~@as(u64, 0) >> @intCast(128 - ty.bits); | |
| 3073 | _ = try cg.intAnd(.u64, msb, .{ .imm64 = mask }); | |
| 3074 | } else { | |
| 3075 | try cg.emitWValue(msb); | |
| 3076 | } | |
| 3077 | ||
| 3073 | 3078 | try cg.addTag(.i64_clz); |
| 3074 | 3079 | _ = try cg.load(operand, Type.u64, 0); |
| 3075 | 3080 | try cg.addTag(.i64_clz); |
| ... | ... | @@ -3078,6 +3083,12 @@ fn intClz(cg: *CodeGen, ty: IntType, operand: WValue) InnerError!WValue { |
| 3078 | 3083 | _ = try cg.intCmp(.u64, .neq, msb, .{ .imm64 = 0 }); |
| 3079 | 3084 | try cg.addTag(.select); |
| 3080 | 3085 | try cg.addTag(.i32_wrap_i64); |
| 3086 | ||
| 3087 | if (ty.bits < 128) { | |
| 3088 | try cg.addImm32(128 - ty.bits); | |
| 3089 | try cg.addTag(.i32_sub); | |
| 3090 | } | |
| 3091 | ||
| 3081 | 3092 | return .stack; |
| 3082 | 3093 | }, |
| 3083 | 3094 | else => { |
| ... | ... | @@ -4622,11 +4633,18 @@ fn floatFromInt(cg: *CodeGen, dest_ty: FloatType, src_ty: IntType, operand: WVal |
| 4622 | 4633 | fn lowerPtr(cg: *CodeGen, ptr_val: InternPool.Index, prev_offset: u64) InnerError!WValue { |
| 4623 | 4634 | const pt = cg.pt; |
| 4624 | 4635 | const zcu = pt.zcu; |
| 4636 | const ip = &zcu.intern_pool; | |
| 4625 | 4637 | const ptr = zcu.intern_pool.indexToKey(ptr_val).ptr; |
| 4626 | 4638 | const offset: u64 = prev_offset + ptr.byte_offset; |
| 4627 | 4639 | return switch (ptr.base_addr) { |
| 4628 | .nav => |nav| return .{ .nav_ref = .{ .nav_index = nav, .offset = @intCast(offset) } }, | |
| 4629 | .uav => |uav| return .{ .uav_ref = .{ .ip_index = uav.val, .offset = @intCast(offset), .orig_ptr_ty = uav.orig_ty } }, | |
| 4640 | .nav => |nav| return if (Type.fromInterned(ip.getNav(nav).resolved.?.type).isRuntimeFnOrHasRuntimeBits(zcu)) | |
| 4641 | .{ .nav_ref = .{ .nav_index = nav, .offset = @intCast(offset) } } | |
| 4642 | else | |
| 4643 | .{ .imm32 = @intCast(zcu.navAlignment(nav).forward(@as(u32, 0xaaaaaaaa))) }, | |
| 4644 | .uav => |uav| return if (Type.fromInterned(ip.typeOf(uav.val)).isRuntimeFnOrHasRuntimeBits(zcu)) | |
| 4645 | .{ .uav_ref = .{ .ip_index = uav.val, .offset = @intCast(offset), .orig_ptr_ty = uav.orig_ty } } | |
| 4646 | else | |
| 4647 | .{ .imm32 = @intCast(Type.fromInterned(uav.orig_ty).ptrAlignment(zcu).forward(@as(u32, 0xaaaaaaaa))) }, | |
| 4630 | 4648 | .int => return cg.lowerConstant(try pt.intValue(.usize, offset)), |
| 4631 | 4649 | .eu_payload => |eu_ptr| try cg.lowerPtr( |
| 4632 | 4650 | eu_ptr, |
| ... | ... | @@ -4960,9 +4978,9 @@ fn airCmp(cg: *CodeGen, inst: Air.Inst.Index, op: std.math.CompareOperator) Inne |
| 4960 | 4978 | try cg.addImm32(if (op == .eq) 0 else 1); |
| 4961 | 4979 | try cg.addLocal(.local_set, result.local.value); |
| 4962 | 4980 | |
| 4963 | _ = try cg.isNull(lhs, operand_ty, .i32_eq); | |
| 4981 | _ = try cg.isNull(lhs, operand_ty, .i32_eq, .value); | |
| 4964 | 4982 | try cg.addLocal(.local_tee, lhs_null.local.value); |
| 4965 | _ = try cg.isNull(rhs, operand_ty, .i32_eq); | |
| 4983 | _ = try cg.isNull(rhs, operand_ty, .i32_eq, .value); | |
| 4966 | 4984 | try cg.addTag(.i32_ne); |
| 4967 | 4985 | try cg.addLabel(.br_if, 0); |
| 4968 | 4986 | |
| ... | ... | @@ -5234,26 +5252,56 @@ fn airBitcast(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5234 | 5252 | fn bitcast(cg: *CodeGen, dest_ty: Type, src_ty: Type, operand: WValue) InnerError!?WValue { |
| 5235 | 5253 | const zcu = cg.pt.zcu; |
| 5236 | 5254 | const bit_size = src_ty.bitSize(zcu); |
| 5237 | const needs_wrapping = (src_ty.isSignedInt(zcu) != dest_ty.isSignedInt(zcu)) and | |
| 5255 | const dest_signed = if (dest_ty.isAbiInt(zcu)) IntType.fromType(cg, dest_ty).is_signed else false; | |
| 5256 | const src_signed = if (src_ty.isAbiInt(zcu)) IntType.fromType(cg, src_ty).is_signed else false; | |
| 5257 | const needs_wrapping = (src_signed != dest_signed) and | |
| 5238 | 5258 | bit_size != 32 and bit_size != 64 and bit_size != 128; |
| 5239 | 5259 | |
| 5240 | if (src_ty.isAnyFloat() or dest_ty.isAnyFloat()) { | |
| 5241 | if (dest_ty.ip_index == .f16_type or src_ty.ip_index == .f16_type) return null; | |
| 5242 | if (dest_ty.bitSize(zcu) > 64) return null; | |
| 5243 | assert((dest_ty.isInt(zcu) and src_ty.isAnyFloat()) or (dest_ty.isAnyFloat() and src_ty.isInt(zcu))); | |
| 5244 | ||
| 5245 | const dest_valtype = typeToValtype(dest_ty, zcu, cg.target); | |
| 5246 | const opcode: Mir.Inst.Tag = switch (dest_valtype) { | |
| 5247 | .i32 => .i32_reinterpret_f32, | |
| 5248 | .i64 => .i64_reinterpret_f64, | |
| 5249 | .f32 => .f32_reinterpret_i32, | |
| 5250 | .f64 => .f64_reinterpret_i64, | |
| 5251 | else => unreachable, | |
| 5252 | }; | |
| 5260 | if (src_ty.isAnyFloat()) { | |
| 5261 | const float_ty: FloatType = .fromType(cg, src_ty); | |
| 5262 | switch (float_ty) { | |
| 5263 | .f16, .f80, .f128 => { | |
| 5264 | if (dest_signed) { | |
| 5265 | const int_ty: IntType = .fromType(cg, dest_ty); | |
| 5266 | return try cg.intWrap(int_ty, operand); | |
| 5267 | } else { | |
| 5268 | return null; | |
| 5269 | } | |
| 5270 | }, | |
| 5271 | .f32 => { | |
| 5272 | try cg.emitWValue(operand); | |
| 5273 | try cg.addTag(.i32_reinterpret_f32); | |
| 5274 | return .stack; | |
| 5275 | }, | |
| 5276 | .f64 => { | |
| 5277 | try cg.emitWValue(operand); | |
| 5278 | try cg.addTag(.i64_reinterpret_f64); | |
| 5279 | return .stack; | |
| 5280 | }, | |
| 5281 | } | |
| 5282 | } | |
| 5253 | 5283 | |
| 5254 | try cg.emitWValue(operand); | |
| 5255 | try cg.addTag(opcode); | |
| 5256 | return .stack; | |
| 5284 | if (dest_ty.isAnyFloat()) { | |
| 5285 | const float_ty: FloatType = .fromType(cg, dest_ty); | |
| 5286 | switch (float_ty) { | |
| 5287 | .f16, .f80, .f128 => { | |
| 5288 | if (src_signed) { | |
| 5289 | return try cg.intWrap(.{ .bits = @intCast(bit_size), .is_signed = false }, operand); | |
| 5290 | } else { | |
| 5291 | return null; | |
| 5292 | } | |
| 5293 | }, | |
| 5294 | .f32 => { | |
| 5295 | try cg.emitWValue(operand); | |
| 5296 | try cg.addTag(.f32_reinterpret_i32); | |
| 5297 | return .stack; | |
| 5298 | }, | |
| 5299 | .f64 => { | |
| 5300 | try cg.emitWValue(operand); | |
| 5301 | try cg.addTag(.f64_reinterpret_i64); | |
| 5302 | return .stack; | |
| 5303 | }, | |
| 5304 | } | |
| 5257 | 5305 | } |
| 5258 | 5306 | |
| 5259 | 5307 | if (isByRef(src_ty, zcu, cg.target) and !isByRef(dest_ty, zcu, cg.target)) { |
| ... | ... | @@ -5751,23 +5799,27 @@ fn airWrapErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5751 | 5799 | return cg.finishAir(inst, result, &.{ty_op.operand}); |
| 5752 | 5800 | } |
| 5753 | 5801 | |
| 5754 | fn airIsNull(cg: *CodeGen, inst: Air.Inst.Index, opcode: std.wasm.Opcode, op_kind: enum { value, ptr }) InnerError!void { | |
| 5755 | const zcu = cg.pt.zcu; | |
| 5802 | const OpKind = enum { value, ptr }; | |
| 5803 | ||
| 5804 | fn airIsNull(cg: *CodeGen, inst: Air.Inst.Index, opcode: std.wasm.Opcode, op_kind: OpKind) InnerError!void { | |
| 5756 | 5805 | const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op; |
| 5757 | 5806 | const operand = try cg.resolveInst(un_op); |
| 5758 | 5807 | |
| 5759 | 5808 | const op_ty = cg.typeOf(un_op); |
| 5760 | const optional_ty = if (op_kind == .ptr) op_ty.childType(zcu) else op_ty; | |
| 5761 | const result = try cg.isNull(operand, optional_ty, opcode); | |
| 5809 | const result = try cg.isNull(operand, op_ty, opcode, op_kind); | |
| 5762 | 5810 | return cg.finishAir(inst, result, &.{un_op}); |
| 5763 | 5811 | } |
| 5764 | 5812 | |
| 5765 | 5813 | /// For a given type and operand, checks if it's considered `null`. |
| 5766 | 5814 | /// NOTE: Leaves the result on the stack |
| 5767 | fn isNull(cg: *CodeGen, operand: WValue, optional_ty: Type, opcode: std.wasm.Opcode) InnerError!WValue { | |
| 5815 | fn isNull(cg: *CodeGen, operand: WValue, op_ty: Type, opcode: std.wasm.Opcode, op_kind: OpKind) InnerError!WValue { | |
| 5768 | 5816 | const pt = cg.pt; |
| 5769 | 5817 | const zcu = pt.zcu; |
| 5770 | 5818 | try cg.emitWValue(operand); |
| 5819 | const optional_ty = switch (op_kind) { | |
| 5820 | .value => op_ty, | |
| 5821 | .ptr => op_ty.childType(zcu), | |
| 5822 | }; | |
| 5771 | 5823 | const payload_ty = optional_ty.optionalChild(zcu); |
| 5772 | 5824 | if (!optional_ty.optionalReprIsPayload(zcu)) { |
| 5773 | 5825 | // When payload is zero-bits, we can treat operand as a value, rather than |
| ... | ... | @@ -5783,6 +5835,13 @@ fn isNull(cg: *CodeGen, operand: WValue, optional_ty: Type, opcode: std.wasm.Opc |
| 5783 | 5835 | .wasm32 => try cg.addMemArg(.i32_load, .{ .offset = operand.offset(), .alignment = 4 }), |
| 5784 | 5836 | .wasm64 => try cg.addMemArg(.i64_load, .{ .offset = operand.offset(), .alignment = 8 }), |
| 5785 | 5837 | } |
| 5838 | } else { | |
| 5839 | if (op_kind == .ptr) { | |
| 5840 | try cg.addMemArg(.i32_load, .{ | |
| 5841 | .offset = operand.offset(), | |
| 5842 | .alignment = 4, | |
| 5843 | }); | |
| 5844 | } | |
| 5786 | 5845 | } |
| 5787 | 5846 | |
| 5788 | 5847 | // Compare the null value with '0' |
| ... | ... | @@ -5934,10 +5993,7 @@ fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5934 | 5993 | try cg.addTag(.i32_mul); |
| 5935 | 5994 | try cg.addTag(.i32_add); |
| 5936 | 5995 | |
| 5937 | const elem_result = if (isByRef(elem_ty, zcu, cg.target)) | |
| 5938 | .stack | |
| 5939 | else | |
| 5940 | try cg.load(.stack, elem_ty, 0); | |
| 5996 | const elem_result = try cg.load(.stack, elem_ty, 0); | |
| 5941 | 5997 | |
| 5942 | 5998 | return cg.finishAir(inst, elem_result, &.{ bin_op.lhs, bin_op.rhs }); |
| 5943 | 5999 | } |
| ... | ... | @@ -5991,10 +6047,7 @@ fn airArrayToSlice(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5991 | 6047 | // create a slice on the stack |
| 5992 | 6048 | const slice_local = try cg.allocStack(slice_ty); |
| 5993 | 6049 | |
| 5994 | // store the array ptr in the slice | |
| 5995 | if (array_ty.hasRuntimeBits(zcu)) { | |
| 5996 | try cg.store(slice_local, operand, Type.usize, 0); | |
| 5997 | } | |
| 6050 | try cg.store(slice_local, operand, Type.usize, 0); | |
| 5998 | 6051 | |
| 5999 | 6052 | // store the length of the array in the slice |
| 6000 | 6053 | const array_len: u32 = @intCast(array_ty.arrayLen(zcu)); |
| ... | ... | @@ -6026,10 +6079,7 @@ fn airPtrElemVal(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6026 | 6079 | try cg.addTag(.i32_mul); |
| 6027 | 6080 | try cg.addTag(.i32_add); |
| 6028 | 6081 | |
| 6029 | const elem_result = if (isByRef(elem_ty, zcu, cg.target)) | |
| 6030 | .stack | |
| 6031 | else | |
| 6032 | try cg.load(.stack, elem_ty, 0); | |
| 6082 | const elem_result = try cg.load(.stack, elem_ty, 0); | |
| 6033 | 6083 | |
| 6034 | 6084 | return cg.finishAir(inst, elem_result, &.{ bin_op.lhs, bin_op.rhs }); |
| 6035 | 6085 | } |
| ... | ... | @@ -6349,12 +6399,8 @@ fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6349 | 6399 | else => unreachable, |
| 6350 | 6400 | } |
| 6351 | 6401 | } |
| 6352 | const elem_size = elem_ty.bitSize(zcu); | |
| 6353 | const vector_len = @as(usize, @intCast(ty.vectorLen(zcu))); | |
| 6354 | if ((!std.math.isPowerOfTwo(elem_size) or elem_size % 8 != 0) and vector_len > 1) { | |
| 6355 | return cg.fail("TODO: WebAssembly `@splat` for arbitrary element bitsize {d}", .{elem_size}); | |
| 6356 | } | |
| 6357 | 6402 | |
| 6403 | const vector_len = @as(usize, @intCast(ty.vectorLen(zcu))); | |
| 6358 | 6404 | const result = try cg.allocStack(ty); |
| 6359 | 6405 | const elem_byte_size = @as(u32, @intCast(elem_ty.abiSize(zcu))); |
| 6360 | 6406 | var index: usize = 0; |
| ... | ... | @@ -6494,7 +6540,7 @@ fn airAggregateInit(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6494 | 6540 | |
| 6495 | 6541 | const result: WValue = result_value: { |
| 6496 | 6542 | switch (result_ty.zigTypeTag(zcu)) { |
| 6497 | .array => { | |
| 6543 | .array, .vector => { | |
| 6498 | 6544 | const result = try cg.allocStack(result_ty); |
| 6499 | 6545 | const elem_ty = result_ty.childType(zcu); |
| 6500 | 6546 | const elem_size = @as(u32, @intCast(elem_ty.abiSize(zcu))); |
| ... | ... | @@ -6554,7 +6600,6 @@ fn airAggregateInit(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6554 | 6600 | break :result_value result; |
| 6555 | 6601 | }, |
| 6556 | 6602 | }, |
| 6557 | .vector => return cg.fail("TODO: Wasm backend: implement airAggregateInit for vectors", .{}), | |
| 6558 | 6603 | else => unreachable, |
| 6559 | 6604 | } |
| 6560 | 6605 | }; |
| ... | ... | @@ -6792,6 +6837,37 @@ fn airMemcpy(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6792 | 6837 | return cg.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); |
| 6793 | 6838 | } |
| 6794 | 6839 | |
| 6840 | fn airMemmove(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { | |
| 6841 | const zcu = cg.pt.zcu; | |
| 6842 | const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | |
| 6843 | const dst = try cg.resolveInst(bin_op.lhs); | |
| 6844 | const dst_ty = cg.typeOf(bin_op.lhs); | |
| 6845 | const ptr_elem_ty = dst_ty.childType(zcu); | |
| 6846 | const src = try cg.resolveInst(bin_op.rhs); | |
| 6847 | const src_ty = cg.typeOf(bin_op.rhs); | |
| 6848 | const len = switch (dst_ty.ptrSize(zcu)) { | |
| 6849 | .slice => blk: { | |
| 6850 | const slice_len = try cg.sliceLen(dst); | |
| 6851 | if (ptr_elem_ty.abiSize(zcu) != 1) { | |
| 6852 | try cg.emitWValue(slice_len); | |
| 6853 | try cg.emitWValue(.{ .imm32 = @as(u32, @intCast(ptr_elem_ty.abiSize(zcu))) }); | |
| 6854 | try cg.addTag(.i32_mul); | |
| 6855 | try cg.addLocal(.local_set, slice_len.local.value); | |
| 6856 | } | |
| 6857 | break :blk slice_len; | |
| 6858 | }, | |
| 6859 | .one => @as(WValue, .{ | |
| 6860 | .imm32 = @as(u32, @intCast(ptr_elem_ty.arrayLen(zcu) * ptr_elem_ty.childType(zcu).abiSize(zcu))), | |
| 6861 | }), | |
| 6862 | .c, .many => unreachable, | |
| 6863 | }; | |
| 6864 | const dst_ptr = try cg.sliceOrArrayPtr(dst, dst_ty); | |
| 6865 | const src_ptr = try cg.sliceOrArrayPtr(src, src_ty); | |
| 6866 | try cg.memmove(dst_ptr, src_ptr, len); | |
| 6867 | ||
| 6868 | return cg.finishAir(inst, .none, &.{ bin_op.lhs, bin_op.rhs }); | |
| 6869 | } | |
| 6870 | ||
| 6795 | 6871 | fn airRetAddr(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6796 | 6872 | // TODO: Implement this properly once stack serialization is solved |
| 6797 | 6873 | return cg.finishAir(inst, switch (cg.ptr_size) { |
| ... | ... | @@ -6992,7 +7068,7 @@ fn airTagName(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 6992 | 7068 | |
| 6993 | 7069 | const result_ptr = try cg.allocStack(cg.typeOfIndex(inst)); |
| 6994 | 7070 | try cg.lowerToStack(result_ptr); |
| 6995 | try cg.emitWValue(operand); | |
| 7071 | try cg.lowerToStack(operand); | |
| 6996 | 7072 | try cg.addInst(.{ .tag = .call_tag_name, .data = .{ .ip_index = enum_ty.toIntern() } }); |
| 6997 | 7073 | |
| 6998 | 7074 | return cg.finishAir(inst, result_ptr, &.{un_op}); |
| ... | ... | @@ -7195,9 +7271,8 @@ fn airAtomicRmw(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 7195 | 7271 | const ty = cg.typeOfIndex(inst); |
| 7196 | 7272 | const op: std.builtin.AtomicRmwOp = extra.op(); |
| 7197 | 7273 | |
| 7198 | const int_ty: IntType = .fromType(cg, ty); | |
| 7199 | ||
| 7200 | 7274 | if (cg.useAtomicFeature()) { |
| 7275 | const int_ty: IntType = .fromType(cg, ty); | |
| 7201 | 7276 | switch (op) { |
| 7202 | 7277 | .Max, |
| 7203 | 7278 | .Min, |
| ... | ... | @@ -7312,35 +7387,65 @@ fn airAtomicRmw(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 7312 | 7387 | }, |
| 7313 | 7388 | .Add, |
| 7314 | 7389 | .Sub, |
| 7390 | => { | |
| 7391 | if (ty.isAnyFloat()) { | |
| 7392 | const float_ty: FloatType = .fromType(cg, ty); | |
| 7393 | try cg.emitWValue(ptr); | |
| 7394 | _ = switch (op) { | |
| 7395 | .Add => try cg.floatAdd(float_ty, result, operand), | |
| 7396 | .Sub => try cg.floatSub(float_ty, result, operand), | |
| 7397 | else => unreachable, | |
| 7398 | }; | |
| 7399 | try cg.store(.stack, .stack, ty, ptr.offset()); | |
| 7400 | } else { | |
| 7401 | const int_ty: IntType = .fromType(cg, ty); | |
| 7402 | try cg.emitWValue(ptr); | |
| 7403 | _ = switch (op) { | |
| 7404 | .Add => try cg.intAdd(int_ty, result, operand), | |
| 7405 | .Sub => try cg.intSub(int_ty, result, operand), | |
| 7406 | else => unreachable, | |
| 7407 | }; | |
| 7408 | _ = try cg.intWrap(int_ty, .stack); | |
| 7409 | try cg.store(.stack, .stack, ty, ptr.offset()); | |
| 7410 | } | |
| 7411 | }, | |
| 7315 | 7412 | .And, |
| 7316 | 7413 | .Or, |
| 7317 | 7414 | .Xor, |
| 7318 | 7415 | => { |
| 7416 | const int_ty: IntType = .fromType(cg, ty); | |
| 7319 | 7417 | try cg.emitWValue(ptr); |
| 7320 | 7418 | _ = switch (op) { |
| 7321 | .Add => try cg.intAdd(int_ty, result, operand), | |
| 7322 | .Sub => try cg.intSub(int_ty, result, operand), | |
| 7323 | 7419 | .And => try cg.intAnd(int_ty, result, operand), |
| 7324 | 7420 | .Or => try cg.intOr(int_ty, result, operand), |
| 7325 | 7421 | .Xor => try cg.intXor(int_ty, result, operand), |
| 7326 | 7422 | else => unreachable, |
| 7327 | 7423 | }; |
| 7328 | if (ty.isInt(zcu) and (op == .Add or op == .Sub)) { | |
| 7329 | _ = try cg.intWrap(int_ty, .stack); | |
| 7330 | } | |
| 7331 | 7424 | try cg.store(.stack, .stack, ty, ptr.offset()); |
| 7332 | 7425 | }, |
| 7333 | 7426 | .Max, |
| 7334 | 7427 | .Min, |
| 7335 | 7428 | => { |
| 7336 | try cg.emitWValue(ptr); | |
| 7337 | try cg.emitWValue(result); | |
| 7338 | try cg.emitWValue(operand); | |
| 7339 | _ = try cg.intCmp(int_ty, if (op == .Max) .gt else .lt, result, operand); | |
| 7340 | try cg.addTag(.select); | |
| 7341 | try cg.store(.stack, .stack, ty, ptr.offset()); | |
| 7429 | if (ty.isAnyFloat()) { | |
| 7430 | const float_ty: FloatType = .fromType(cg, ty); | |
| 7431 | try cg.emitWValue(ptr); | |
| 7432 | try cg.emitWValue(result); | |
| 7433 | try cg.emitWValue(operand); | |
| 7434 | _ = try cg.floatCmp(float_ty, if (op == .Max) .gt else .lt, result, operand); | |
| 7435 | try cg.addTag(.select); | |
| 7436 | try cg.store(.stack, .stack, ty, ptr.offset()); | |
| 7437 | } else { | |
| 7438 | const int_ty: IntType = .fromType(cg, ty); | |
| 7439 | try cg.emitWValue(ptr); | |
| 7440 | try cg.emitWValue(result); | |
| 7441 | try cg.emitWValue(operand); | |
| 7442 | _ = try cg.intCmp(int_ty, if (op == .Max) .gt else .lt, result, operand); | |
| 7443 | try cg.addTag(.select); | |
| 7444 | try cg.store(.stack, .stack, ty, ptr.offset()); | |
| 7445 | } | |
| 7342 | 7446 | }, |
| 7343 | 7447 | .Nand => { |
| 7448 | const int_ty: IntType = .fromType(cg, ty); | |
| 7344 | 7449 | try cg.emitWValue(ptr); |
| 7345 | 7450 | const and_res = try cg.intAnd(int_ty, result, operand); |
| 7346 | 7451 | if (int_ty.bits <= 32) { |
| ... | ... | @@ -7423,49 +7528,51 @@ fn airAsm(cg: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 7423 | 7528 | else |
| 7424 | 7529 | .none; |
| 7425 | 7530 | |
| 7426 | var local_map: assembly.LocalMap = .empty; | |
| 7427 | defer local_map.deinit(cg.gpa); | |
| 7531 | if (unwrapped_asm.source.len != 0) { | |
| 7532 | var local_map: assembly.LocalMap = .empty; | |
| 7533 | defer local_map.deinit(cg.gpa); | |
| 7428 | 7534 | |
| 7429 | { | |
| 7430 | var it = unwrapped_asm.iterateOutputs(); | |
| 7431 | if (it.next()) |output| { | |
| 7432 | const constraint = output.constraint; | |
| 7433 | assert(output.operand == .none); | |
| 7434 | const name = output.name; | |
| 7435 | ||
| 7436 | if (!mem.eql(u8, constraint, "=r")) { | |
| 7437 | return cg.fail("Self-hosted wasm backend requires output constraint to be equal \"=r\"", .{}); | |
| 7438 | } | |
| 7535 | { | |
| 7536 | var it = unwrapped_asm.iterateOutputs(); | |
| 7537 | if (it.next()) |output| { | |
| 7538 | const constraint = output.constraint; | |
| 7539 | assert(output.operand == .none); | |
| 7540 | const name = output.name; | |
| 7439 | 7541 | |
| 7440 | const gop = try local_map.getOrPutValue(cg.gpa, name, result.local.value); | |
| 7441 | assert(!gop.found_existing); // first value | |
| 7542 | if (!mem.eql(u8, constraint, "=r")) { | |
| 7543 | return cg.fail("Self-hosted wasm backend requires output constraint to be equal \"=r\"", .{}); | |
| 7544 | } | |
| 7442 | 7545 | |
| 7443 | assert(it.next() == null); | |
| 7444 | } | |
| 7445 | } | |
| 7546 | const gop = try local_map.getOrPutValue(cg.gpa, name, result.local.value); | |
| 7547 | assert(!gop.found_existing); // first value | |
| 7446 | 7548 | |
| 7447 | { | |
| 7448 | var it = unwrapped_asm.iterateInputs(); | |
| 7449 | while (it.next()) |input| { | |
| 7450 | const constraint = input.constraint; | |
| 7451 | const operand = try cg.resolveInst(input.operand); | |
| 7452 | const name = input.name; | |
| 7453 | ||
| 7454 | if (!mem.eql(u8, constraint, "r")) { | |
| 7455 | return cg.fail("Self-hosted wasm backend requires input constraint to be equal \"r\"", .{}); | |
| 7549 | assert(it.next() == null); | |
| 7456 | 7550 | } |
| 7551 | } | |
| 7457 | 7552 | |
| 7458 | try cg.lowerToStack(operand); | |
| 7459 | const op_local = try WValue.toLocal(.stack, cg, cg.typeOf(input.operand)); | |
| 7553 | { | |
| 7554 | var it = unwrapped_asm.iterateInputs(); | |
| 7555 | while (it.next()) |input| { | |
| 7556 | const constraint = input.constraint; | |
| 7557 | const operand = try cg.resolveInst(input.operand); | |
| 7558 | const name = input.name; | |
| 7559 | ||
| 7560 | if (!mem.eql(u8, constraint, "r")) { | |
| 7561 | return cg.fail("Self-hosted wasm backend requires input constraint to be equal \"r\"", .{}); | |
| 7562 | } | |
| 7563 | ||
| 7564 | try cg.lowerToStack(operand); | |
| 7565 | const op_local = try WValue.toLocal(.stack, cg, cg.typeOf(input.operand)); | |
| 7460 | 7566 | |
| 7461 | const gop = try local_map.getOrPutValue(cg.gpa, name, op_local.local.value); | |
| 7462 | if (gop.found_existing) { | |
| 7463 | return cg.fail("Duplicate asm variable name \"{s}\"", .{name}); | |
| 7567 | const gop = try local_map.getOrPutValue(cg.gpa, name, op_local.local.value); | |
| 7568 | if (gop.found_existing) { | |
| 7569 | return cg.fail("Duplicate asm variable name \"{s}\"", .{name}); | |
| 7570 | } | |
| 7464 | 7571 | } |
| 7465 | 7572 | } |
| 7466 | } | |
| 7467 | 7573 | |
| 7468 | try assembly.assemble(cg, unwrapped_asm.source, &local_map); | |
| 7574 | try assembly.assemble(cg, unwrapped_asm.source, &local_map); | |
| 7575 | } | |
| 7469 | 7576 | |
| 7470 | 7577 | var bt = cg.liveness.iterateBigTomb(inst); |
| 7471 | 7578 | for (outputs) |output| if (output != .none) cg.feed(&bt, output); |
src/codegen/wasm/Mir.zig+3| ... | ... | @@ -1028,6 +1028,9 @@ pub const Intrinsic = enum(u32) { |
| 1028 | 1028 | tanf, |
| 1029 | 1029 | tanq, |
| 1030 | 1030 | truncq, |
| 1031 | memcpy, | |
| 1032 | memmove, | |
| 1033 | memset, | |
| 1031 | 1034 | __addo_limb64, |
| 1032 | 1035 | __subo_limb64, |
| 1033 | 1036 | __cmp_limb64, |
src/link/Wasm/Flush.zig+54-34| ... | ... | @@ -1865,7 +1865,6 @@ fn emitTagNameFunction( |
| 1865 | 1865 | ) !void { |
| 1866 | 1866 | const comp = wasm.base.comp; |
| 1867 | 1867 | const gpa = comp.gpa; |
| 1868 | const diags = &comp.link_diags; | |
| 1869 | 1868 | const zcu = comp.zcu.?; |
| 1870 | 1869 | const ip = &zcu.intern_pool; |
| 1871 | 1870 | const enum_type = ip.loadEnumType(enum_type_ip); |
| ... | ... | @@ -1909,11 +1908,7 @@ fn emitTagNameFunction( |
| 1909 | 1908 | } |
| 1910 | 1909 | |
| 1911 | 1910 | const int_info = Zcu.Type.intInfo(.fromInterned(enum_type.int_tag_type), zcu); |
| 1912 | const outer_block_type: std.wasm.BlockType = switch (int_info.bits) { | |
| 1913 | 0...32 => .i32, | |
| 1914 | 33...64 => .i64, | |
| 1915 | else => return diags.fail("wasm linker does not yet implement @tagName for sparse enums with more than 64 bit integer tag types", .{}), | |
| 1916 | }; | |
| 1911 | const is_big_int = int_info.bits > 64; | |
| 1917 | 1912 | |
| 1918 | 1913 | try code.ensureUnusedCapacity( |
| 1919 | 1914 | gpa, |
| ... | ... | @@ -1930,41 +1925,66 @@ fn emitTagNameFunction( |
| 1930 | 1925 | |
| 1931 | 1926 | // Outer block that computes table offset. |
| 1932 | 1927 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.block)); |
| 1933 | code.appendAssumeCapacity(@intFromEnum(outer_block_type)); | |
| 1928 | code.appendAssumeCapacity(@intFromEnum(std.wasm.BlockType.i32)); | |
| 1934 | 1929 | |
| 1935 | 1930 | for (tag_values, 0..) |tag_value, tag_index| { |
| 1936 | 1931 | // block for this if case |
| 1937 | 1932 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.block)); |
| 1938 | 1933 | code.appendAssumeCapacity(@intFromEnum(std.wasm.BlockType.empty)); |
| 1939 | 1934 | |
| 1940 | // Tag value whose name should be returned. | |
| 1941 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_get)); | |
| 1942 | appendReservedUleb32(code, 1); | |
| 1943 | ||
| 1944 | 1935 | const val: Zcu.Value = .fromInterned(tag_value); |
| 1945 | switch (outer_block_type) { | |
| 1946 | .i32 => { | |
| 1947 | const x: u32 = switch (int_info.signedness) { | |
| 1948 | .signed => @bitCast(@as(i32, @intCast(val.toSignedInt(zcu)))), | |
| 1949 | .unsigned => @intCast(val.toUnsignedInt(zcu)), | |
| 1950 | }; | |
| 1951 | appendReservedI32Const(code, x); | |
| 1952 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i32_ne)); | |
| 1953 | }, | |
| 1954 | .i64 => { | |
| 1955 | const x: u64 = switch (int_info.signedness) { | |
| 1956 | .signed => @bitCast(val.toSignedInt(zcu)), | |
| 1957 | .unsigned => val.toUnsignedInt(zcu), | |
| 1958 | }; | |
| 1959 | appendReservedI64Const(code, x); | |
| 1936 | if (is_big_int) { | |
| 1937 | var val_space: Zcu.Value.BigIntSpace = undefined; | |
| 1938 | const val_bigint = val.toBigInt(&val_space, zcu); | |
| 1939 | const num_limbs = (int_info.bits + 63) / 64; | |
| 1940 | ||
| 1941 | const limbs = try gpa.alloc(u64, num_limbs); | |
| 1942 | defer gpa.free(limbs); | |
| 1943 | val_bigint.writeTwosComplement(@ptrCast(limbs), .little); | |
| 1944 | ||
| 1945 | try code.ensureUnusedCapacity(gpa, 35 * num_limbs); | |
| 1946 | ||
| 1947 | for (0..num_limbs) |limb_index| { | |
| 1948 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_get)); | |
| 1949 | appendReservedUleb32(code, 1); | |
| 1950 | ||
| 1951 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i64_load)); | |
| 1952 | appendReservedUleb32(code, @ctz(@as(u32, 8))); | |
| 1953 | appendReservedUleb32(code, @intCast(limb_index * 8)); | |
| 1954 | ||
| 1955 | appendReservedI64Const(code, limbs[limb_index]); | |
| 1960 | 1956 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i64_ne)); |
| 1961 | }, | |
| 1962 | else => unreachable, | |
| 1963 | } | |
| 1964 | 1957 | |
| 1965 | // if they're not equal, break out of current branch | |
| 1966 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.br_if)); | |
| 1967 | appendReservedUleb32(code, 0); | |
| 1958 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.br_if)); | |
| 1959 | appendReservedUleb32(code, 0); | |
| 1960 | } | |
| 1961 | } else { | |
| 1962 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_get)); | |
| 1963 | appendReservedUleb32(code, 1); | |
| 1964 | ||
| 1965 | switch (int_info.bits) { | |
| 1966 | 0...32 => { | |
| 1967 | const x: u32 = switch (int_info.signedness) { | |
| 1968 | .signed => @bitCast(@as(i32, @intCast(val.toSignedInt(zcu)))), | |
| 1969 | .unsigned => @intCast(val.toUnsignedInt(zcu)), | |
| 1970 | }; | |
| 1971 | appendReservedI32Const(code, x); | |
| 1972 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i32_ne)); | |
| 1973 | }, | |
| 1974 | 33...64 => { | |
| 1975 | const x: u64 = switch (int_info.signedness) { | |
| 1976 | .signed => @bitCast(val.toSignedInt(zcu)), | |
| 1977 | .unsigned => val.toUnsignedInt(zcu), | |
| 1978 | }; | |
| 1979 | appendReservedI64Const(code, x); | |
| 1980 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i64_ne)); | |
| 1981 | }, | |
| 1982 | else => unreachable, | |
| 1983 | } | |
| 1984 | ||
| 1985 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.br_if)); | |
| 1986 | appendReservedUleb32(code, 0); | |
| 1987 | } | |
| 1968 | 1988 | |
| 1969 | 1989 | // Put the table offset of the result on the stack. |
| 1970 | 1990 | appendReservedI32Const(code, @intCast(tag_index * slice_abi_size)); |
| ... | ... | @@ -1995,7 +2015,7 @@ fn appendReservedI32Const(bytes: *ArrayList(u8), val: u32) void { |
| 1995 | 2015 | bytes.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i32_const)); |
| 1996 | 2016 | var w: std.Io.Writer = .fromArrayList(bytes); |
| 1997 | 2017 | defer bytes.* = w.toArrayList(); |
| 1998 | return w.writeSleb128(val) catch |err| switch (err) { | |
| 2018 | return w.writeSleb128(@as(i32, @bitCast(val))) catch |err| switch (err) { | |
| 1999 | 2019 | error.WriteFailed => unreachable, |
| 2000 | 2020 | }; |
| 2001 | 2021 | } |
| ... | ... | @@ -2005,7 +2025,7 @@ fn appendReservedI64Const(bytes: *ArrayList(u8), val: u64) void { |
| 2005 | 2025 | bytes.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.i64_const)); |
| 2006 | 2026 | var w: std.Io.Writer = .fromArrayList(bytes); |
| 2007 | 2027 | defer bytes.* = w.toArrayList(); |
| 2008 | return w.writeSleb128(val) catch |err| switch (err) { | |
| 2028 | return w.writeSleb128(@as(i64, @bitCast(val))) catch |err| switch (err) { | |
| 2009 | 2029 | error.WriteFailed => unreachable, |
| 2010 | 2030 | }; |
| 2011 | 2031 | } |
test/behavior/abs.zig+2-5| ... | ... | @@ -214,9 +214,9 @@ test "@abs floats" { |
| 214 | 214 | try comptime testAbsFloats(f64); |
| 215 | 215 | try testAbsFloats(f64); |
| 216 | 216 | try comptime testAbsFloats(f80); |
| 217 | if (builtin.zig_backend != .stage2_wasm and builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f80); | |
| 217 | if (builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f80); | |
| 218 | 218 | try comptime testAbsFloats(f128); |
| 219 | if (builtin.zig_backend != .stage2_wasm and builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f128); | |
| 219 | if (builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f128); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | fn testAbsFloats(comptime T: type) !void { |
| ... | ... | @@ -259,7 +259,6 @@ fn testAbsFloats(comptime T: type) !void { |
| 259 | 259 | test "@abs int vectors" { |
| 260 | 260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 261 | 261 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 262 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 263 | 262 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 264 | 263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 265 | 264 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -326,7 +325,6 @@ fn testAbsIntVectors(comptime len: comptime_int) !void { |
| 326 | 325 | |
| 327 | 326 | test "@abs unsigned int vectors" { |
| 328 | 327 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 329 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 330 | 328 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 331 | 329 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 332 | 330 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -385,7 +383,6 @@ fn testAbsUnsignedIntVectors(comptime len: comptime_int) !void { |
| 385 | 383 | |
| 386 | 384 | test "@abs float vectors" { |
| 387 | 385 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 388 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 389 | 386 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 390 | 387 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 391 | 388 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/align.zig-1| ... | ... | @@ -527,7 +527,6 @@ test "alignment of zero-bit types is respected" { |
| 527 | 527 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 528 | 528 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 529 | 529 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 530 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 531 | 530 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 532 | 531 | |
| 533 | 532 | const S = struct { arr: [0]usize = .{} }; |
test/behavior/atomics.zig-1| ... | ... | @@ -189,7 +189,6 @@ test "atomicrmw with floats" { |
| 189 | 189 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 190 | 190 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 191 | 191 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 192 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 193 | 192 | |
| 194 | 193 | try testAtomicRmwFloat(); |
| 195 | 194 | try comptime testAtomicRmwFloat(); |
test/behavior/basic.zig-1| ... | ... | @@ -1147,7 +1147,6 @@ test "arrays and vectors with big integers" { |
| 1147 | 1147 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1148 | 1148 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1149 | 1149 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1150 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 1151 | 1150 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1152 | 1151 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1153 | 1152 | if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23805 |
test/behavior/bitcast.zig-2| ... | ... | @@ -387,7 +387,6 @@ test "bitcast vector to integer and back" { |
| 387 | 387 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 388 | 388 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 389 | 389 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 390 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 391 | 390 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 392 | 391 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 393 | 392 | if (builtin.cpu.arch.endian() == .big and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| ... | ... | @@ -530,7 +529,6 @@ test "@bitCast of extern struct containing pointer" { |
| 530 | 529 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 531 | 530 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 532 | 531 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 533 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 534 | 532 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO |
| 535 | 533 | |
| 536 | 534 | const S = struct { |
test/behavior/bitreverse.zig-5| ... | ... | @@ -122,7 +122,6 @@ fn vector8() !void { |
| 122 | 122 | |
| 123 | 123 | test "bitReverse vectors u8" { |
| 124 | 124 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 126 | 125 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 127 | 126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 128 | 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -142,7 +141,6 @@ fn vector16() !void { |
| 142 | 141 | |
| 143 | 142 | test "bitReverse vectors u16" { |
| 144 | 143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 145 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 146 | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 147 | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 148 | 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -162,7 +160,6 @@ fn vector24() !void { |
| 162 | 160 | |
| 163 | 161 | test "bitReverse vectors u24" { |
| 164 | 162 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 165 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 166 | 163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 167 | 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 168 | 165 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -181,8 +178,6 @@ fn vector0() !void { |
| 181 | 178 | } |
| 182 | 179 | |
| 183 | 180 | test "bitReverse vectors u0" { |
| 184 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 185 | ||
| 186 | 181 | try comptime vector0(); |
| 187 | 182 | try vector0(); |
| 188 | 183 | } |
test/behavior/byteswap.zig-5| ... | ... | @@ -82,7 +82,6 @@ fn vector8() !void { |
| 82 | 82 | |
| 83 | 83 | test "@byteSwap vectors u8" { |
| 84 | 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 85 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 86 | 85 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 87 | 86 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 88 | 87 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -102,7 +101,6 @@ fn vector16() !void { |
| 102 | 101 | |
| 103 | 102 | test "@byteSwap vectors u16" { |
| 104 | 103 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 105 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 106 | 104 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 107 | 105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 108 | 106 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -122,7 +120,6 @@ fn vector24() !void { |
| 122 | 120 | |
| 123 | 121 | test "@byteSwap vectors u24" { |
| 124 | 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 126 | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 127 | 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 128 | 125 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -141,8 +138,6 @@ fn vector0() !void { |
| 141 | 138 | } |
| 142 | 139 | |
| 143 | 140 | test "@byteSwap vectors u0" { |
| 144 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 145 | ||
| 146 | 141 | try comptime vector0(); |
| 147 | 142 | try vector0(); |
| 148 | 143 | } |
test/behavior/cast.zig-15| ... | ... | @@ -268,7 +268,6 @@ test "type coercion from int to float" { |
| 268 | 268 | try check.value(c_longdouble, @as(u1, 0)); // Smoke test - size varies by target. |
| 269 | 269 | |
| 270 | 270 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 271 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 272 | 271 | |
| 273 | 272 | // Basic sanity check that the coercions work for vectors too. |
| 274 | 273 | const int_vec: @Vector(2, u24) = @splat(123); |
| ... | ... | @@ -758,7 +757,6 @@ test "cast *[1][*]const u8 to [*]const ?[*]const u8" { |
| 758 | 757 | |
| 759 | 758 | test "@intCast on vector" { |
| 760 | 759 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 761 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 762 | 760 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 763 | 761 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 764 | 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2145,7 +2143,6 @@ test "peer type resolution: array and vector with same child type" { |
| 2145 | 2143 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2146 | 2144 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2147 | 2145 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 2148 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 2149 | 2146 | |
| 2150 | 2147 | var arr: [2]u32 = .{ 0, 1 }; |
| 2151 | 2148 | var vec: @Vector(2, u32) = .{ 2, 3 }; |
| ... | ... | @@ -2167,7 +2164,6 @@ test "peer type resolution: array and vector with same child type" { |
| 2167 | 2164 | test "peer type resolution: array with smaller child type and vector with larger child type" { |
| 2168 | 2165 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2169 | 2166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2170 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2171 | 2167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2172 | 2168 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2173 | 2169 | |
| ... | ... | @@ -2279,7 +2275,6 @@ test "peer type resolution: three-way resolution combines error set and optional |
| 2279 | 2275 | test "peer type resolution: vector and optional vector" { |
| 2280 | 2276 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2281 | 2277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2282 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2283 | 2278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2284 | 2279 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO |
| 2285 | 2280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2349,7 +2344,6 @@ test "peer type resolution: array and tuple" { |
| 2349 | 2344 | test "peer type resolution: vector and tuple" { |
| 2350 | 2345 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2351 | 2346 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2352 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2353 | 2347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2354 | 2348 | |
| 2355 | 2349 | var vec: @Vector(3, i32) = .{ 1, 2, 3 }; |
| ... | ... | @@ -2373,7 +2367,6 @@ test "peer type resolution: vector and tuple" { |
| 2373 | 2367 | test "peer type resolution: vector and array and tuple" { |
| 2374 | 2368 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2375 | 2369 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2376 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2377 | 2370 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2378 | 2371 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2379 | 2372 | |
| ... | ... | @@ -2816,7 +2809,6 @@ test "cast builtins can wrap result in error union and optional" { |
| 2816 | 2809 | |
| 2817 | 2810 | test "@floatCast on vector" { |
| 2818 | 2811 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2819 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2820 | 2812 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2821 | 2813 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2822 | 2814 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2857,7 +2849,6 @@ test "@floatCast on vector" { |
| 2857 | 2849 | |
| 2858 | 2850 | test "@ptrFromInt on vector" { |
| 2859 | 2851 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2860 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2861 | 2852 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2862 | 2853 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2863 | 2854 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2882,7 +2873,6 @@ test "@ptrFromInt on vector" { |
| 2882 | 2873 | |
| 2883 | 2874 | test "@intFromPtr on vector" { |
| 2884 | 2875 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2885 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2886 | 2876 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2887 | 2877 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2888 | 2878 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2907,7 +2897,6 @@ test "@intFromPtr on vector" { |
| 2907 | 2897 | |
| 2908 | 2898 | test "@floatFromInt on vector" { |
| 2909 | 2899 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2910 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2911 | 2900 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2912 | 2901 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2913 | 2902 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2927,7 +2916,6 @@ test "@floatFromInt on vector" { |
| 2927 | 2916 | |
| 2928 | 2917 | test "@intFromFloat on vector" { |
| 2929 | 2918 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2930 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2931 | 2919 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2932 | 2920 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2933 | 2921 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2947,7 +2935,6 @@ test "@intFromFloat on vector" { |
| 2947 | 2935 | |
| 2948 | 2936 | test "@intFromBool on vector" { |
| 2949 | 2937 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2950 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2951 | 2938 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2952 | 2939 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2953 | 2940 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -3023,7 +3010,6 @@ test "result information is preserved through many nested structures" { |
| 3023 | 3010 | test "@intCast vector of signed integer" { |
| 3024 | 3011 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3025 | 3012 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3026 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 3027 | 3013 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 3028 | 3014 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3029 | 3015 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -3109,7 +3095,6 @@ test "@intFromFloat boundary cases" { |
| 3109 | 3095 | test "@intFromFloat vector boundary cases" { |
| 3110 | 3096 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3111 | 3097 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3112 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 3113 | 3098 | |
| 3114 | 3099 | const S = struct { |
| 3115 | 3100 | fn case(comptime I: type, unshifted_inputs: [2]f32, expected: [2]I) !void { |
test/behavior/enum.zig+98-1| ... | ... | @@ -1057,7 +1057,6 @@ test "tag name with signed enum values" { |
| 1057 | 1057 | test "tag name with large enum values" { |
| 1058 | 1058 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1059 | 1059 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1060 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 1061 | 1060 | |
| 1062 | 1061 | const Kdf = enum(u128) { |
| 1063 | 1062 | aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9, |
| ... | ... | @@ -1074,6 +1073,104 @@ test "tag name with large enum values" { |
| 1074 | 1073 | try expect(mem.eql(u8, @tagName(kdf), "argon2id")); |
| 1075 | 1074 | } |
| 1076 | 1075 | |
| 1076 | test "@tagName with exotic integer enum types" { | |
| 1077 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1078 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1079 | ||
| 1080 | const S = struct { | |
| 1081 | fn testEnumSigned(comptime T: type) !void { | |
| 1082 | { | |
| 1083 | const E1 = enum(T) { | |
| 1084 | a = -125, | |
| 1085 | b = 125, | |
| 1086 | c = std.math.minInt(T), | |
| 1087 | d = std.math.maxInt(T), | |
| 1088 | }; | |
| 1089 | ||
| 1090 | var e: E1 = .a; | |
| 1091 | try expect(mem.eql(u8, @tagName(e), "a")); | |
| 1092 | e = .b; | |
| 1093 | try expect(mem.eql(u8, @tagName(e), "b")); | |
| 1094 | e = .c; | |
| 1095 | try expect(mem.eql(u8, @tagName(e), "c")); | |
| 1096 | e = .d; | |
| 1097 | try expect(mem.eql(u8, @tagName(e), "d")); | |
| 1098 | } | |
| 1099 | { | |
| 1100 | const E2 = enum(T) { | |
| 1101 | a = -125, | |
| 1102 | b = 125, | |
| 1103 | c = std.math.minInt(T), | |
| 1104 | d = std.math.maxInt(T), | |
| 1105 | _, | |
| 1106 | }; | |
| 1107 | ||
| 1108 | var e: E2 = .a; | |
| 1109 | try expect(mem.eql(u8, @tagName(e), "a")); | |
| 1110 | e = .b; | |
| 1111 | try expect(mem.eql(u8, @tagName(e), "b")); | |
| 1112 | e = .c; | |
| 1113 | try expect(mem.eql(u8, @tagName(e), "c")); | |
| 1114 | e = .d; | |
| 1115 | try expect(mem.eql(u8, @tagName(e), "d")); | |
| 1116 | } | |
| 1117 | } | |
| 1118 | ||
| 1119 | fn testEnumUnsigned(comptime T: type) !void { | |
| 1120 | { | |
| 1121 | const E1 = enum(T) { | |
| 1122 | a = std.math.maxInt(T) - 125, | |
| 1123 | b = 125, | |
| 1124 | c = std.math.minInt(T), | |
| 1125 | d = std.math.maxInt(T), | |
| 1126 | }; | |
| 1127 | ||
| 1128 | var e: E1 = .a; | |
| 1129 | try expect(mem.eql(u8, @tagName(e), "a")); | |
| 1130 | e = .b; | |
| 1131 | try expect(mem.eql(u8, @tagName(e), "b")); | |
| 1132 | e = .c; | |
| 1133 | try expect(mem.eql(u8, @tagName(e), "c")); | |
| 1134 | e = .d; | |
| 1135 | try expect(mem.eql(u8, @tagName(e), "d")); | |
| 1136 | } | |
| 1137 | { | |
| 1138 | const E2 = enum(T) { | |
| 1139 | a = std.math.maxInt(T) - 125, | |
| 1140 | b = 125, | |
| 1141 | c = std.math.minInt(T), | |
| 1142 | d = std.math.maxInt(T), | |
| 1143 | _, | |
| 1144 | }; | |
| 1145 | ||
| 1146 | var e: E2 = .a; | |
| 1147 | try expect(mem.eql(u8, @tagName(e), "a")); | |
| 1148 | e = .b; | |
| 1149 | try expect(mem.eql(u8, @tagName(e), "b")); | |
| 1150 | e = .c; | |
| 1151 | try expect(mem.eql(u8, @tagName(e), "c")); | |
| 1152 | e = .d; | |
| 1153 | try expect(mem.eql(u8, @tagName(e), "d")); | |
| 1154 | } | |
| 1155 | } | |
| 1156 | ||
| 1157 | fn doTheTest() !void { | |
| 1158 | try testEnumSigned(i33); | |
| 1159 | try testEnumSigned(i95); | |
| 1160 | try testEnumSigned(i127); | |
| 1161 | try testEnumSigned(i257); | |
| 1162 | ||
| 1163 | try testEnumUnsigned(u33); | |
| 1164 | try testEnumUnsigned(u95); | |
| 1165 | try testEnumUnsigned(u127); | |
| 1166 | try testEnumUnsigned(u257); | |
| 1167 | } | |
| 1168 | }; | |
| 1169 | ||
| 1170 | try S.doTheTest(); | |
| 1171 | try comptime S.doTheTest(); | |
| 1172 | } | |
| 1173 | ||
| 1077 | 1174 | test "@tagName in callconv(.c) function" { |
| 1078 | 1175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1079 | 1176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
test/behavior/floatop.zig-22| ... | ... | @@ -221,9 +221,7 @@ fn testCmp(comptime T: type) !void { |
| 221 | 221 | |
| 222 | 222 | test "vector cmp f16" { |
| 223 | 223 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 224 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 225 | 224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 226 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 227 | 225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 228 | 226 | if (builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| 229 | 227 | if (builtin.cpu.arch.isPowerPC64()) return error.SkipZigTest; |
| ... | ... | @@ -236,7 +234,6 @@ test "vector cmp f16" { |
| 236 | 234 | test "vector cmp f32" { |
| 237 | 235 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 238 | 236 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 239 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 240 | 237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 241 | 238 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 242 | 239 | if (builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| ... | ... | @@ -249,7 +246,6 @@ test "vector cmp f32" { |
| 249 | 246 | |
| 250 | 247 | test "vector cmp f64" { |
| 251 | 248 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 252 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 253 | 249 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 254 | 250 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 255 | 251 | if (builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| ... | ... | @@ -262,7 +258,6 @@ test "vector cmp f64" { |
| 262 | 258 | |
| 263 | 259 | test "vector cmp f128" { |
| 264 | 260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 265 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 266 | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 267 | 262 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| 268 | 263 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -281,7 +276,6 @@ test "vector cmp f80/c_longdouble" { |
| 281 | 276 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .powerpc64le) return error.SkipZigTest; |
| 282 | 277 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 283 | 278 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 284 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 285 | 279 | |
| 286 | 280 | try testCmpVector(f80); |
| 287 | 281 | try comptime testCmpVector(f80); |
| ... | ... | @@ -477,7 +471,6 @@ fn testSqrt(comptime T: type) !void { |
| 477 | 471 | |
| 478 | 472 | test "@sqrt with vectors" { |
| 479 | 473 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 480 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 481 | 474 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 482 | 475 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 483 | 476 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -546,7 +539,6 @@ fn testSin(comptime T: type) !void { |
| 546 | 539 | |
| 547 | 540 | test "@sin with vectors" { |
| 548 | 541 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 549 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 550 | 542 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 551 | 543 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 552 | 544 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -615,7 +607,6 @@ fn testCos(comptime T: type) !void { |
| 615 | 607 | |
| 616 | 608 | test "@cos with vectors" { |
| 617 | 609 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 618 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 619 | 610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 620 | 611 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 621 | 612 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -684,7 +675,6 @@ fn testTan(comptime T: type) !void { |
| 684 | 675 | |
| 685 | 676 | test "@tan with vectors" { |
| 686 | 677 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 687 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 688 | 678 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 689 | 679 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 690 | 680 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -757,7 +747,6 @@ fn testExp(comptime T: type) !void { |
| 757 | 747 | |
| 758 | 748 | test "@exp with vectors" { |
| 759 | 749 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 760 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 761 | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 762 | 751 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 763 | 752 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -825,7 +814,6 @@ fn testExp2(comptime T: type) !void { |
| 825 | 814 | |
| 826 | 815 | test "@exp2 with @vectors" { |
| 827 | 816 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 828 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 829 | 817 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 830 | 818 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 831 | 819 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -893,7 +881,6 @@ fn testLog(comptime T: type) !void { |
| 893 | 881 | |
| 894 | 882 | test "@log with @vectors" { |
| 895 | 883 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 896 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 897 | 884 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 898 | 885 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 899 | 886 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -959,7 +946,6 @@ fn testLog2(comptime T: type) !void { |
| 959 | 946 | |
| 960 | 947 | test "@log2 with vectors" { |
| 961 | 948 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 962 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 963 | 949 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 964 | 950 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 965 | 951 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1031,7 +1017,6 @@ fn testLog10(comptime T: type) !void { |
| 1031 | 1017 | |
| 1032 | 1018 | test "@log10 with vectors" { |
| 1033 | 1019 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1034 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1035 | 1020 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1036 | 1021 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1037 | 1022 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1151,7 +1136,6 @@ fn testFabs(comptime T: type) !void { |
| 1151 | 1136 | test "@abs with vectors" { |
| 1152 | 1137 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1153 | 1138 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1154 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1155 | 1139 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1156 | 1140 | |
| 1157 | 1141 | try testFabsWithVectors(); |
| ... | ... | @@ -1241,7 +1225,6 @@ fn testFloor(comptime T: type) !void { |
| 1241 | 1225 | test "@floor with vectors" { |
| 1242 | 1226 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1243 | 1227 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1244 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1245 | 1228 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1246 | 1229 | |
| 1247 | 1230 | try testFloorWithVectors(); |
| ... | ... | @@ -1349,7 +1332,6 @@ fn testCeil(comptime T: type) !void { |
| 1349 | 1332 | test "@ceil with vectors" { |
| 1350 | 1333 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1351 | 1334 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1352 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1353 | 1335 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1354 | 1336 | |
| 1355 | 1337 | try testCeilWithVectors(); |
| ... | ... | @@ -1439,7 +1421,6 @@ fn testTrunc(comptime T: type) !void { |
| 1439 | 1421 | test "@trunc with vectors" { |
| 1440 | 1422 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1441 | 1423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1442 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1443 | 1424 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1444 | 1425 | |
| 1445 | 1426 | try testTruncWithVectors(); |
| ... | ... | @@ -1460,7 +1441,6 @@ test "neg f16" { |
| 1460 | 1441 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1461 | 1442 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1462 | 1443 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1463 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 1464 | 1444 | |
| 1465 | 1445 | if (builtin.os.tag == .freebsd) { |
| 1466 | 1446 | // TODO file issue to track this failure |
| ... | ... | @@ -1486,7 +1466,6 @@ test "neg f80/f128/c_longdouble" { |
| 1486 | 1466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1487 | 1467 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1488 | 1468 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1489 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 1490 | 1469 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1491 | 1470 | |
| 1492 | 1471 | try testNeg(f80); |
| ... | ... | @@ -1741,7 +1720,6 @@ test "comptime calls are only memoized when float arguments are bit-for-bit equa |
| 1741 | 1720 | } |
| 1742 | 1721 | |
| 1743 | 1722 | test "result location forwarded through unary float builtins" { |
| 1744 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1745 | 1723 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1746 | 1724 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1747 | 1725 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/lower_strlit_to_vector.zig-1| ... | ... | @@ -4,7 +4,6 @@ const builtin = @import("builtin"); |
| 4 | 4 | test "strlit to vector" { |
| 5 | 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 6 | 6 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 7 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 8 | 7 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 9 | 8 | |
| 10 | 9 | const strlit = "0123456789abcdef0123456789ABCDEF"; |
test/behavior/math.zig-12| ... | ... | @@ -100,7 +100,6 @@ fn testOneClz(comptime T: type, x: T) u32 { |
| 100 | 100 | |
| 101 | 101 | test "@clz vectors" { |
| 102 | 102 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 103 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 104 | 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 105 | 104 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 106 | 105 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -184,7 +183,6 @@ fn testCtz128() !void { |
| 184 | 183 | |
| 185 | 184 | test "@ctz vectors" { |
| 186 | 185 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 187 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 188 | 186 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 189 | 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 190 | 188 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -584,7 +582,6 @@ test "large integer division" { |
| 584 | 582 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 585 | 583 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 586 | 584 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 587 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 588 | 585 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 589 | 586 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 590 | 587 | |
| ... | ... | @@ -2260,7 +2257,6 @@ fn testRound(comptime T: type, x: T) !void { |
| 2260 | 2257 | |
| 2261 | 2258 | test "vector integer addition" { |
| 2262 | 2259 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2263 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2264 | 2260 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2265 | 2261 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2266 | 2262 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2322,7 +2318,6 @@ fn testNanEqNan(comptime F: type) !void { |
| 2322 | 2318 | |
| 2323 | 2319 | test "vector comparison" { |
| 2324 | 2320 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2325 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2326 | 2321 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2327 | 2322 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2328 | 2323 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2414,7 +2409,6 @@ test "mod lazy values" { |
| 2414 | 2409 | |
| 2415 | 2410 | test "@clz works on both vector and scalar inputs" { |
| 2416 | 2411 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2417 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2418 | 2412 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2419 | 2413 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2420 | 2414 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2489,7 +2483,6 @@ test "runtime int comparison to inf is comptime-known" { |
| 2489 | 2483 | } |
| 2490 | 2484 | |
| 2491 | 2485 | test "float divide by zero" { |
| 2492 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2493 | 2486 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2494 | 2487 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2495 | 2488 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2525,7 +2518,6 @@ test "float divide by zero" { |
| 2525 | 2518 | |
| 2526 | 2519 | test "partially-runtime integer vector division would be illegal if vector elements were reordered" { |
| 2527 | 2520 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2528 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2529 | 2521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2530 | 2522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2531 | 2523 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2554,7 +2546,6 @@ test "partially-runtime integer vector division would be illegal if vector eleme |
| 2554 | 2546 | |
| 2555 | 2547 | test "float vector division of comptime zero by runtime nan is nan" { |
| 2556 | 2548 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2557 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2558 | 2549 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2559 | 2550 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2560 | 2551 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2572,7 +2563,6 @@ test "float vector division of comptime zero by runtime nan is nan" { |
| 2572 | 2563 | |
| 2573 | 2564 | test "float vector multiplication of comptime zero by runtime nan is nan" { |
| 2574 | 2565 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2575 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2576 | 2566 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2577 | 2567 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2578 | 2568 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2588,7 +2578,6 @@ test "float vector multiplication of comptime zero by runtime nan is nan" { |
| 2588 | 2578 | } |
| 2589 | 2579 | |
| 2590 | 2580 | test "comptime float vector division of zero by nan is nan" { |
| 2591 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2592 | 2581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2593 | 2582 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2594 | 2583 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2603,7 +2592,6 @@ test "comptime float vector division of zero by nan is nan" { |
| 2603 | 2592 | } |
| 2604 | 2593 | |
| 2605 | 2594 | test "comptime float vector multiplication of zero by nan is nan" { |
| 2606 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 2607 | 2595 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2608 | 2596 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2609 | 2597 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/maximum_minimum.zig-7| ... | ... | @@ -28,7 +28,6 @@ test "@max" { |
| 28 | 28 | |
| 29 | 29 | test "@max on vectors" { |
| 30 | 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 31 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 32 | 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 33 | 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 34 | 33 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -82,7 +81,6 @@ test "@min" { |
| 82 | 81 | |
| 83 | 82 | test "@min for vectors" { |
| 84 | 83 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 85 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 86 | 84 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 87 | 85 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 88 | 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -165,7 +163,6 @@ test "@min/@max more than two arguments" { |
| 165 | 163 | |
| 166 | 164 | test "@min/@max more than two vector arguments" { |
| 167 | 165 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 168 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 169 | 166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 170 | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 168 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -195,7 +192,6 @@ test "@min/@max notices bounds" { |
| 195 | 192 | |
| 196 | 193 | test "@min/@max notices vector bounds" { |
| 197 | 194 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 198 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 199 | 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 200 | 196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 201 | 197 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -246,7 +242,6 @@ test "@min/@max notices bounds from types" { |
| 246 | 242 | |
| 247 | 243 | test "@min/@max notices bounds from vector types" { |
| 248 | 244 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 249 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 250 | 245 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 251 | 246 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 252 | 247 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -287,7 +282,6 @@ test "@min/@max notices bounds from types when comptime-known value is undef" { |
| 287 | 282 | |
| 288 | 283 | test "@min/@max notices bounds from vector types when element of comptime-known vector is undef" { |
| 289 | 284 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 290 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 291 | 285 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 292 | 286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 293 | 287 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -357,7 +351,6 @@ test "@min/@max with runtime signed and unsigned integers of same size" { |
| 357 | 351 | |
| 358 | 352 | test "@min/@max with runtime vectors of signed and unsigned integers of same size" { |
| 359 | 353 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 360 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 361 | 354 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 362 | 355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 363 | 356 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/memmove.zig-4| ... | ... | @@ -6,7 +6,6 @@ test "memmove and memset intrinsics" { |
| 6 | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | 8 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 10 | 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 11 | 10 | |
| 12 | 11 | try testMemmoveMemset(); |
| ... | ... | @@ -34,7 +33,6 @@ test "@memmove with both operands single-ptr-to-array, one is null-terminated" { |
| 34 | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 35 | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 36 | 35 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 38 | 36 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 39 | 37 | |
| 40 | 38 | try testMemmoveBothSinglePtrArrayOneIsNullTerminated(); |
| ... | ... | @@ -78,7 +76,6 @@ test "@memmove dest many pointer" { |
| 78 | 76 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 79 | 77 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 80 | 78 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 81 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 82 | 79 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 83 | 80 | |
| 84 | 81 | try testMemmoveDestManyPtr(); |
| ... | ... | @@ -121,7 +118,6 @@ test "@memmove slice" { |
| 121 | 118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 122 | 119 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 123 | 120 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 124 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 125 | 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 126 | 122 | |
| 127 | 123 | try testMemmoveSlice(); |
test/behavior/memset.zig-2| ... | ... | @@ -80,7 +80,6 @@ test "memset with 1-byte struct element" { |
| 80 | 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 81 | 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 82 | 82 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 83 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 84 | 83 | |
| 85 | 84 | const S = struct { x: bool }; |
| 86 | 85 | var buf: [5]S = undefined; |
| ... | ... | @@ -93,7 +92,6 @@ test "memset with 1-byte array element" { |
| 93 | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 94 | 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 95 | 94 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 96 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 97 | 95 | |
| 98 | 96 | const A = [1]bool; |
| 99 | 97 | var buf: [5]A = undefined; |
test/behavior/muladd.zig-5| ... | ... | @@ -100,7 +100,6 @@ fn vector16() !void { |
| 100 | 100 | |
| 101 | 101 | test "vector f16" { |
| 102 | 102 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 103 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 104 | 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 105 | 104 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 106 | 105 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -125,7 +124,6 @@ fn vector32() !void { |
| 125 | 124 | |
| 126 | 125 | test "vector f32" { |
| 127 | 126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 129 | 127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 130 | 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 131 | 129 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -150,7 +148,6 @@ fn vector64() !void { |
| 150 | 148 | |
| 151 | 149 | test "vector f64" { |
| 152 | 150 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 153 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 154 | 151 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 155 | 152 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 156 | 153 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -174,7 +171,6 @@ fn vector80() !void { |
| 174 | 171 | |
| 175 | 172 | test "vector f80" { |
| 176 | 173 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 177 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 178 | 174 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 179 | 175 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 180 | 176 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -200,7 +196,6 @@ fn vector128() !void { |
| 200 | 196 | |
| 201 | 197 | test "vector f128" { |
| 202 | 198 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 203 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 204 | 199 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 205 | 200 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 206 | 201 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/popcount.zig-1| ... | ... | @@ -77,7 +77,6 @@ fn testPopCountIntegers() !void { |
| 77 | 77 | |
| 78 | 78 | test "@popCount vectors" { |
| 79 | 79 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 80 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 81 | 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 82 | 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 83 | 82 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/ptrcast.zig-2| ... | ... | @@ -515,7 +515,6 @@ test "@ptrCast single-item pointer to slice with length 1" { |
| 515 | 515 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 516 | 516 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 517 | 517 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 518 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 519 | 518 | |
| 520 | 519 | const S = struct { |
| 521 | 520 | fn doTheTest(comptime T: type, ptr: *const T) !void { |
| ... | ... | @@ -536,7 +535,6 @@ test "@ptrCast single-item pointer to slice of bytes" { |
| 536 | 535 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 537 | 536 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 538 | 537 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 539 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 540 | 538 | |
| 541 | 539 | const S = struct { |
| 542 | 540 | fn doTheTest(comptime T: type, ptr: *const T) !void { |
test/behavior/select.zig-3| ... | ... | @@ -5,7 +5,6 @@ const expect = std.testing.expect; |
| 5 | 5 | |
| 6 | 6 | test "@select vectors" { |
| 7 | 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 8 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 9 | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -36,7 +35,6 @@ fn selectVectors() !void { |
| 36 | 35 | |
| 37 | 36 | test "@select arrays" { |
| 38 | 37 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 39 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 40 | 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | 39 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 42 | 40 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -68,7 +66,6 @@ fn selectArrays() !void { |
| 68 | 66 | test "@select compare result" { |
| 69 | 67 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 70 | 68 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 71 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 72 | 69 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 73 | 70 | |
| 74 | 71 | const S = struct { |
test/behavior/shuffle.zig-3| ... | ... | @@ -51,7 +51,6 @@ test "@shuffle int" { |
| 51 | 51 | |
| 52 | 52 | test "@shuffle int strange sizes" { |
| 53 | 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 54 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 55 | 54 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 56 | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 57 | 56 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -133,7 +132,6 @@ fn testShuffle( |
| 133 | 132 | |
| 134 | 133 | test "@shuffle bool 1" { |
| 135 | 134 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 136 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 137 | 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 138 | 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 139 | 137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -156,7 +154,6 @@ test "@shuffle bool 1" { |
| 156 | 154 | |
| 157 | 155 | test "@shuffle bool 2" { |
| 158 | 156 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 159 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 160 | 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 161 | 158 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 162 | 159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/truncate.zig-1| ... | ... | @@ -112,7 +112,6 @@ test "@truncate > 128 bits" { |
| 112 | 112 | |
| 113 | 113 | test "truncate on vectors" { |
| 114 | 114 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 115 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 116 | 115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 117 | 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 118 | 117 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/union.zig-1| ... | ... | @@ -2184,7 +2184,6 @@ test "matching captures causes union equivalence" { |
| 2184 | 2184 | test "signed enum tag with negative value" { |
| 2185 | 2185 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2186 | 2186 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2187 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 2188 | 2187 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2189 | 2188 | |
| 2190 | 2189 | const Enum = enum(i8) { |
test/behavior/vector.zig+4-49| ... | ... | @@ -9,7 +9,6 @@ const expectEqual = std.testing.expectEqual; |
| 9 | 9 | test "implicit cast vector to array - bool" { |
| 10 | 10 | if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 11 | 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 12 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 13 | 12 | |
| 14 | 13 | const S = struct { |
| 15 | 14 | fn doTheTest() !void { |
| ... | ... | @@ -33,7 +32,6 @@ test "implicit cast vector to array - bool" { |
| 33 | 32 | |
| 34 | 33 | test "implicit cast array to vector - bool" { |
| 35 | 34 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 36 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 37 | 35 | |
| 38 | 36 | const S = struct { |
| 39 | 37 | fn doTheTest() !void { |
| ... | ... | @@ -57,7 +55,6 @@ test "implicit cast array to vector - bool" { |
| 57 | 55 | |
| 58 | 56 | test "vector wrap operators" { |
| 59 | 57 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 60 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 61 | 58 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 62 | 59 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 63 | 60 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -81,7 +78,6 @@ test "vector wrap operators" { |
| 81 | 78 | |
| 82 | 79 | test "vector bin compares with mem.eql" { |
| 83 | 80 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 84 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 85 | 81 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 86 | 82 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 87 | 83 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -106,7 +102,6 @@ test "vector bin compares with mem.eql" { |
| 106 | 102 | |
| 107 | 103 | test "vector int operators" { |
| 108 | 104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 109 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 110 | 105 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 111 | 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 112 | 107 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -129,7 +124,6 @@ test "vector int operators" { |
| 129 | 124 | |
| 130 | 125 | test "vector float operators" { |
| 131 | 126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 132 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 133 | 127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 134 | 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 135 | 129 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -173,7 +167,6 @@ test "vector float operators" { |
| 173 | 167 | |
| 174 | 168 | test "vector bit operators" { |
| 175 | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 176 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 177 | 170 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 178 | 171 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 179 | 172 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -228,7 +221,6 @@ test "array to vector" { |
| 228 | 221 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 229 | 222 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 230 | 223 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 231 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 232 | 224 | |
| 233 | 225 | const S = struct { |
| 234 | 226 | fn doTheTest() !void { |
| ... | ... | @@ -247,7 +239,6 @@ test "array vector coercion - odd sizes" { |
| 247 | 239 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 248 | 240 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 249 | 241 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 250 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 251 | 242 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 252 | 243 | |
| 253 | 244 | const S = struct { |
| ... | ... | @@ -286,7 +277,6 @@ test "array to vector with element type coercion" { |
| 286 | 277 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 287 | 278 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 288 | 279 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 289 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 290 | 280 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 291 | 281 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 292 | 282 | |
| ... | ... | @@ -304,7 +294,6 @@ test "array to vector with element type coercion" { |
| 304 | 294 | } |
| 305 | 295 | |
| 306 | 296 | test "peer type resolution with coercible element types" { |
| 307 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 308 | 297 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 309 | 298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 310 | 299 | |
| ... | ... | @@ -323,7 +312,6 @@ test "peer type resolution with coercible element types" { |
| 323 | 312 | |
| 324 | 313 | test "tuple to vector" { |
| 325 | 314 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 326 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 327 | 315 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 328 | 316 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 329 | 317 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -346,7 +334,6 @@ test "tuple to vector" { |
| 346 | 334 | |
| 347 | 335 | test "vector casts of sizes not divisible by 8" { |
| 348 | 336 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 349 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 350 | 337 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 351 | 338 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 352 | 339 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -493,7 +480,6 @@ test "initialize vector which is a struct field" { |
| 493 | 480 | |
| 494 | 481 | test "vector comparison operators" { |
| 495 | 482 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 496 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 497 | 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 498 | 484 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 499 | 485 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -539,7 +525,6 @@ test "vector comparison operators" { |
| 539 | 525 | |
| 540 | 526 | test "vector division operators" { |
| 541 | 527 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 542 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 543 | 528 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 544 | 529 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 545 | 530 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -632,7 +617,6 @@ test "vector division operators" { |
| 632 | 617 | |
| 633 | 618 | test "vector bitwise not operator" { |
| 634 | 619 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 635 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 636 | 620 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 637 | 621 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 638 | 622 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -671,7 +655,6 @@ test "vector bitwise not operator" { |
| 671 | 655 | |
| 672 | 656 | test "vector boolean not operator" { |
| 673 | 657 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 674 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 675 | 658 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 676 | 659 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 677 | 660 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -700,7 +683,6 @@ test "vector boolean not operator" { |
| 700 | 683 | |
| 701 | 684 | test "vector shift operators" { |
| 702 | 685 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 703 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 704 | 686 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 705 | 687 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 706 | 688 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -772,7 +754,6 @@ test "vector shift operators" { |
| 772 | 754 | |
| 773 | 755 | test "vector reduce operation" { |
| 774 | 756 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 775 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 776 | 757 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 777 | 758 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 778 | 759 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -902,7 +883,6 @@ test "vector reduce operation" { |
| 902 | 883 | } |
| 903 | 884 | |
| 904 | 885 | test "vector @reduce comptime" { |
| 905 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 906 | 886 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 907 | 887 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 908 | 888 | |
| ... | ... | @@ -919,7 +899,6 @@ test "vector @reduce comptime" { |
| 919 | 899 | |
| 920 | 900 | test "saturating add" { |
| 921 | 901 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 922 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 923 | 902 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 924 | 903 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 925 | 904 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1020,7 +999,6 @@ test "saturating add" { |
| 1020 | 999 | |
| 1021 | 1000 | test "saturating subtraction" { |
| 1022 | 1001 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1023 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1024 | 1002 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1025 | 1003 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1026 | 1004 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1113,7 +1091,6 @@ test "saturating subtraction" { |
| 1113 | 1091 | |
| 1114 | 1092 | test "saturating multiplication" { |
| 1115 | 1093 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1116 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1117 | 1094 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1118 | 1095 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1119 | 1096 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1141,7 +1118,6 @@ test "saturating multiplication" { |
| 1141 | 1118 | |
| 1142 | 1119 | test "saturating shift-left" { |
| 1143 | 1120 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1144 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1145 | 1121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1146 | 1122 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1147 | 1123 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1165,7 +1141,6 @@ test "saturating shift-left" { |
| 1165 | 1141 | |
| 1166 | 1142 | test "multiplication-assignment operator with an array operand" { |
| 1167 | 1143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1168 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1169 | 1144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1170 | 1145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1171 | 1146 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1186,7 +1161,6 @@ test "multiplication-assignment operator with an array operand" { |
| 1186 | 1161 | |
| 1187 | 1162 | test "@addWithOverflow" { |
| 1188 | 1163 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1189 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1190 | 1164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1191 | 1165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1192 | 1166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1235,7 +1209,6 @@ test "@addWithOverflow" { |
| 1235 | 1209 | |
| 1236 | 1210 | test "@subWithOverflow" { |
| 1237 | 1211 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1238 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1239 | 1212 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1240 | 1213 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1241 | 1214 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1268,7 +1241,6 @@ test "@subWithOverflow" { |
| 1268 | 1241 | |
| 1269 | 1242 | test "@mulWithOverflow" { |
| 1270 | 1243 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1271 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1272 | 1244 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1273 | 1245 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1274 | 1246 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1290,7 +1262,6 @@ test "@mulWithOverflow" { |
| 1290 | 1262 | |
| 1291 | 1263 | test "@shlWithOverflow" { |
| 1292 | 1264 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1293 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1294 | 1265 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1295 | 1266 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1296 | 1267 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1313,28 +1284,27 @@ test "@shlWithOverflow" { |
| 1313 | 1284 | test "alignment of vectors" { |
| 1314 | 1285 | try expect(@alignOf(@Vector(2, u8)) == switch (builtin.zig_backend) { |
| 1315 | 1286 | else => 2, |
| 1316 | .stage2_c => @alignOf(u8), | |
| 1287 | .stage2_c, .stage2_wasm => @alignOf(u8), | |
| 1317 | 1288 | .stage2_x86_64 => 16, |
| 1318 | 1289 | }); |
| 1319 | 1290 | try expect(@alignOf(@Vector(2, u1)) == switch (builtin.zig_backend) { |
| 1320 | 1291 | else => 1, |
| 1321 | .stage2_c => @alignOf(u1), | |
| 1292 | .stage2_c, .stage2_wasm => @alignOf(u1), | |
| 1322 | 1293 | .stage2_x86_64 => 16, |
| 1323 | 1294 | }); |
| 1324 | 1295 | try expect(@alignOf(@Vector(1, u1)) == switch (builtin.zig_backend) { |
| 1325 | 1296 | else => 1, |
| 1326 | .stage2_c => @alignOf(u1), | |
| 1297 | .stage2_c, .stage2_wasm => @alignOf(u1), | |
| 1327 | 1298 | .stage2_x86_64 => 16, |
| 1328 | 1299 | }); |
| 1329 | 1300 | try expect(@alignOf(@Vector(2, u16)) == switch (builtin.zig_backend) { |
| 1330 | 1301 | else => 4, |
| 1331 | .stage2_c => @alignOf(u16), | |
| 1302 | .stage2_c, .stage2_wasm => @alignOf(u16), | |
| 1332 | 1303 | .stage2_x86_64 => 16, |
| 1333 | 1304 | }); |
| 1334 | 1305 | } |
| 1335 | 1306 | |
| 1336 | 1307 | test "loading the second vector from a slice of vectors" { |
| 1337 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1338 | 1308 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1339 | 1309 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1340 | 1310 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1351,7 +1321,6 @@ test "loading the second vector from a slice of vectors" { |
| 1351 | 1321 | |
| 1352 | 1322 | test "array of vectors is copied" { |
| 1353 | 1323 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1354 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1355 | 1324 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1356 | 1325 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1357 | 1326 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1375,7 +1344,6 @@ test "array of vectors is copied" { |
| 1375 | 1344 | |
| 1376 | 1345 | test "byte vector initialized in inline function" { |
| 1377 | 1346 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1378 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1379 | 1347 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1380 | 1348 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1381 | 1349 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1401,7 +1369,6 @@ test "byte vector initialized in inline function" { |
| 1401 | 1369 | } |
| 1402 | 1370 | |
| 1403 | 1371 | test "zero divisor" { |
| 1404 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1405 | 1372 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1406 | 1373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1407 | 1374 | |
| ... | ... | @@ -1420,7 +1387,6 @@ test "zero divisor" { |
| 1420 | 1387 | } |
| 1421 | 1388 | |
| 1422 | 1389 | test "zero multiplicand" { |
| 1423 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1424 | 1390 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1425 | 1391 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1426 | 1392 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1444,7 +1410,6 @@ test "zero multiplicand" { |
| 1444 | 1410 | } |
| 1445 | 1411 | |
| 1446 | 1412 | test "@intCast to u0" { |
| 1447 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1448 | 1413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1449 | 1414 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1450 | 1415 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1469,7 +1434,6 @@ test "modRem with zero divisor" { |
| 1469 | 1434 | |
| 1470 | 1435 | test "array operands to shuffle are coerced to vectors" { |
| 1471 | 1436 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1472 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1473 | 1437 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1474 | 1438 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1475 | 1439 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1486,7 +1450,6 @@ test "load packed vector element" { |
| 1486 | 1450 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1487 | 1451 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1488 | 1452 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1489 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1490 | 1453 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1491 | 1454 | |
| 1492 | 1455 | var x: @Vector(2, u15) = .{ 1, 4 }; |
| ... | ... | @@ -1498,7 +1461,6 @@ test "store packed vector element" { |
| 1498 | 1461 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1499 | 1462 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1500 | 1463 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1501 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1502 | 1464 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 1503 | 1465 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1504 | 1466 | if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| ... | ... | @@ -1513,7 +1475,6 @@ test "store packed vector element" { |
| 1513 | 1475 | test "store to vector in slice" { |
| 1514 | 1476 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1515 | 1477 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1516 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1517 | 1478 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1518 | 1479 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1519 | 1480 | |
| ... | ... | @@ -1531,7 +1492,6 @@ test "store to vector in slice" { |
| 1531 | 1492 | test "store vector with memset" { |
| 1532 | 1493 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1533 | 1494 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1534 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1535 | 1495 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1536 | 1496 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO |
| 1537 | 1497 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1574,7 +1534,6 @@ test "addition of vectors represented as strings" { |
| 1574 | 1534 | test "compare vectors with different element types" { |
| 1575 | 1535 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1576 | 1536 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1577 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1578 | 1537 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1579 | 1538 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1580 | 1539 | |
| ... | ... | @@ -1586,7 +1545,6 @@ test "compare vectors with different element types" { |
| 1586 | 1545 | |
| 1587 | 1546 | test "vector pointer is indexable" { |
| 1588 | 1547 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1589 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1590 | 1548 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1591 | 1549 | |
| 1592 | 1550 | const V = @Vector(2, u32); |
| ... | ... | @@ -1609,7 +1567,6 @@ test "vector pointer is indexable" { |
| 1609 | 1567 | |
| 1610 | 1568 | test "boolean vector with 2 or more booleans" { |
| 1611 | 1569 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1612 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1613 | 1570 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1614 | 1571 | |
| 1615 | 1572 | const vec1 = @Vector(2, bool){ true, true }; |
| ... | ... | @@ -1622,7 +1579,6 @@ test "boolean vector with 2 or more booleans" { |
| 1622 | 1579 | test "bitcast to vector with different child type" { |
| 1623 | 1580 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1624 | 1581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1625 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1626 | 1582 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1627 | 1583 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1628 | 1584 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1667,7 +1623,6 @@ test "arithmetic on zero-length vectors" { |
| 1667 | 1623 | } |
| 1668 | 1624 | |
| 1669 | 1625 | test "@reduce on bool vector" { |
| 1670 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1671 | 1626 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1672 | 1627 | |
| 1673 | 1628 | const a = @Vector(2, bool){ true, true }; |
test/tests.zig+1-1| ... | ... | @@ -1473,7 +1473,7 @@ const module_test_targets = blk: { |
| 1473 | 1473 | .os_tag = .wasi, |
| 1474 | 1474 | .abi = .none, |
| 1475 | 1475 | }, |
| 1476 | .skip_modules = &.{ "compiler-rt", "std" }, | |
| 1476 | .skip_modules = &.{"compiler-rt"}, | |
| 1477 | 1477 | .use_llvm = false, |
| 1478 | 1478 | .use_lld = false, |
| 1479 | 1479 | }, |