diff options
author | Craig Topper <craig.topper@gmail.com> | 2013-07-21 07:28:13 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2013-07-21 07:28:13 +0000 |
commit | 8956fe0dbc6798fa6d3e5f958626f2c0a55505d7 (patch) | |
tree | 4250fdfb8238785b3230037e02d1467c18251726 | |
parent | f6bb6a464cd40e3e09634b3bad7bca604d3498a1 (diff) | |
download | bcm5719-llvm-8956fe0dbc6798fa6d3e5f958626f2c0a55505d7.tar.gz bcm5719-llvm-8956fe0dbc6798fa6d3e5f958626f2c0a55505d7.zip |
Mark that the _ftol2 function used by windows on x86 to handle fptoui modifies ECX.
llvm-svn: 186787
-rw-r--r-- | llvm/lib/Target/X86/X86FloatingPoint.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrCompiler.td | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp index a4ea1a9eab0..48470da0164 100644 --- a/llvm/lib/Target/X86/X86FloatingPoint.cpp +++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp @@ -1662,6 +1662,7 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) { BuildMI(*MBB, I, MI->getDebugLoc(), TII->get(X86::CALLpcrel32)) .addExternalSymbol("_ftol2") .addReg(X86::ST0, RegState::ImplicitKill) + .addReg(X86::ECX, RegState::ImplicitDefine) .addReg(X86::EAX, RegState::Define | RegState::Implicit) .addReg(X86::EDX, RegState::Define | RegState::Implicit) .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit); diff --git a/llvm/lib/Target/X86/X86InstrCompiler.td b/llvm/lib/Target/X86/X86InstrCompiler.td index 8a7ee7d077f..89699462982 100644 --- a/llvm/lib/Target/X86/X86InstrCompiler.td +++ b/llvm/lib/Target/X86/X86InstrCompiler.td @@ -129,12 +129,13 @@ def SEG_ALLOCA_64 : I<0, Pseudo, (outs GR64:$dst), (ins GR64:$size), // The MSVC runtime contains an _ftol2 routine for converting floating-point // to integer values. It has a strange calling convention: the input is -// popped from the x87 stack, and the return value is given in EDX:EAX. No -// other registers (aside from flags) are touched. +// popped from the x87 stack, and the return value is given in EDX:EAX. ECX is +// used as a temporary register. No other registers (aside from flags) are +// touched. // Microsoft toolchains do not support 80-bit precision, so a WIN_FTOL_80 // variant is unnecessary. -let Defs = [EAX, EDX, EFLAGS], FPForm = SpecialFP in { +let Defs = [EAX, EDX, ECX, EFLAGS], FPForm = SpecialFP in { def WIN_FTOL_32 : I<0, Pseudo, (outs), (ins RFP32:$src), "# win32 fptoui", [(X86WinFTOL RFP32:$src)]>, |