Skip to content

Commit 3f035c0

Browse files
committed
Auto merge of #2693 - devnexen:solarish_getisax, r=Amanieu
solarish getisax/auxiliary vector constants
2 parents 7fa08a4 + de71d92 commit 3f035c0

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ fn test_solarish(target: &str) {
771771
"stdio.h",
772772
"stdlib.h",
773773
"string.h",
774+
"sys/auxv.h",
774775
"sys/epoll.h",
775776
"sys/eventfd.h",
776777
"sys/file.h",

src/unix/solarish/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,11 @@ pub const P_FORCED: ::c_int = 0x10000000;
23652365
pub const PI_TYPELEN: ::c_int = 16;
23662366
pub const PI_FPUTYPE: ::c_int = 32;
23672367

2368+
// sys/auxv.h
2369+
pub const AT_SUN_HWCAP: ::c_uint = 2009;
2370+
pub const AT_SUN_HWCAP2: ::c_uint = 2023;
2371+
pub const AT_SUN_FPTYPE: ::c_uint = 2027;
2372+
23682373
// As per sys/socket.h, header alignment must be 8 bytes on SPARC
23692374
// and 4 bytes everywhere else:
23702375
#[cfg(target_arch = "sparc64")]
@@ -2992,6 +2997,8 @@ extern "C" {
29922997
loc: ::locale_t,
29932998
) -> ::c_int;
29942999
pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
3000+
3001+
pub fn getisax(array: *mut u32, n: ::c_uint) -> ::c_uint;
29953002
}
29963003

29973004
#[link(name = "lgrp")]
@@ -3054,9 +3061,13 @@ cfg_if! {
30543061
cfg_if! {
30553062
if #[cfg(target_arch = "x86_64")] {
30563063
mod x86_64;
3064+
mod x86_common;
30573065
pub use self::x86_64::*;
3066+
pub use self::x86_common::*;
30583067
} else if #[cfg(target_arch = "x86")] {
30593068
mod x86;
3069+
mod x86_common;
30603070
pub use self::x86::*;
3071+
pub use self::x86_common::*;
30613072
}
30623073
}

src/unix/solarish/x86_common.rs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// AT_SUN_HWCAP
2+
pub const AV_386_FPU: u32 = 0x00001;
3+
pub const AV_386_TSC: u32 = 0x00002;
4+
pub const AV_386_CX8: u32 = 0x00004;
5+
pub const AV_386_SEP: u32 = 0x00008;
6+
pub const AV_386_AMD_SYSC: u32 = 0x00010;
7+
pub const AV_386_CMOV: u32 = 0x00020;
8+
pub const AV_386_MMX: u32 = 0x00040;
9+
pub const AV_386_AMD_MMX: u32 = 0x00080;
10+
pub const AV_386_AMD_3DNow: u32 = 0x00100;
11+
pub const AV_386_AMD_3DNowx: u32 = 0x00200;
12+
pub const AV_386_FXSR: u32 = 0x00400;
13+
pub const AV_386_SSE: u32 = 0x00800;
14+
pub const AV_386_SSE2: u32 = 0x01000;
15+
pub const AV_386_CX16: u32 = 0x10000;
16+
pub const AV_386_AHF: u32 = 0x20000;
17+
pub const AV_386_TSCP: u32 = 0x40000;
18+
pub const AV_386_AMD_SSE4A: u32 = 0x80000;
19+
pub const AV_386_POPCNT: u32 = 0x100000;
20+
pub const AV_386_AMD_LZCNT: u32 = 0x200000;
21+
pub const AV_386_SSSE3: u32 = 0x400000;
22+
pub const AV_386_SSE4_1: u32 = 0x800000;
23+
pub const AV_386_SSE4_2: u32 = 0x1000000;
24+
pub const AV_386_MOVBE: u32 = 0x2000000;
25+
pub const AV_386_AES: u32 = 0x4000000;
26+
pub const AV_386_PCLMULQDQ: u32 = 0x8000000;
27+
pub const AV_386_XSAVE: u32 = 0x10000000;
28+
pub const AV_386_AVX: u32 = 0x20000000;
29+
pub const AV_386_VMX: u32 = 0x40000000;
30+
pub const AV_386_AMD_SVM: u32 = 0x80000000;
31+
// AT_SUN_HWCAP2
32+
pub const AV_386_2_F16C: u32 = 0x00000001;
33+
pub const AV_386_2_RDRAND: u32 = 0x00000002;
34+
pub const AV_386_2_BMI1: u32 = 0x00000004;
35+
pub const AV_386_2_BMI2: u32 = 0x00000008;
36+
pub const AV_386_2_FMA: u32 = 0x00000010;
37+
pub const AV_386_2_AVX2: u32 = 0x00000020;
38+
pub const AV_386_2_ADX: u32 = 0x00000040;
39+
pub const AV_386_2_RDSEED: u32 = 0x00000080;
40+
pub const AV_386_2_AVX512F: u32 = 0x00000100;
41+
pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
42+
pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
43+
pub const AV_386_2_AVX512PF: u32 = 0x00000800;
44+
pub const AV_386_2_AVX512ER: u32 = 0x00001000;
45+
pub const AV_386_2_AVX512CD: u32 = 0x00002000;
46+
pub const AV_386_2_AVX512BW: u32 = 0x00004000;
47+
pub const AV_386_2_AVX512VL: u32 = 0x00008000;
48+
pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
49+
pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
50+
pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
51+
pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
52+
pub const AV_386_2_SHA: u32 = 0x00100000;
53+
pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
54+
pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
55+
pub const AV_386_2_CLWB: u32 = 0x00800000;
56+
pub const AV_386_2_MONITORX: u32 = 0x01000000;
57+
pub const AV_386_2_CLZERO: u32 = 0x02000000;
58+
pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
59+
pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
60+
pub const AV_386_2_VAES: u32 = 0x10000000;
61+
// AT_SUN_FPTYPE
62+
pub const AT_386_FPINFO_NONE: u32 = 0;
63+
pub const AT_386_FPINFO_FXSAVE: u32 = 1;
64+
pub const AT_386_FPINFO_XSAVE: u32 = 2;
65+
pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;

0 commit comments

Comments
 (0)