diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-06-28 18:57:01 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-06-28 18:57:01 +0000 |
commit | a5545bc2b9b1295f8443f6350487ec9b775b2d73 (patch) | |
tree | 15f9cce4d2d4c4cfe846cfc4a43268276360e763 /lib/Target/X86/X86FloatingPoint.cpp | |
parent | 1ca79907ef144358f16bb8abea849e806ca31134 (diff) | |
download | external_llvm-a5545bc2b9b1295f8443f6350487ec9b775b2d73.zip external_llvm-a5545bc2b9b1295f8443f6350487ec9b775b2d73.tar.gz external_llvm-a5545bc2b9b1295f8443f6350487ec9b775b2d73.tar.bz2 |
Fix an off-by-one error. Also make the code a little more explicit in what it
is trying to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FloatingPoint.cpp')
-rw-r--r-- | lib/Target/X86/X86FloatingPoint.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index 8522c8c..a4ea1a9 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -115,9 +115,10 @@ namespace { unsigned Mask = 0; for (MachineBasicBlock::livein_iterator I = MBB->livein_begin(), E = MBB->livein_end(); I != E; ++I) { - unsigned Reg = *I - X86::FP0; - if (Reg < 8) - Mask |= 1 << Reg; + unsigned Reg = *I; + if (Reg < X86::FP0 || Reg > X86::FP6) + continue; + Mask |= 1 << (Reg - X86::FP0); } return Mask; } |