commit | c2b391b0768dbf3ddf46ab0472e8f79afdf1eba6 | [log] [tgz] |
---|---|---|
author | Stephen Hines <srhines@google.com> | Wed Feb 17 16:25:38 2021 -0800 |
committer | Stephen Hines <srhines@google.com> | Wed Feb 17 16:25:38 2021 -0800 |
tree | bf795792c727b7d3d47af92580a2ac7157e72cd1 | |
parent | 79600fa2fb95b47b93ebd112cd17edd3a0839980 [diff] |
Fix undefined behavior (UB) from calling builtin_clz(0) `builtin_clz()` is not defined for an input value of 0, which this code explicitly doesn't check for (but does test). Changing the header to check for zero first is the only safe way to call this function. Bug: 180508959 Bug: 180509815 Test: atest Fp16AltToFp32BitsTests Fp16IEEEToFp32BitsTests Change-Id: Ie65daef09e47be398f471325ce048974ca48c0c0
Header-only library for conversion to/from half-precision floating point formats
The library is developed by Marat Dukhan of Georgia Tech. FP16 is a research project at Richard Vuduc's HPC Garage lab in the Georgia Institute of Technology, College of Computing, School of Computational Science and Engineering.
This material is based upon work supported by the U.S. National Science Foundation (NSF) Award Number 1339745. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of NSF.