Closed dherman closed 11 years ago
According to Alon, if (f)
is the same as if (f != 0.0f)
, which in LLVM looks like
%2 = fcmp ne f32 %1, 0
br i1 %2 [..]
In Emscripten this translates to
$2 = $1 != 0;
if ($2)
and then gets optimized to
if ($1 != 0)
So floats are never used for conditionals.
C allows floats to be used as conditionals. Decide whether we should allow that too, in which case the conditionals in the type checker should check for \number rather than \int.