[llvm-commits] [llvm] r164926 - /llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
Craig Topper
craig.topper at gmail.com
Mon Oct 1 00:33:27 PDT 2012
Author: ctopper
Date: Mon Oct 1 02:33:27 2012
New Revision: 164926
URL: http://llvm.org/viewvc/llvm-project?rev=164926&view=rev
Log:
Use constants for all return values in switch. Allows clang to optimize it into a lookup table.
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp?rev=164926&r1=164925&r2=164926&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp Mon Oct 1 02:33:27 2012
@@ -243,9 +243,14 @@
case X86::R15: case X86::R15D: case X86::R15W: case X86::R15B:
return N86::EDI;
- case X86::ST0: case X86::ST1: case X86::ST2: case X86::ST3:
- case X86::ST4: case X86::ST5: case X86::ST6: case X86::ST7:
- return RegNo-X86::ST0;
+ case X86::ST0: return 0;
+ case X86::ST1: return 1;
+ case X86::ST2: return 2;
+ case X86::ST3: return 3;
+ case X86::ST4: return 4;
+ case X86::ST5: return 5;
+ case X86::ST6: return 6;
+ case X86::ST7: return 7;
case X86::XMM0: case X86::XMM8:
case X86::YMM0: case X86::YMM8: case X86::MM0:
More information about the llvm-commits
mailing list