[llvm-dev] How to prevent clang/llvm from generating floating-point instructions?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 16 19:37:01 PDT 2016


On 16 March 2016 at 19:10, Xiaochu Liu <xiaochu1122 at gmail.com> wrote:
> I was wondering if there exists an LLVM pass that emulate floating
> point operations with integers? Or simply just convert fp ops to int
> ons in an approximate way... I found certain backend has software
> float-point emulation support but not on IR-level.

I'm afraid not. If libcalls do need to be used, LLVM expects to expand
them during the DAG phase. I don't *think* LLVM can do that for x86.
DragonEgg is mostly pretty unsupported these days, but you could try
giving it the "-msoft-float" option.

If GCC's frontend inserts the calls early enough, you might get away
with it. But I have no idea when that actually happens.

Cheers.

Tim.


More information about the llvm-dev mailing list