]> granicus.if.org Git - clang/commitdiff
[x86][inline-asm]Allow a pack of Control Regs to be properly picked
authorCoby Tayree <coby.tayree@intel.com>
Sun, 30 Jul 2017 10:19:10 +0000 (10:19 +0000)
committerCoby Tayree <coby.tayree@intel.com>
Sun, 30 Jul 2017 10:19:10 +0000 (10:19 +0000)
Allows the incorporation of legit (x86) Control Regs within inline asm stataements

Differential Revision: https://reviews.llvm.org/D35903

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309508 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/X86.cpp
test/CodeGen/ms-inline-asm.c

index a3417d8f90f130cf2cc406848718d22d515973b0..17f52471efb506c39e8a5d13d6c98b6edb19ef13 100644 (file)
@@ -58,6 +58,7 @@ static const char *const GCCRegNames[] = {
     "zmm18", "zmm19", "zmm20", "zmm21", "zmm22",   "zmm23", "zmm24", "zmm25",
     "zmm26", "zmm27", "zmm28", "zmm29", "zmm30",   "zmm31", "k0",    "k1",
     "k2",    "k3",    "k4",    "k5",    "k6",      "k7",
+    "cr0",   "cr2",   "cr3",   "cr4",   "cr8",
 };
 
 const TargetInfo::AddlRegName AddlRegNames[] = {
index d26a660c9b0a659c168ccab75620e7a90eb050e3..ca4f815406481e6e808e83f717e307885294822f 100644 (file)
@@ -627,6 +627,17 @@ void t43() {
 // CHECK: call void asm sideeffect inteldialect "mov eax, $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
 }
 
+void t44() {
+  // CHECK-LABEL: define void @t44
+  __asm {
+    mov cr0, eax
+    mov cr2, ebx
+    mov cr3, ecx
+    mov cr4, edx
+  }
+  // CHECK: call void asm sideeffect inteldialect "mov cr0, eax\0A\09mov cr2, ebx\0A\09mov cr3, ecx\0A\09mov cr4, edx", "~{cr0},~{cr2},~{cr3},~{cr4},~{dirflag},~{fpsr},~{flags}"()
+}
+
 void dot_operator(){
 // CHECK-LABEL: define void @dot_operator
        __asm { mov eax, 3[ebx]A.b}