[libc-commits] [PATCH] D105638: [libc] Modify the struct that captures floating point encoding to have setters and getters

Hedin GarcĂ­a via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 08:55:23 PDT 2021


hedingarcia created this revision.
Herald added subscribers: libc-commits, ecnelises, tschuett, pengfei.
Herald added a project: libc-project.
hedingarcia requested review of this revision.

Redefined FPBits.h and LongDoubleBitsX86 to have structs that adjust the value of the bit
representation of a float by using setters and getters functions and use values such as
bit masks from FloatProperties.h. Subsequent files that made reference to the instance
of the struct, by targeting its specific variables(like mantissa, exponent, and sign),
were fixed to call these functions to modify its value indirectly. This implementation was
done to make sure the struct works for Windows and Linux platform maintaining pack memory
alignment of the struct so its size in memory is the same as the data type of the float point number.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105638

Files:
  libc/test/src/math/LdExpTest.h
  libc/test/src/math/NextAfterTest.h
  libc/test/src/math/RoundToIntegerTest.h
  libc/test/src/math/SqrtTest.h
  libc/utils/FPUtil/BasicOperations.h
  libc/utils/FPUtil/DivisionAndRemainderOperations.h
  libc/utils/FPUtil/FPBits.h
  libc/utils/FPUtil/Hypot.h
  libc/utils/FPUtil/LongDoubleBitsX86.h
  libc/utils/FPUtil/ManipulationFunctions.h
  libc/utils/FPUtil/NearestIntegerOperations.h
  libc/utils/FPUtil/NextAfterLongDoubleX86.h
  libc/utils/FPUtil/NormalFloat.h
  libc/utils/FPUtil/Sqrt.h
  libc/utils/FPUtil/SqrtLongDoubleX86.h
  libc/utils/FPUtil/TestHelpers.cpp
  libc/utils/FPUtil/generic/FMA.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105638.357241.patch
Type: text/x-patch
Size: 42046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210708/228c29eb/attachment-0001.bin>


More information about the libc-commits mailing list