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

Michael Spencer bigcheesegs at gmail.com
Tue Oct 12 19:39:43 PDT 2010


On Sun, Oct 10, 2010 at 3:34 AM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> 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
>

Here's a better implementation.

- Michael Spencer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fltused.patch
Type: application/octet-stream
Size: 5407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101012/14ff2389/attachment.obj>


More information about the llvm-commits mailing list