This revision was automatically updated to reflect the committed changes.
Closed by commit rL262842: [ms-inline-asm][AVX512] Add ability to use k 
registers in MS inline asm + fix… (authored by myatsina).

Changed prior to commit:
  http://reviews.llvm.org/D17766?vs=49945&id=49978#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17766

Files:
  cfe/trunk/lib/Parse/ParseStmtAsm.cpp
  cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
  cfe/trunk/test/CodeGen/ms-inline-asm.c
  cfe/trunk/test/Parser/ms-inline-asm.c

Index: cfe/trunk/test/Parser/ms-inline-asm.c
===================================================================
--- cfe/trunk/test/Parser/ms-inline-asm.c
+++ cfe/trunk/test/Parser/ms-inline-asm.c
@@ -53,6 +53,10 @@
 void t12() {
   __asm jmp label // expected-error {{use of undeclared label 'label'}}
 }
+void t13() {
+  __asm m{o}v eax, ebx // expected-error {{expected identifier}} 
expected-error {{use of undeclared label '{o}v eax, ebx'}}
+}
+
 int t_fail() { // expected-note {{to match this}}
   __asm 
   __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
Index: cfe/trunk/test/CodeGen/ms-inline-asm.c
===================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.c
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c
@@ -86,7 +86,7 @@
     __asm { pop ebx }
   }
 // CHECK: t9
-// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, 
$$0x07\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, 
$$0x07\0A\09pop ebx\0A\09", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
 }
 
 unsigned t10(void) {
Index: cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
===================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
+++ cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
@@ -9,3 +9,13 @@
          vaddpd zmm8, zmm27, zmm6
   }
 }
+
+
+void t2() {
+// CHECK: @t2
+// CHECK: call void asm sideeffect inteldialect "vaddpd zmm8 {k1}, zmm27, 
zmm6", "~{zmm8},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: ret void
+  __asm {
+         vaddpd zmm8 {k1}, zmm27, zmm6
+  }
+}
Index: cfe/trunk/lib/Parse/ParseStmtAsm.cpp
===================================================================
--- cfe/trunk/lib/Parse/ParseStmtAsm.cpp
+++ cfe/trunk/lib/Parse/ParseStmtAsm.cpp
@@ -390,6 +390,7 @@
     if (!InAsmComment && Tok.is(tok::l_brace)) {
       // Consume the opening brace.
       SkippedStartOfLine = Tok.isAtStartOfLine();
+      AsmToks.push_back(Tok);
       EndLoc = ConsumeBrace();
       BraceNesting++;
       LBraceLocs.push_back(EndLoc);
@@ -442,6 +443,11 @@
         BraceCount == (savedBraceCount + BraceNesting)) {
       // Consume the closing brace.
       SkippedStartOfLine = Tok.isAtStartOfLine();
+      // Don't want to add the closing brace of the whole asm block
+      if (SingleLineMode || BraceNesting > 1) {
+        Tok.clearFlag(Token::LeadingSpace);
+        AsmToks.push_back(Tok);
+      }
       EndLoc = ConsumeBrace();
       BraceNesting--;
       // Finish if all of the opened braces in the inline asm section were


Index: cfe/trunk/test/Parser/ms-inline-asm.c
===================================================================
--- cfe/trunk/test/Parser/ms-inline-asm.c
+++ cfe/trunk/test/Parser/ms-inline-asm.c
@@ -53,6 +53,10 @@
 void t12() {
   __asm jmp label // expected-error {{use of undeclared label 'label'}}
 }
+void t13() {
+  __asm m{o}v eax, ebx // expected-error {{expected identifier}} expected-error {{use of undeclared label '{o}v eax, ebx'}}
+}
+
 int t_fail() { // expected-note {{to match this}}
   __asm 
   __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
Index: cfe/trunk/test/CodeGen/ms-inline-asm.c
===================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.c
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c
@@ -86,7 +86,7 @@
     __asm { pop ebx }
   }
 // CHECK: t9
-// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, $$0x07\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, $$0x07\0A\09pop ebx\0A\09", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
 }
 
 unsigned t10(void) {
Index: cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
===================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
+++ cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
@@ -9,3 +9,13 @@
 	  vaddpd zmm8, zmm27, zmm6
   }
 }
+
+
+void t2() {
+// CHECK: @t2
+// CHECK: call void asm sideeffect inteldialect "vaddpd zmm8 {k1}, zmm27, zmm6", "~{zmm8},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: ret void
+  __asm {
+	  vaddpd zmm8 {k1}, zmm27, zmm6
+  }
+}
Index: cfe/trunk/lib/Parse/ParseStmtAsm.cpp
===================================================================
--- cfe/trunk/lib/Parse/ParseStmtAsm.cpp
+++ cfe/trunk/lib/Parse/ParseStmtAsm.cpp
@@ -390,6 +390,7 @@
     if (!InAsmComment && Tok.is(tok::l_brace)) {
       // Consume the opening brace.
       SkippedStartOfLine = Tok.isAtStartOfLine();
+      AsmToks.push_back(Tok);
       EndLoc = ConsumeBrace();
       BraceNesting++;
       LBraceLocs.push_back(EndLoc);
@@ -442,6 +443,11 @@
         BraceCount == (savedBraceCount + BraceNesting)) {
       // Consume the closing brace.
       SkippedStartOfLine = Tok.isAtStartOfLine();
+      // Don't want to add the closing brace of the whole asm block
+      if (SingleLineMode || BraceNesting > 1) {
+        Tok.clearFlag(Token::LeadingSpace);
+        AsmToks.push_back(Tok);
+      }
       EndLoc = ConsumeBrace();
       BraceNesting--;
       // Finish if all of the opened braces in the inline asm section were
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to