[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v2 03/32] target/arm/cpu64: allow fp16 to be disabled
From: |
Alex Bennée |
Subject: |
[Qemu-arm] [PATCH v2 03/32] target/arm/cpu64: allow fp16 to be disabled |
Date: |
Thu, 8 Feb 2018 17:31:28 +0000 |
While for CONFIG_USER_ONLY it is policy for the "cpu" to be the most
capable is can be this does cause problems. For example legacy RISU
runs would fail as there are a bunch of implemented instructions which
would have caused failures that now trigger actual calculations.
Signed-off-by: Alex Bennée <address@hidden>
---
target/arm/cpu64.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 973614dfc6..0dc4debd9c 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -275,6 +275,26 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool
value, Error **errp)
}
}
+#ifdef CONFIG_USER_ONLY
+static bool aarch64_cpu_get_fp16(Object *obj, Error **errp)
+{
+ ARMCPU *cpu = ARM_CPU(obj);
+
+ return arm_feature(&cpu->env, ARM_FEATURE_V8_FP16);
+}
+
+static void aarch64_cpu_set_fp16(Object *obj, bool value, Error **errp)
+{
+ ARMCPU *cpu = ARM_CPU(obj);
+
+ if (value == false) {
+ unset_feature(&cpu->env, ARM_FEATURE_V8_FP16);
+ } else {
+ set_feature(&cpu->env, ARM_FEATURE_V8_FP16);
+ }
+}
+#endif
+
static void aarch64_cpu_initfn(Object *obj)
{
object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64,
@@ -283,6 +303,13 @@ static void aarch64_cpu_initfn(Object *obj)
"Set on/off to enable/disable aarch64 "
"execution state ",
NULL);
+#ifdef CONFIG_USER_ONLY
+ object_property_add_bool(obj, "fp16", aarch64_cpu_get_fp16,
+ aarch64_cpu_set_fp16, NULL);
+ object_property_set_description(obj, "fp16",
+ "Set on/off to enable/disable FP16
extensions ",
+ NULL);
+#endif
}
static void aarch64_cpu_finalizefn(Object *obj)
--
2.15.1
- [Qemu-arm] [PATCH v2 00/32] Add ARMv8.2 half-precision functions, Alex Bennée, 2018/02/08
- [Qemu-arm] [PATCH v2 03/32] target/arm/cpu64: allow fp16 to be disabled,
Alex Bennée <=
- [Qemu-arm] [PATCH v2 01/32] include/exec/helper-head.h: support f16 in helper calls, Alex Bennée, 2018/02/08
- [Qemu-arm] [PATCH v2 04/32] target/arm/cpu.h: update comment for half-precision values, Alex Bennée, 2018/02/08
- [Qemu-arm] [PATCH v2 02/32] target/arm/cpu64: introduce ARM_V8_FP16 feature bit, Alex Bennée, 2018/02/08
- [Qemu-arm] [PATCH v2 06/32] target/arm/helper: pass explicit fpst to set_rmode, Alex Bennée, 2018/02/08
- [Qemu-arm] [PATCH v2 08/32] arm/translate-a64: handle_3same_64 comment fix, Alex Bennée, 2018/02/08