| ... | ... | @@ -637,21 +637,15 @@ pub const Builder = struct { |
| 637 | 637 | "target", |
| 638 | 638 | "The CPU architecture, OS, and ABI to build for", |
| 639 | 639 | ); |
| 640 | | const mcpu = self.option([]const u8, "cpu", "Target CPU"); |
| 640 | const mcpu = self.option([]const u8, "cpu", "Target CPU features to add or subtract"); |
| 641 | 641 | |
| 642 | 642 | const triple = maybe_triple orelse return args.default_target; |
| 643 | | const cpu_features = self.option( |
| 644 | | []const u8, |
| 645 | | "mcpu", |
| 646 | | "The list of CPU features to add or subtract", |
| 647 | | ); |
| 648 | 643 | |
| 649 | 644 | var diags: CrossTarget.ParseOptions.Diagnostics = .{}; |
| 650 | 645 | const selected_target = CrossTarget.parse(.{ |
| 651 | 646 | .arch_os_abi = triple, |
| 652 | 647 | .cpu_features = mcpu, |
| 653 | 648 | .diagnostics = &diags, |
| 654 | | .cpu_features = cpu_features, |
| 655 | 649 | }) catch |err| switch (err) { |
| 656 | 650 | error.UnknownCpuModel => { |
| 657 | 651 | warn("Unknown CPU: '{s}'\nAvailable CPUs for architecture '{s}':\n", .{ |
| ... | ... | @@ -716,7 +710,7 @@ pub const Builder = struct { |
| 716 | 710 | if (mem.eql(u8, t_triple, selected_canonicalized_triple)) { |
| 717 | 711 | mismatch_triple = false; |
| 718 | 712 | whitelist_item = t; |
| 719 | | if (t.getCpuFeatures().subSet(selected_target.getCpuFeatures())) { |
| 713 | if (t.getCpuFeatures().isSuperSetOf(selected_target.getCpuFeatures())) { |
| 720 | 714 | mismatch_cpu_features = false; |
| 721 | 715 | break :whitelist_check; |
| 722 | 716 | } else { |
| ... | ... | @@ -733,7 +727,8 @@ pub const Builder = struct { |
| 733 | 727 | warn(" {s}\n", .{t_triple}); |
| 734 | 728 | } |
| 735 | 729 | warn("\n", .{}); |
| 736 | | } else { // mismatch_cpu_features |
| 730 | } else { |
| 731 | assert(mismatch_cpu_features); |
| 737 | 732 | const whitelist_cpu = whitelist_item.getCpu(); |
| 738 | 733 | const selected_cpu = selected_target.getCpu(); |
| 739 | 734 | warn("Chosen CPU model '{s}' does not match one of the supported targets:\n", .{ |