mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 22:25:27 +00:00
target/arm: Make isar_feature_aa32_fp16_arith() handle M-profile
The M-profile definition of the MVFR1 ID register differs slightly from the A-profile one, and in particular the check for "does the CPU support fp16 arithmetic" is not the same. We don't currently implement any M-profile CPUs with fp16 arithmetic, so this is not yet a visible bug, but correcting the logic now disarms this beartrap for when we eventually do. Backports commit dfc523a84b06b6a4b583ed4c29d24fd980dd37a0
This commit is contained in:
parent
09a7d6381e
commit
79feec40df
|
@ -1672,6 +1672,15 @@ FIELD(ID_MMFR4, LSM, 20, 4)
|
|||
FIELD(ID_MMFR4, CCIDX, 24, 4)
|
||||
FIELD(ID_MMFR4, EVT, 28, 4)
|
||||
|
||||
FIELD(ID_PFR1, PROGMOD, 0, 4)
|
||||
FIELD(ID_PFR1, SECURITY, 4, 4)
|
||||
FIELD(ID_PFR1, MPROGMOD, 8, 4)
|
||||
FIELD(ID_PFR1, VIRTUALIZATION, 12, 4)
|
||||
FIELD(ID_PFR1, GENTIMER, 16, 4)
|
||||
FIELD(ID_PFR1, SEC_FRAC, 20, 4)
|
||||
FIELD(ID_PFR1, VIRT_FRAC, 24, 4)
|
||||
FIELD(ID_PFR1, GIC, 28, 4)
|
||||
|
||||
FIELD(ID_AA64ISAR0, AES, 4, 4)
|
||||
FIELD(ID_AA64ISAR0, SHA1, 8, 4)
|
||||
FIELD(ID_AA64ISAR0, SHA2, 12, 4)
|
||||
|
@ -1789,10 +1798,12 @@ FIELD(MVFR0, FPROUND, 28, 4)
|
|||
|
||||
FIELD(MVFR1, FPFTZ, 0, 4)
|
||||
FIELD(MVFR1, FPDNAN, 4, 4)
|
||||
FIELD(MVFR1, SIMDLS, 8, 4)
|
||||
FIELD(MVFR1, SIMDINT, 12, 4)
|
||||
FIELD(MVFR1, SIMDSP, 16, 4)
|
||||
FIELD(MVFR1, SIMDHP, 20, 4)
|
||||
FIELD(MVFR1, SIMDLS, 8, 4) /* A-profile only */
|
||||
FIELD(MVFR1, SIMDINT, 12, 4) /* A-profile only */
|
||||
FIELD(MVFR1, SIMDSP, 16, 4) /* A-profile only */
|
||||
FIELD(MVFR1, SIMDHP, 20, 4) /* A-profile only */
|
||||
FIELD(MVFR1, MVE, 8, 4) /* M-profile only */
|
||||
FIELD(MVFR1, FP16, 20, 4) /* M-profile only */
|
||||
FIELD(MVFR1, FPHP, 24, 4)
|
||||
FIELD(MVFR1, SIMDFMAC, 28, 4)
|
||||
|
||||
|
@ -3381,9 +3392,19 @@ static inline bool isar_feature_aa32_predinv(const ARMISARegisters *id)
|
|||
return FIELD_EX32(id->id_isar6, ID_ISAR6, SPECRES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mprofile(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr1, ID_PFR1, MPROGMOD) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) >= 3;
|
||||
/* Sadly this is encoded differently for A-profile and M-profile */
|
||||
if (isar_feature_aa32_mprofile(id)) {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FP16) > 0;
|
||||
} else {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) >= 3;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vfp_simd(const ARMISARegisters *id)
|
||||
|
|
Loading…
Reference in a new issue