Skip to contentSkip to conversation

linux-user: Report AArch64 FP16 support via hwcap bits

PATCH In review Peter Maydell 2 participants 2 messages Feb 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Report AArch64 FP16 support via hwcap bits

Set the appropriate Linux hwcap bits to tell the guest binary if we have implemented half-precision floating point support.

---
This is intended to go after Alex's FP16 stuff since it uses the ARM_FEATURE_V8_FP16 bit that defines. There is as yet no kernel definition of an AArch32 hwcap bit to report FP16.

Based-on: <[email protected]>

 linux-user/elfload.c | 2 ++
 1 file changed, 2 insertions(+)
linux-user/elfload.c +2 -0
index 8bb9a2c3e8..80f1b32fbe 100644
@@ -551,6 +551,8 @@ static uint32_t get_elf_hwcap(void)
     GET_FEATURE(ARM_FEATURE_V8_SM3, ARM_HWCAP_A64_SM3);
     GET_FEATURE(ARM_FEATURE_V8_SM4, ARM_HWCAP_A64_SM4);
     GET_FEATURE(ARM_FEATURE_V8_SHA512, ARM_HWCAP_A64_SHA512);
+    GET_FEATURE(ARM_FEATURE_V8_FP16,
+                ARM_HWCAP_A64_FPHP | ARM_HWCAP_A64_ASIMDHP);
 #undef GET_FEATURE
 
     return hwcaps;
Signature · 1 line
2.16.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Peter Maydell

Set the appropriate Linux hwcap bits to tell the guest binary if we have implemented half-precision floating point support.

---
This is intended to go after Alex's FP16 stuff since it uses the ARM_FEATURE_V8_FP16 bit that defines. There is as yet no kernel definition of an AArch32 hwcap bit to report FP16.

Quoted 4 lines

Based-on: <[email protected]>

 linux-user/elfload.c | 2 ++
 1 file changed, 2 insertions(+)

r~