mirror of
https://github.com/yuzu-mirror/unicorn.git
synced 2026-04-21 06:13:54 +00:00
include/fpu/softfloat: implement float16_chs helper
Backports commit 5f10aef521427b3909c24a0c7a82839b43f876e2 from qemu
This commit is contained in:
parent
facbc9ef66
commit
380699fa35
1 changed files with 8 additions and 0 deletions
|
|
@ -260,6 +260,14 @@ static inline float16 float16_abs(float16 a)
|
|||
return make_float16(float16_val(a) & 0x7fff);
|
||||
}
|
||||
|
||||
static inline float16 float16_chs(float16 a)
|
||||
{
|
||||
/* Note that chs does *not* handle NaN specially, nor does
|
||||
* it flush denormal inputs to zero.
|
||||
*/
|
||||
return make_float16(float16_val(a) ^ 0x8000);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The pattern for a default generated half-precision NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue