[llvm-commits] [PATCH][MC] Add TargetAsmBackend::isFloatingPointInstruction and emit __fltused on COFF

Michael Spencer bigcheesegs at gmail.com
Sun Oct 10 00:34:28 PDT 2010


The two attached patches are required for using floating point
instructions with the Microsoft C runtime.

The first adds TargetAsmBackend::isFloatingPointInstruction and adds
an X86 implementation which returns true if any x87 regs are used.
What Windows considers a floating point instruction is undocumented,
but this seems to make the ms-crt happy.

The second patch uses this function in the COFF streamer to emit an
undefined __fltused symbol if any instructions return true. This does
some linker magic with the ms-crt. If you don't do this, the runtime
aborts.

- Michael Spencer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-add-is-fp.patch
Type: application/octet-stream
Size: 2488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101010/208cd406/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-coff-fltused.patch
Type: application/octet-stream
Size: 1720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101010/208cd406/attachment-0001.obj>


More information about the llvm-commits mailing list