mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
sys/info: more CPU feature detection for RISC-V
This commit is contained in:
@@ -1,13 +1,97 @@
|
||||
package sysinfo
|
||||
|
||||
CPU_Feature :: enum u64 {
|
||||
I = 'I' - 'A', // Base features, don't think this is ever not here.
|
||||
M = 'M' - 'A', // Integer multiplication and division, currently required by Odin.
|
||||
A = 'A' - 'A', // Atomics.
|
||||
F = 'F' - 'A', // Single precision floating point, currently required by Odin.
|
||||
D = 'D' - 'A', // Double precision floating point, currently required by Odin.
|
||||
C = 'C' - 'A', // Compressed instructions.
|
||||
V = 'V' - 'A', // Vector operations.
|
||||
// Bit-Manipulation ISA Extensions v1.
|
||||
Zba = 3,
|
||||
Zbb,
|
||||
Zbs,
|
||||
|
||||
// CMOs (ratified).
|
||||
Zicboz,
|
||||
|
||||
// Bit-Manipulation ISA Extensions v1.
|
||||
Zbc,
|
||||
|
||||
// Scalar Crypto ISA extensions v1.
|
||||
Zbkb,
|
||||
Zbkc,
|
||||
Zbkx,
|
||||
Zknd,
|
||||
Zkne,
|
||||
Zknh,
|
||||
Zksed,
|
||||
Zksh,
|
||||
Zkt,
|
||||
|
||||
// Cryptography Extensions Volume II v1.
|
||||
Zvbb,
|
||||
Zvbc,
|
||||
Zvkb,
|
||||
Zvkg,
|
||||
Zvkned,
|
||||
Zvknha,
|
||||
Zvknhb,
|
||||
Zvksed,
|
||||
Zvksh,
|
||||
Zvkt,
|
||||
|
||||
// ISA Manual v1.
|
||||
Zfh,
|
||||
Zfhmin,
|
||||
Zihintntl,
|
||||
|
||||
// ISA manual (ratified).
|
||||
Zvfh,
|
||||
Zvfhmin,
|
||||
Zfa,
|
||||
Ztso,
|
||||
|
||||
// Atomic Compare-and-Swap Instructions Manual (ratified).
|
||||
Zacas,
|
||||
Zicond,
|
||||
|
||||
// ISA manual (ratified).
|
||||
Zihintpause,
|
||||
|
||||
// Vector Extensions Manual v1.
|
||||
Zve32x,
|
||||
Zve32f,
|
||||
Zve64x,
|
||||
Zve64f,
|
||||
Zve64d,
|
||||
|
||||
// ISA manual (ratified).
|
||||
Zimop,
|
||||
|
||||
// Code Size Reduction (ratified).
|
||||
Zca,
|
||||
Zcb,
|
||||
Zcd,
|
||||
Zcf,
|
||||
|
||||
// ISA manual (ratified).
|
||||
Zcmop,
|
||||
Zawrs,
|
||||
|
||||
// Base features, don't think this is ever not here.
|
||||
I,
|
||||
// Integer multiplication and division, currently required by Odin.
|
||||
M,
|
||||
// Atomics.
|
||||
A,
|
||||
// Single precision floating point, currently required by Odin.
|
||||
F,
|
||||
// Double precision floating point, currently required by Odin.
|
||||
D,
|
||||
// Compressed instructions.
|
||||
C,
|
||||
// Vector operations.
|
||||
V,
|
||||
|
||||
// Indicates Misaligned Scalar Loads will not trap the program.
|
||||
Misaligned_Supported,
|
||||
// Indicates Hardware Support for Misaligned Scalar Loads.
|
||||
Misaligned_Fast,
|
||||
}
|
||||
|
||||
CPU_Features :: distinct bit_set[CPU_Feature; u64]
|
||||
|
||||
Reference in New Issue
Block a user