Fix FREM on 32-bit MSVC on x86

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 02:52:52 PDT 2015


This is my first time using Phabricator. It seems like Phabricator is not
CCing the list, so I’ll post a link here.

http://reviews.llvm.org/D12099

Summary:


The x86 MSVC CRT library does not contain a fmodf(f32) function. It
only has the 64-bit fmod(f64) function.

Inside the MSVC CRT C headers, fmodf(f32) is defined as an inline
function which casts the f32 into an f64 and calls fmod(f64),
casting the result back. The fmodf function is never emitted into the
CRT lib.

This patch fixes this by instead promoting a 32-bit FREM into a 64-bit
FREM, but only on a 32-bit MSVC target.

This fixes an undefined symbol: fmodf error when linking on 32-bit
Windows.

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150818/20ddec2b/attachment.html>


More information about the llvm-commits mailing list