diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-09 23:32:07 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-09 23:32:07 +0000 |
commit | e5ade4a9a129dfe871e2236dcc8fbca60e870866 (patch) | |
tree | 4fb9dd9f33bea473a2792b5b874bf12509cc24fe /llvm/lib/Target/X86/X86FloatingPoint.cpp | |
parent | d32e028f792e0fb31416112ad6f7276d3decc8d8 (diff) | |
download | bcm5719-llvm-e5ade4a9a129dfe871e2236dcc8fbca60e870866.tar.gz bcm5719-llvm-e5ade4a9a129dfe871e2236dcc8fbca60e870866.zip |
Implement FpSET_ST1_*.
llvm-svn: 64186
Diffstat (limited to 'llvm/lib/Target/X86/X86FloatingPoint.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FloatingPoint.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp index 39082284aad..0c98205980d 100644 --- a/llvm/lib/Target/X86/X86FloatingPoint.cpp +++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp @@ -982,7 +982,21 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) { case X86::FpSET_ST0_32: case X86::FpSET_ST0_64: case X86::FpSET_ST0_80: - assert(StackTop == 1 && "Stack should have one element on it to return!"); + assert((StackTop == 1 || StackTop == 2) + && "Stack should have one or two element on it to return!"); + --StackTop; // "Forget" we have something on the top of stack! + break; + case X86::FpSET_ST1_32: + case X86::FpSET_ST1_64: + case X86::FpSET_ST1_80: + // StackTop can be 1 if a FpSET_ST0_* was before this. Exchange them. + if (StackTop == 1) { + BuildMI(*MBB, I, TII->get(X86::XCH_F)).addReg(X86::ST1); + NumFXCH++; + StackTop = 0; + break; + } + assert(StackTop == 2 && "Stack should have two element on it to return!"); --StackTop; // "Forget" we have something on the top of stack! break; case X86::MOV_Fp3232: |