mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
tests/tcg/arm: Manually register allocate half-precision numbers
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> Message-Id: <20240705084047.857176-17-alex.bennee@linaro.org>
This commit is contained in:
parent
40126a16bd
commit
1e7c9ba4a2
1 changed files with 6 additions and 1 deletions
|
@ -355,7 +355,12 @@ static void convert_half_to_single(void)
|
||||||
|
|
||||||
print_half_number(i, input);
|
print_half_number(i, input);
|
||||||
#if defined(__arm__)
|
#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
|
#else
|
||||||
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
|
asm("fcvt %s0, %h1" : "=w" (output) : "w" (input));
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue