arm64: Add support for Half precision floating point
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 26 Jan 2016 15:52:46 +0000 (15:52 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 26 Feb 2016 15:37:01 +0000 (15:37 +0000)
ARMv8.2 extensions [1] include an optional feature, which supports
half precision(16bit) floating point/asimd data processing
instructions. This patch adds support for detecting and exposing
the same to the userspace via HWCAPs

[1] https://community.arm.com/groups/processors/blog/2016/01/05/armv8-a-architecture-evolution

Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c

index 361c8a8..a739287 100644 (file)
@@ -28,5 +28,7 @@
 #define HWCAP_SHA2             (1 << 6)
 #define HWCAP_CRC32            (1 << 7)
 #define HWCAP_ATOMICS          (1 << 8)
+#define HWCAP_FPHP             (1 << 9)
+#define HWCAP_ASIMDHP          (1 << 10)
 
 #endif /* _UAPI__ASM_HWCAP_H */
index ffe44e7..3c9d708 100644 (file)
@@ -737,7 +737,9 @@ static const struct arm64_cpu_capabilities arm64_hwcaps[] = {
        HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_CRC32_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, HWCAP_CRC32),
        HWCAP_CAP(SYS_ID_AA64ISAR0_EL1, ID_AA64ISAR0_ATOMICS_SHIFT, FTR_UNSIGNED, 2, CAP_HWCAP, HWCAP_ATOMICS),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_FP_SHIFT, FTR_SIGNED, 0, CAP_HWCAP, HWCAP_FP),
+       HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_FP_SHIFT, FTR_SIGNED, 1, CAP_HWCAP, HWCAP_FPHP),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_ASIMD_SHIFT, FTR_SIGNED, 0, CAP_HWCAP, HWCAP_ASIMD),
+       HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_ASIMD_SHIFT, FTR_SIGNED, 1, CAP_HWCAP, HWCAP_ASIMDHP),
 #ifdef CONFIG_COMPAT
        HWCAP_CAP(SYS_ID_ISAR5_EL1, ID_ISAR5_AES_SHIFT, FTR_UNSIGNED, 2, CAP_COMPAT_HWCAP2, COMPAT_HWCAP2_PMULL),
        HWCAP_CAP(SYS_ID_ISAR5_EL1, ID_ISAR5_AES_SHIFT, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP2, COMPAT_HWCAP2_AES),
index 966fbd5..00bdfa3 100644 (file)
@@ -59,6 +59,8 @@ static const char *const hwcap_str[] = {
        "sha2",
        "crc32",
        "atomics",
+       "fphp",
+       "asimdhp",
        NULL
 };