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
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
The reason why this problem isn't major (or been fixed yet) is that many
LLVM frontends do not have floating point modulus built-in (i.e. C/C++),
so users must explicitly make a call to them. This problem only arises when
a frem node is to be lowered, as LLVM must then choose the runtime library
function to call.