Skip to contentSkip to conversation

target/arm: Implement ARMv8.2-FHM

PATCH Applied Richard Henderson 2 participants 7 messages Feb 19, 2019 – Feb 26, 2019

lore
Share & tools
lore
#0 lore raw

v5 cover target/arm: Implement ARMv8.2-FHM

Changes since v4:

Fixed the FZ16 issue.
Add the aa64 HWCAP bits for both JSConv and FHM.

r~

Richard Henderson (5):
target/arm: Add helpers for FMLAL target/arm: Implement FMLAL and FMLSL for aarch64 target/arm: Implement VFMAL and VFMSL for aarch32 target/arm: Enable ARMv8.2-FHM for -cpu max
linux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT

 target/arm/cpu.h           |  10 +++
 target/arm/helper.h        |   9 +++
 linux-user/elfload.c       |   2 +
 target/arm/cpu.c           |   1 +
 target/arm/cpu64.c         |   2 +
 target/arm/translate-a64.c |  49 +++++++++++-
 target/arm/translate.c     | 129 +++++++++++++++++++++++---------
 target/arm/vec_helper.c    | 148 +++++++++++++++++++++++++++++++++++++
 8 files changed, 316 insertions(+), 34 deletions(-)
Signature · 1 line
2.17.2
#1 lore raw

PATCH v5 1/5 target/arm: Add helpers for FMLAL

Note that float16_to_float32 rightly squashes SNaN to QNaN. But of course pickNaNMulAdd, for ARM, selects SNaNs first. So we have to preserve SNaN long enough for the correct NaN to be selected. Thus float16_to_float32_by_bits.

---
 target/arm/helper.h     |   9 +++
 target/arm/vec_helper.c | 148 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+)
target/arm/helper.h +9 -0
index 747cb64d29..d363904278 100644
@@ -677,6 +677,15 @@ DEF_HELPER_FLAGS_5(gvec_sqsub_s, TCG_CALL_NO_RWG,
 DEF_HELPER_FLAGS_5(gvec_sqsub_d, TCG_CALL_NO_RWG,
                    void, ptr, ptr, ptr, ptr, i32)
 
+DEF_HELPER_FLAGS_5(gvec_fmlal_a32, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_fmlal_a64, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_fmlal_idx_a32, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_fmlal_idx_a64, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+
 #ifdef TARGET_AARCH64
 #include "helper-a64.h"
 #include "helper-sve.h"
target/arm/vec_helper.c +148 -0

151 lines not on this page · raw message

Signature · 1 line
2.17.2
#2 lore raw

PATCH v5 2/5 target/arm: Implement FMLAL and FMLSL for aarch64

In reply to Richard Henderson
---
 target/arm/cpu.h           |  5 ++++
 target/arm/translate-a64.c | 49 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 53 insertions(+), 1 deletion(-)
target/arm/cpu.h +5 -0
index 1eea1a408b..69589573e4 100644
@@ -3356,6 +3356,11 @@ static inline bool isar_feature_aa64_dp(const ARMISARegisters *id)
     return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, DP) != 0;
 }
 
+static inline bool isar_feature_aa64_fhm(const ARMISARegisters *id)
+{
+    return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, FHM) != 0;
+}
+
 static inline bool isar_feature_aa64_jscvt(const ARMISARegisters *id)
 {
     return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, JSCVT) != 0;
target/arm/translate-a64.c +48 -1

69 lines not on this page · raw message

Signature · 1 line
2.17.2
#3 lore raw

PATCH v5 3/5 target/arm: Implement VFMAL and VFMSL for aarch32

In reply to Richard Henderson
---
 target/arm/cpu.h       |   5 ++
 target/arm/translate.c | 129 ++++++++++++++++++++++++++++++-----------
 2 files changed, 101 insertions(+), 33 deletions(-)
