[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 7/7] tests/tcg/arm: Manually bit-cast half-precision numbers
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 7/7] tests/tcg/arm: Manually bit-cast half-precision numbers |
Date: |
Sat, 29 Jun 2024 17:56:33 +0900 |
clang version 18.1.6 does not allow specifying an integer as the value
of a single-precision register. Manually bit-cast into float with vmov
first.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
tests/tcg/arm/fcvt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/tcg/arm/fcvt.c b/tests/tcg/arm/fcvt.c
index f631197287a1..5263f607b59c 100644
--- a/tests/tcg/arm/fcvt.c
+++ b/tests/tcg/arm/fcvt.c
@@ -355,7 +355,9 @@ 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));
+ float tmp;
+ asm("vmov %0, %1" : "=w" (tmp) : "r" (input));
+ asm("vcvtb.f32.f16 %0, %1" : "=w" (output) : "x" (tmp));
#else
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
#endif
--
2.45.2
- [PATCH v3 0/7] tests/tcg/aarch64: Fix inline assemblies for clang, Akihiko Odaki, 2024/06/29
- [PATCH v3 1/7] tests/tcg/aarch64: Use -fno-integrated-as, Akihiko Odaki, 2024/06/29
- [PATCH v3 2/7] tests/tcg/aarch64: Specify -Wa,-march=armv9-a+sme, Akihiko Odaki, 2024/06/29
- [PATCH v3 3/7] tests/tcg/aarch64: Fix test architecture specification, Akihiko Odaki, 2024/06/29
- [PATCH v3 4/7] tests/tcg/aarch64: Explicitly specify register width, Akihiko Odaki, 2024/06/29
- [PATCH v3 5/7] tests/tcg/aarch64: Fix irg operand type, Akihiko Odaki, 2024/06/29
- [PATCH v3 6/7] tests/tcg/aarch64: Do not use x constraint, Akihiko Odaki, 2024/06/29
- [PATCH v3 7/7] tests/tcg/arm: Manually bit-cast half-precision numbers,
Akihiko Odaki <=