0 Replies Latest reply on Aug 6, 2017 10:24 AM by tagoo

    [Request] Open Source "AMD Math Library (LibM)"


      Currently 4/6 of the "AMD CPU Libraries" (https://developer.amd.com/amd-cpu-libraries) are open-source. The outliers are AMD RNG Library (the related Secure RNG Library does have source distributed) and AMD Math Library.


      Given AMD's well-known support of the open-source community and their history of open-sourcing similar math-related libraries, It would be great if the AMD Math Library (LibM) could be moved into the category of "open-source" as well.


      The primary motivation behind this request is so that CoreCLR (https://github.com/dotnet/coreclr) can be updated to use this library.


      Currently, CoreCLR ends up resolving `System.Math` and `System.MathF` calls down to their CRT implementations which differ on a platform-to-platform (and sometimes compiler-to-compiler) basis. This leads to minor inconsistencies in computed results between Mac, Linux, and Windows, between x86 and ARM, and even between 32-bit and 64-bit code (Math.Ceiling on Windows x64 handles inputs in the form of `-0.xxxxxxxxx` differently and Math.Floor on Windows x86 handles `-0.0` differently). This all leads to scenarios where some platforms perform much more poorly than other platforms ([Perf] Math functions are significantly slower on Ubuntu).


      It is also generally the case that, while there are several open source LibM implementations floating around, none of them have been optimized as well as the libraries provided by AMD or Intel (or the internal CRT implementation for MacOS or Windows). All of these highly optimized/performant implementations are currently closed-source.