target/arm/cpu.h +5 -0
index 69589573e4..9cf439fb8d 100644
@@ -3283,6 +3283,11 @@ static inline bool isar_feature_aa32_dp(const ARMISARegisters *id)
     return FIELD_EX32(id->id_isar6, ID_ISAR6, DP) != 0;
 }
 
+static inline bool isar_feature_aa32_fhm(const ARMISARegisters *id)
+{
+    return FIELD_EX32(id->id_isar6, ID_ISAR6, FHM) != 0;
+}
+
 static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id)
 {
     /*
target/arm/translate.c +96 -33

183 lines not on this page · raw message

Signature · 1 line
2.17.2
#4 lore raw

PATCH v5 4/5 target/arm: Enable ARMv8.2-FHM for -cpu max

In reply to Richard Henderson
---
 target/arm/cpu.c   | 1 +
 target/arm/cpu64.c | 2 ++
 2 files changed, 3 insertions(+)
target/arm/cpu.c +1 -0
index 8ea6569088..b9fa548718 100644
@@ -2003,6 +2003,7 @@ static void arm_max_initfn(Object *obj)
             t = cpu->isar.id_isar6;
             t = FIELD_DP32(t, ID_ISAR6, JSCVT, 1);
             t = FIELD_DP32(t, ID_ISAR6, DP, 1);
+            t = FIELD_DP32(t, ID_ISAR6, FHM, 1);
             cpu->isar.id_isar6 = t;
 
             t = cpu->id_mmfr4;
target/arm/cpu64.c +2 -0
index 69e4134f79..1b0c427277 100644
@@ -308,6 +308,7 @@ static void aarch64_max_initfn(Object *obj)
         t = FIELD_DP64(t, ID_AA64ISAR0, SM3, 1);
         t = FIELD_DP64(t, ID_AA64ISAR0, SM4, 1);
         t = FIELD_DP64(t, ID_AA64ISAR0, DP, 1);
+        t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 1);
         cpu->isar.id_aa64isar0 = t;
 
         t = cpu->isar.id_aa64isar1;
@@ -347,6 +348,7 @@ static void aarch64_max_initfn(Object *obj)
         u = cpu->isar.id_isar6;
         u = FIELD_DP32(u, ID_ISAR6, JSCVT, 1);
         u = FIELD_DP32(u, ID_ISAR6, DP, 1);
+        u = FIELD_DP32(u, ID_ISAR6, FHM, 1);
         cpu->isar.id_isar6 = u;
 
         /*
Signature · 1 line
2.17.2
#5 lore raw

PATCH v5 5/5 linux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT

In reply to Richard Henderson
---
 linux-user/elfload.c | 2 ++
 1 file changed, 2 insertions(+)
linux-user/elfload.c +2 -0
index 3a50d587ff..b9f7cbbdc1 100644
@@ -602,6 +602,8 @@ static uint32_t get_elf_hwcap(void)
     GET_FEATURE_ID(aa64_fcma, ARM_HWCAP_A64_FCMA);
     GET_FEATURE_ID(aa64_sve, ARM_HWCAP_A64_SVE);
     GET_FEATURE_ID(aa64_pauth, ARM_HWCAP_A64_PACA | ARM_HWCAP_A64_PACG);
+    GET_FEATURE_ID(aa64_fhm, ARM_HWCAP_A64_ASIMDFHM);
+    GET_FEATURE_ID(aa64_jscvt, ARM_HWCAP_A64_JSCVT);
 
 #undef GET_FEATURE_ID
 
Signature · 1 line
2.17.2
#6 lore raw
In reply to Richard Henderson
Quoted 10 lines · Richard Henderson

Changes since v4:

Fixed the FZ16 issue.
Add the aa64 HWCAP bits for both JSConv and FHM.

r~

Quoted 6 lines

Richard Henderson (5):
target/arm: Add helpers for FMLAL target/arm: Implement FMLAL and FMLSL for aarch64 target/arm: Implement VFMAL and VFMSL for aarch32 target/arm: Enable ARMv8.2-FHM for -cpu max
linux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT

Applied to target-arm.next, thanks.

-- PMM