mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
[AArch64] Print the SVE and SME vector lengths in cpu_id
This file is not compiled with SVE or SME features enabled so use `.inst` to specify the instructions to read the vector length in hex instead. Change-Id: I2673b6f79a4a6ea0753f8b3de31244457fc08e76 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5616030 Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
c8974cf8d4
commit
c8dc7f57d4
16
util/cpuid.c
16
util/cpuid.c
@ -107,6 +107,22 @@ int main(int argc, const char* argv[]) {
|
||||
printf("Has SVE 0x%x\n", has_sve);
|
||||
printf("Has SVE2 0x%x\n", has_sve2);
|
||||
printf("Has SME 0x%x\n", has_sme);
|
||||
|
||||
#if __aarch64__
|
||||
// Read and print the SVE and SME vector lengths.
|
||||
if (has_sve) {
|
||||
int sve_vl;
|
||||
// rdvl x0, #1
|
||||
asm(".inst 0x04bf5020; mov %w0, w0" : "=r"(sve_vl)::"x0");
|
||||
printf("SVE vector length: %d bytes\n", sve_vl);
|
||||
}
|
||||
if (has_sme) {
|
||||
int sme_vl;
|
||||
// rdsvl x0, #1
|
||||
asm(".inst 0x04bf5820; mov %w0, w0" : "=r"(sme_vl)::"x0");
|
||||
printf("SME vector length: %d bytes\n", sme_vl);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (has_riscv) {
|
||||
int has_rvv = TestCpuFlag(kCpuHasRVV);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user