[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 12:00:26 PDT 2016


Hi Xiaochu,

On 16 March 2016 at 11:49, Xiaochu Liu via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I was trying to compile a code with only integer type variables and
> integer operations. Clang/llvm kept showing me llvm code with
> floating-point instructions (fmul, fadd, fptosi, etc.). Is there a way
> in Clang or llvm to stop the compiler from doing that? My experiment
> does not allow floating-point operations...

I think Clang's "-mno-implicit-float" is probably the option you want.

I'm very surprised you're getting real floating operations like fadd
if your source really contains no floats though (it's mostly only used
implicitly for things like memcpy). So if that doesn't work, you
should probably investigate where they're coming from more deeply.
Maybe it's some external header you've included?

Cheers.

Tim.


More information about the llvm-dev mailing list