authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-20 02:29:55+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-20 03:29:36+02:00
logacc1233c8b2d007d6f515bb80944a8d8cfe53a4f
tree0eb74d7878f5a227aeedcd3c693b5d5fddf276fa
parent77178704d1b1bfc8ce2b7262cba8bb9c462e36a8
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

update_cpu_features: refine the set of wasm models


2 files changed, 74 insertions(+), 27 deletions(-)

lib/std/Target/wasm.zig+32-27
...@@ -159,53 +159,58 @@ pub const all_features = blk: {...@@ -159,53 +159,58 @@ pub const all_features = blk: {
159};159};
160160
161pub const cpu = struct {161pub const cpu = struct {
162 pub const bleeding_edge: CpuModel = .{162 pub const lime1: CpuModel = .{
163 .name = "bleeding_edge",163 .name = "lime1",
164 .llvm_name = "bleeding-edge",164 .llvm_name = "lime1",
165 .features = featureSet(&[_]Feature{165 .features = featureSet(&[_]Feature{
166 .atomics,166 .bulk_memory_opt,
167 .bulk_memory,167 .call_indirect_overlong,
168 .exception_handling,
169 .extended_const,168 .extended_const,
170 .fp16,169 .multivalue,
171 .gc,
172 .multimemory,
173 .mutable_globals,170 .mutable_globals,
174 .nontrapping_fptoint,171 .nontrapping_fptoint,
175 .relaxed_simd,
176 .sign_ext,172 .sign_ext,
177 .simd128,
178 .tail_call,
179 }),173 }),
180 };174 };
181 pub const generic: CpuModel = .{175 pub const mvp: CpuModel = .{
182 .name = "generic",176 .name = "mvp",
183 .llvm_name = "generic",177 .llvm_name = "mvp",
178 .features = featureSet(&[_]Feature{}),
179 };
180 pub const wasm_v1_0: CpuModel = .{
181 .name = "wasm_v1_0",
182 .llvm_name = null,
183 .features = featureSet(&[_]Feature{
184 .mutable_globals,
185 }),
186 };
187 pub const wasm_v2_0: CpuModel = .{
188 .name = "wasm_v2_0",
189 .llvm_name = null,
184 .features = featureSet(&[_]Feature{190 .features = featureSet(&[_]Feature{
185 .bulk_memory,
186 .multivalue,191 .multivalue,
187 .mutable_globals,192 .mutable_globals,
188 .nontrapping_fptoint,193 .nontrapping_fptoint,
189 .reference_types,194 .reference_types,
190 .sign_ext,195 .sign_ext,
196 .simd128,
191 }),197 }),
192 };198 };
193 pub const lime1: CpuModel = .{199 pub const wasm_v3_0: CpuModel = .{
194 .name = "lime1",200 .name = "wasm_v3_0",
195 .llvm_name = "lime1",201 .llvm_name = null,
196 .features = featureSet(&[_]Feature{202 .features = featureSet(&[_]Feature{
197 .bulk_memory_opt,203 .atomics,
198 .call_indirect_overlong,204 .exception_handling,
199 .extended_const,205 .extended_const,
200 .multivalue,206 .fp16,
207 .gc,
208 .multimemory,
201 .mutable_globals,209 .mutable_globals,
202 .nontrapping_fptoint,210 .nontrapping_fptoint,
211 .relaxed_simd,
203 .sign_ext,212 .sign_ext,
213 .tail_call,
204 }),214 }),
205 };215 };
206 pub const mvp: CpuModel = .{
207 .name = "mvp",
208 .llvm_name = "mvp",
209 .features = featureSet(&[_]Feature{}),
210 };
211};216};
tools/update_cpu_features.zig+42
...@@ -1771,6 +1771,48 @@ const targets = [_]ArchTarget{...@@ -1771,6 +1771,48 @@ const targets = [_]ArchTarget{
1771 .deps = &.{"bulk_memory_opt"},1771 .deps = &.{"bulk_memory_opt"},
1772 },1772 },
1773 },1773 },
1774 .extra_cpus = &.{
1775 .{
1776 .llvm_name = null,
1777 .zig_name = "wasm_v1_0",
1778 .features = &.{
1779 "mutable_globals",
1780 },
1781 },
1782 .{
1783 .llvm_name = null,
1784 .zig_name = "wasm_v2_0",
1785 .features = &.{
1786 "multivalue",
1787 "mutable_globals",
1788 "nontrapping_fptoint",
1789 "reference_types",
1790 "sign_ext",
1791 "simd128",
1792 },
1793 },
1794 .{
1795 .llvm_name = null,
1796 .zig_name = "wasm_v3_0",
1797 .features = &.{
1798 "atomics",
1799 "exception_handling",
1800 "extended_const",
1801 "fp16",
1802 "gc",
1803 "multimemory",
1804 "mutable_globals",
1805 "nontrapping_fptoint",
1806 "relaxed_simd",
1807 "sign_ext",
1808 "tail_call",
1809 },
1810 },
1811 },
1812 .omit_cpus = &.{
1813 "bleeding-edge",
1814 "generic",
1815 },
1774 },1816 },
1775 .{1817 .{
1776 .zig_name = "x86",1818 .zig_name = "x86",