mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
target/arm: Implement vector float32 to bfloat16 conversion
This is BFCVT{N,T} for both AArch64 AdvSIMD and SVE, and VCVT.BF16.F32 for AArch32 NEON. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525225817.400336-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3a98ac40fa
commit
d29b17ca3e
9 changed files with 95 additions and 0 deletions
|
@ -416,6 +416,13 @@ uint32_t HELPER(bfcvt)(float32 x, void *status)
|
|||
return float32_to_bfloat16(x, status);
|
||||
}
|
||||
|
||||
uint32_t HELPER(bfcvt_pair)(uint64_t pair, void *status)
|
||||
{
|
||||
bfloat16 lo = float32_to_bfloat16(extract64(pair, 0, 32), status);
|
||||
bfloat16 hi = float32_to_bfloat16(extract64(pair, 32, 32), status);
|
||||
return deposit32(lo, 16, 16, hi);
|
||||
}
|
||||
|
||||
/*
|
||||
* VFP3 fixed point conversion. The AArch32 versions of fix-to-float
|
||||
* must always round-to-nearest; the AArch64 ones honour the FPSCR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue