arm: sve_addvl test program that prints sve length

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-10-30 22:00:02 +00:00
parent 37b93ecfbb
commit 02018daa95
4 changed files with 71 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-sve-vaddl-instruction */
#include <inttypes.h>
#include <stdio.h>
int main(void) {
uint64_t vl = 0;
__asm__ (
"addvl %[vl], %[vl], #8"
: [vl] "+r" (vl)
:
:
);
printf("0x%" PRIX64 "\n", vl);
}

View File

@@ -0,0 +1,10 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-sve-vaddl-instruction */
#include <lkmc.h>
LKMC_PROLOGUE
mov x0, 0
addvl x0, x0, 8
bl lkmc_print_hex_64
bl lkmc_print_newline
LKMC_EPILOGUE