authorgravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-03-08 08:53:48+08:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-22 21:15:32+02:00
log34c2b5e9d1b15ab9d8988f7919df967f3c405187
tree19bcb7b16da6bfc65f6fa78ddca9c1d64cbf31c3
parent3a6ddce4cf303d7a2bb618223043898d7b1bcc49
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux: add LoongArch HWCAP bits

See also arch/loongarch/include/uapi/asm/hwcap.h in Linux kernel. SC.Q was added in kernel v7.0. Change-Id: Ib4ddd451ab16d52b2578f8b97c9c3365286719cd Signed-off-by: xtex <xtex@astrafall.org>

2 files changed, 38 insertions(+), 0 deletions(-)

lib/std/os/linux/loongarch32.zig+19
...@@ -161,3 +161,22 @@ pub const VDSO = struct {...@@ -161,3 +161,22 @@ pub const VDSO = struct {
161 pub const CGT_SYM = "__vdso_clock_gettime";161 pub const CGT_SYM = "__vdso_clock_gettime";
162 pub const CGT_VER = "LINUX_5.10";162 pub const CGT_VER = "LINUX_5.10";
163};163};
164
165pub const HWCAP = struct {
166 pub const CPUCFG = 1 << 0;
167 pub const LAM = 1 << 1;
168 pub const UAL = 1 << 2;
169 pub const FPU = 1 << 3;
170 pub const LSX = 1 << 4;
171 pub const LASX = 1 << 5;
172 pub const CRC32 = 1 << 6;
173 pub const COMPLEX = 1 << 7;
174 pub const CRYPTO = 1 << 8;
175 pub const LVZ = 1 << 9;
176 pub const LBT_X86 = 1 << 10;
177 pub const LBT_ARM = 1 << 11;
178 pub const LBT_MIPS = 1 << 12;
179 pub const PTW = 1 << 13;
180 pub const LSPW = 1 << 14;
181 pub const SCQ = 1 << 15;
182};
lib/std/os/linux/loongarch64.zig+19
...@@ -160,3 +160,22 @@ pub const VDSO = struct {...@@ -160,3 +160,22 @@ pub const VDSO = struct {
160 pub const CGT_SYM = "__vdso_clock_gettime";160 pub const CGT_SYM = "__vdso_clock_gettime";
161 pub const CGT_VER = "LINUX_5.10";161 pub const CGT_VER = "LINUX_5.10";
162};162};
163
164pub const HWCAP = struct {
165 pub const CPUCFG = 1 << 0;
166 pub const LAM = 1 << 1;
167 pub const UAL = 1 << 2;
168 pub const FPU = 1 << 3;
169 pub const LSX = 1 << 4;
170 pub const LASX = 1 << 5;
171 pub const CRC32 = 1 << 6;
172 pub const COMPLEX = 1 << 7;
173 pub const CRYPTO = 1 << 8;
174 pub const LVZ = 1 << 9;
175 pub const LBT_X86 = 1 << 10;
176 pub const LBT_ARM = 1 << 11;
177 pub const LBT_MIPS = 1 << 12;
178 pub const PTW = 1 << 13;
179 pub const LSPW = 1 << 14;
180 pub const SCQ = 1 << 15;
181};