[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/40] tests/tcg/arm: Manually register allocate half-precisio
From: |
Alex Bennée |
Subject: |
[PATCH v2 16/40] tests/tcg/arm: Manually register allocate half-precision numbers |
Date: |
Fri, 5 Jul 2024 09:40:23 +0100 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
Clang does not allow specifying an integer as the value of a single
precision register. Explicitly move value from a general register.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
[rth: Use one single inline asm block.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20240630190050.160642-12-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/tcg/arm/fcvt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/tcg/arm/fcvt.c b/tests/tcg/arm/fcvt.c
index 157790e679..d8c61cd29f 100644
--- a/tests/tcg/arm/fcvt.c
+++ b/tests/tcg/arm/fcvt.c
@@ -355,7 +355,12 @@ static void convert_half_to_single(void)
print_half_number(i, input);
#if defined(__arm__)
- asm("vcvtb.f32.f16 %0, %1" : "=w" (output) : "x" ((uint32_t)input));
+ /*
+ * Clang refuses to allocate an integer to a fp register.
+ * Perform the move from a general register by hand.
+ */
+ asm("vmov %0, %1\n\t"
+ "vcvtb.f32.f16 %0, %0" : "=w" (output) : "r" (input));
#else
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
#endif
--
2.39.2
- [PATCH v2 11/40] tests/tcg/aarch64: Do not use x constraint, (continued)
- [PATCH v2 11/40] tests/tcg/aarch64: Do not use x constraint, Alex Bennée, 2024/07/05
- [PATCH v2 15/40] tests/tcg/arm: Use -fno-integrated-as for test-arm-iwmmxt, Alex Bennée, 2024/07/05
- [PATCH v2 01/40] tests/lcitool: fix debian-i686-cross toolchain prefix, Alex Bennée, 2024/07/05
- [PATCH v2 05/40] tests/docker: Specify --userns keep-id for Podman, Alex Bennée, 2024/07/05
- [PATCH v2 07/40] tests/tcg: Adjust variable defintion from cc-option, Alex Bennée, 2024/07/05
- [PATCH v2 10/40] tests/tcg/aarch64: Fix irg operand type, Alex Bennée, 2024/07/05
- [PATCH v2 09/40] tests/tcg/aarch64: Explicitly specify register width, Alex Bennée, 2024/07/05
- [PATCH v2 04/40] hw/core: ensure kernel_end never gets used undefined, Alex Bennée, 2024/07/05
- [PATCH v2 02/40] testing: restore some testing for i686, Alex Bennée, 2024/07/05
- [PATCH v2 16/40] tests/tcg/arm: Manually register allocate half-precision numbers,
Alex Bennée <=
- [PATCH v2 12/40] tests/tcg/aarch64: Add -fno-integrated-as for sme, Alex Bennée, 2024/07/05
- [PATCH v2 27/40] plugins: Ensure vCPU index is assigned in init/exit hooks, Alex Bennée, 2024/07/05
- [PATCH v2 28/40] plugins: Free CPUPluginState before destroying vCPU state, Alex Bennée, 2024/07/05
- [PATCH v2 06/40] tests/tcg/minilib: Constify digits in print_num, Alex Bennée, 2024/07/05
- [PATCH v2 29/40] accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/, Alex Bennée, 2024/07/05
- [PATCH v2 22/40] test/plugins: preserve the instruction record over translations, Alex Bennée, 2024/07/05
- [PATCH v2 17/40] tests/tcg/arm: Use -march and -mfpu for fcvt, Alex Bennée, 2024/07/05
- [PATCH v2 30/40] gdbstub: Clean up process_string_cmd, Alex Bennée, 2024/07/05
- [PATCH v2 18/40] tests/tcg/arm: Use vmrs/vmsr instead of mcr/mrc, Alex Bennée, 2024/07/05