git: c0de8718a5c1 - stable/14 - arm64: Support HWCAP2_AFP and HWCAP2_RPRES

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 21 Oct 2024 15:05:16 UTC
The branch stable/14 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=c0de8718a5c1523c01bf30745a4be80784587fc1

commit c0de8718a5c1523c01bf30745a4be80784587fc1
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-10-04 13:08:36 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-10-21 15:03:27 +0000

    arm64: Support HWCAP2_AFP and HWCAP2_RPRES
    
    These add alternative behaviour to some floating-point instructions
    so don't need any kernel support and can just be exposed to userspace.
    
    Sponsored by:   Arm Ltd
    
    (cherry picked from commit 48979e8def00b69a07880e7827af7e32d5e377ff)
---
 sys/arm64/arm64/identcpu.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c
index 22978af219dc..d0b4f74c8a15 100644
--- a/sys/arm64/arm64/identcpu.c
+++ b/sys/arm64/arm64/identcpu.c
@@ -943,6 +943,11 @@ static const struct mrs_field_value id_aa64isar2_rpres[] = {
 	MRS_FIELD_VALUE_END,
 };
 
+static const struct mrs_field_hwcap id_aa64isar2_rpres_caps[] = {
+	MRS_HWCAP(2, HWCAP2_RPRES, ID_AA64ISAR2_RPRES_IMPL),
+	MRS_HWCAP_END
+};
+
 static const struct mrs_field_value id_aa64isar2_wfxt[] = {
 	MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, WFxT, NONE, IMPL),
 	MRS_FIELD_VALUE_END,
@@ -957,7 +962,8 @@ static const struct mrs_field id_aa64isar2_fields[] = {
 	    id_aa64isar2_apa3, id_aa64isar2_apa3_caps),
 	MRS_FIELD_HWCAP(ID_AA64ISAR2, GPA3, false, MRS_EXACT,
 	    id_aa64isar2_gpa3, id_aa64isar2_gpa3_caps),
-	MRS_FIELD(ID_AA64ISAR2, RPRES, false, MRS_EXACT, id_aa64isar2_rpres),
+	MRS_FIELD_HWCAP(ID_AA64ISAR2, RPRES, false, MRS_LOWER,
+	    id_aa64isar2_rpres, id_aa64isar2_rpres_caps),
 	MRS_FIELD(ID_AA64ISAR2, WFxT, false, MRS_EXACT, id_aa64isar2_wfxt),
 	MRS_FIELD_END,
 };
@@ -1100,6 +1106,11 @@ static const struct mrs_field_value id_aa64mmfr1_afp[] = {
 	MRS_FIELD_VALUE_END,
 };
 
+static const struct mrs_field_hwcap id_aa64mmfr1_afp_caps[] = {
+	MRS_HWCAP(2, HWCAP2_AFP, ID_AA64MMFR1_AFP_IMPL),
+	MRS_HWCAP_END
+};
+
 static const struct mrs_field_value id_aa64mmfr1_hcx[] = {
 	MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR1, HCX, NONE, IMPL),
 	MRS_FIELD_VALUE_END,
@@ -1166,7 +1177,8 @@ static const struct mrs_field id_aa64mmfr1_fields[] = {
 	MRS_FIELD(ID_AA64MMFR1, CMOVW, false, MRS_EXACT, id_aa64mmfr1_cmovw),
 	MRS_FIELD(ID_AA64MMFR1, TIDCP1, false, MRS_EXACT, id_aa64mmfr1_tidcp1),
 	MRS_FIELD(ID_AA64MMFR1, nTLBPA, false, MRS_EXACT, id_aa64mmfr1_ntlbpa),
-	MRS_FIELD(ID_AA64MMFR1, AFP, false, MRS_EXACT, id_aa64mmfr1_afp),
+	MRS_FIELD_HWCAP(ID_AA64MMFR1, AFP, false, MRS_LOWER, id_aa64mmfr1_afp,
+	    id_aa64mmfr1_afp_caps),
 	MRS_FIELD(ID_AA64MMFR1, HCX, false, MRS_EXACT, id_aa64mmfr1_hcx),
 	MRS_FIELD(ID_AA64MMFR1, ETS, false, MRS_EXACT, id_aa64mmfr1_ets),
 	MRS_FIELD(ID_AA64MMFR1, TWED, false, MRS_EXACT, id_aa64mmfr1_twed),