[llvm-branch-commits] [llvm-branch] r105017 - in /llvm/branches/Apple/whitney: lib/Target/X86/X86RegisterInfo.cpp test/MC/AsmParser/X86/x86_32-new-encoder.s
Daniel Dunbar
daniel at zuster.org
Fri May 28 16:01:57 PDT 2010
Author: ddunbar
Date: Fri May 28 18:01:57 2010
New Revision: 105017
URL: http://llvm.org/viewvc/llvm-project?rev=105017&view=rev
Log:
Merge r104994:
--
Author: Kevin Enderby <enderby at apple.com>
Date: Fri May 28 19:01:27 2010 +0000
Fix the use of x86 control and debug registers so that the assertion failure in
getX86RegNum() does not happen. Patch by Shantonu Sen!
Modified:
llvm/branches/Apple/whitney/lib/Target/X86/X86RegisterInfo.cpp
llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_32-new-encoder.s
Modified: llvm/branches/Apple/whitney/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/X86RegisterInfo.cpp?rev=105017&r1=105016&r2=105017&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/X86RegisterInfo.cpp Fri May 28 18:01:57 2010
@@ -157,6 +157,34 @@
case X86::GS:
return 5;
+ case X86::CR0:
+ return 0;
+ case X86::CR1:
+ return 1;
+ case X86::CR2:
+ return 2;
+ case X86::CR3:
+ return 3;
+ case X86::CR4:
+ return 4;
+
+ case X86::DR0:
+ return 0;
+ case X86::DR1:
+ return 1;
+ case X86::DR2:
+ return 2;
+ case X86::DR3:
+ return 3;
+ case X86::DR4:
+ return 4;
+ case X86::DR5:
+ return 5;
+ case X86::DR6:
+ return 6;
+ case X86::DR7:
+ return 7;
+
default:
assert(isVirtualRegister(RegNo) && "Unknown physical register!");
llvm_unreachable("Register allocator hasn't allocated reg correctly yet!");
Modified: llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_32-new-encoder.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_32-new-encoder.s?rev=105017&r1=105016&r2=105017&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_32-new-encoder.s (original)
+++ llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_32-new-encoder.s Fri May 28 18:01:57 2010
@@ -331,3 +331,60 @@
// CHECK: movw (%eax), %cs
// CHECK: encoding: [0x66,0x8e,0x08]
movw (%eax), %cs
+
+// radr://8033374
+// CHECK: movl %cr0, %eax
+// CHECK: encoding: [0x0f,0x20,0xc0]
+ movl %cr0,%eax
+
+// CHECK: movl %cr1, %eax
+// CHECK: encoding: [0x0f,0x20,0xc8]
+ movl %cr1,%eax
+
+// CHECK: movl %cr2, %eax
+// CHECK: encoding: [0x0f,0x20,0xd0]
+ movl %cr2,%eax
+
+// CHECK: movl %cr3, %eax
+// CHECK: encoding: [0x0f,0x20,0xd8]
+ movl %cr3,%eax
+
+// CHECK: movl %cr4, %eax
+// CHECK: encoding: [0x0f,0x20,0xe0]
+ movl %cr4,%eax
+
+// CHECK: movl %dr0, %eax
+// CHECK: encoding: [0x0f,0x21,0xc0]
+ movl %dr0,%eax
+
+// CHECK: movl %dr1, %eax
+// CHECK: encoding: [0x0f,0x21,0xc8]
+ movl %dr1,%eax
+
+// CHECK: movl %dr1, %eax
+// CHECK: encoding: [0x0f,0x21,0xc8]
+ movl %dr1,%eax
+
+// CHECK: movl %dr2, %eax
+// CHECK: encoding: [0x0f,0x21,0xd0]
+ movl %dr2,%eax
+
+// CHECK: movl %dr3, %eax
+// CHECK: encoding: [0x0f,0x21,0xd8]
+ movl %dr3,%eax
+
+// CHECK: movl %dr4, %eax
+// CHECK: encoding: [0x0f,0x21,0xe0]
+ movl %dr4,%eax
+
+// CHECK: movl %dr5, %eax
+// CHECK: encoding: [0x0f,0x21,0xe8]
+ movl %dr5,%eax
+
+// CHECK: movl %dr6, %eax
+// CHECK: encoding: [0x0f,0x21,0xf0]
+ movl %dr6,%eax
+
+// CHECK: movl %dr7, %eax
+// CHECK: encoding: [0x0f,0x21,0xf8]
+ movl %dr7,%eax
More information about the llvm-branch-commits
mailing list