mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
util: add aarch64 fast half-float to float conversion
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Signed-off-by: David Heidelberg <david@ixit.cz> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31564>
This commit is contained in:
parent
c8c354d9c3
commit
3c0bf42381
1 changed files with 10 additions and 0 deletions
|
|
@ -81,6 +81,16 @@ _mesa_half_to_float(uint16_t val)
|
|||
__asm volatile("vcvtph2ps %1, %0" : "=v"(out) : "v"(in));
|
||||
return out[0];
|
||||
}
|
||||
#elif defined(USE_AARCH64_ASM)
|
||||
float result;
|
||||
uint16_t in = val;
|
||||
|
||||
__asm volatile(
|
||||
"fcvt %s0, %h1\n"
|
||||
: "=w"(result)
|
||||
: "w"(in)
|
||||
);
|
||||
return result;
|
||||
#endif
|
||||
return _mesa_half_to_float_slow(val);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue