ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/ecb.h
(Generate patch)

Comparing CBOR-XS/ecb.h (file contents):
Revision 1.16 by root, Sun Nov 29 21:31:58 2020 UTC vs.
Revision 1.17 by root, Fri Mar 19 17:30:27 2021 UTC

878ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x); 878ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x);
879ecb_function_ ecb_const uint16_t 879ecb_function_ ecb_const uint16_t
880ecb_binary32_to_binary16 (uint32_t x) 880ecb_binary32_to_binary16 (uint32_t x)
881{ 881{
882 unsigned int s = (x >> 16) & 0x00008000; /* sign bit, the easy part */ 882 unsigned int s = (x >> 16) & 0x00008000; /* sign bit, the easy part */
883 unsigned int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */ 883 int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */
884 unsigned int m = x & 0x007fffff; 884 unsigned int m = x & 0x007fffff;
885 885
886 x &= 0x7fffffff; 886 x &= 0x7fffffff;
887 887
888 /* if it's within range of binary16 normals, use fast path */ 888 /* if it's within range of binary16 normals, use fast path */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines