authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-17 01:48:37+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-26 21:59:58+02:00
log8282f3be960137e74c44827aea2436d3ff9fec30
tree257a4679d6b7beb53db65ecac669783101289c87
parent4b78dbe068445eb37cb28f2f8d1faf5836dc1175
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: Add doc comments for Cpu.Arch.generic() and baseline().


1 files changed, 11 insertions(+), 0 deletions(-)

lib/std/Target.zig+11
......@@ -1785,6 +1785,9 @@ pub const Cpu = struct {
17851785 };
17861786 }
17871787
1788 /// Returns the most bare-bones CPU model that is valid for `arch`. Note that this function
1789 /// can return CPU models that are understood by LLVM, but *not* understood by Clang. If
1790 /// Clang compatibility is important, consider using `baseline` instead.
17881791 pub fn generic(arch: Arch) *const Model {
17891792 const S = struct {
17901793 const generic_model = Model{
......@@ -1835,6 +1838,14 @@ pub const Cpu = struct {
18351838 };
18361839 }
18371840
1841 /// Returns a conservative CPU model for `arch` that is expected to be compatible with the
1842 /// vast majority of hardware available. This function is guaranteed to return CPU models
1843 /// that are understood by both LLVM and Clang, unlike `generic`.
1844 ///
1845 /// For certain `os` values, this function will additionally bump the baseline higher than
1846 /// the baseline would be for `arch` in isolation; for example, for `aarch64-macos`, the
1847 /// baseline is considered to be `apple_m1`. To avoid this behavior entirely, pass
1848 /// `Os.Tag.freestanding`.
18381849 pub fn baseline(arch: Arch, os: Os) *const Model {
18391850 return switch (arch) {
18401851 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,