LLVM IR to force floating-point truncation on x87?

For 32-bit x86 systems using the x87 unit, is there an LLVM code sequence that will force an operand of type float to 32-bit floating-point precision, i.e. dispose of any extra x87 precision? For Julia, we’ve been using a volatile store/load sequence that works, but thwarts many optimizations. Is there a better IR sequence that will force the desired precision?

More context can be found in https://github.com/JuliaLang/julia/issues/41 .

  • Arch