[PATCH] D35903: [x86][inline-asm]Allow a pack of Control Regs to be properly picked

coby via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 26 10:19:14 PDT 2017


coby created this revision.
Herald added a subscriber: eraman.

Allows the incorporation of legit (x86) Control Regs within inline asm stataements


Repository:
  rL LLVM

https://reviews.llvm.org/D35903

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


Index: lib/Basic/Targets/X86.cpp
===================================================================
--- lib/Basic/Targets/X86.cpp
+++ lib/Basic/Targets/X86.cpp
@@ -58,6 +58,7 @@
     "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: test/CodeGen/ms-inline-asm.c
===================================================================
--- test/CodeGen/ms-inline-asm.c
+++ test/CodeGen/ms-inline-asm.c
@@ -627,6 +627,17 @@
 // 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}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35903.108317.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170726/6f765b4c/attachment.bin>


More information about the cfe-commits mailing list