aarch64 ID_AA64PFR0_EL1.SVE check

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-25 00:00:00 +00:00
parent 6f5a1a3e83
commit 1f75ce8f12
2 changed files with 7 additions and 0 deletions

View File

@@ -14739,6 +14739,8 @@ The Linux kernel shows `/proc/cpuinfo` compatibility as `sve`.
Official spec: https://developer.arm.com/docs/100891/latest/sve-overview/introducing-sve
SVE support is indicated by `ID_AA64PFR0_EL1.SVE` which is dumped from link:baremetal/arch/aarch64/dump_regs.c[].
===== SVE bibliography
* https://www.rico.cat/files/ICS18-gem5-sve-tutorial.pdf step by step of a complete code execution examples, the best initial tutorial so far

View File

@@ -11,6 +11,11 @@ int main(void) {
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-paging */
printf("SCTLR_EL1.M 0x%" PRIX32 "\n", (sctlr_el1 >> 0) & 1);
uint64_t id_aa64pfr0_el1;
__asm__ ("mrs %0, id_aa64pfr0_el1" : "=r" (id_aa64pfr0_el1) : :);
printf("ID_AA64PFR0_EL1 0x%" PRIX64 "\n", id_aa64pfr0_el1);
printf("ID_AA64PFR0_EL1.SVE 0x%" PRIX64 "\n", (id_aa64pfr0_el1 >> 32) & 0xF);
uint64_t CurrentEL;
__asm__ ("mrs %0, CurrentEL;" : "=r" (CurrentEL) : :);
printf("CurrentEL 0x%" PRIX64 "\n", CurrentEL);