[llvm-branch-commits] [llvm-branch] r322654 - Merging r322623:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 17 05:56:34 PST 2018


Author: hans
Date: Wed Jan 17 05:56:34 2018
New Revision: 322654

URL: http://llvm.org/viewvc/llvm-project?rev=322654&view=rev
Log:
Merging r322623:
------------------------------------------------------------------------
r322623 | avt77 | 2018-01-17 02:12:06 -0800 (Wed, 17 Jan 2018) | 3 lines

Allow usage of X86-prefixes as separate instrs.
Differential Revision: https://reviews.llvm.org/D42102

------------------------------------------------------------------------

Modified:
    llvm/branches/release_60/   (props changed)
    llvm/branches/release_60/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/branches/release_60/test/CodeGen/X86/inline-asm-A-constraint.ll
    llvm/branches/release_60/test/MC/X86/x86-64.s

Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 17 05:56:34 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321789,321980,322056,322103
+/llvm/trunk:155241,321789,321980,322056,322103,322623

Modified: llvm/branches/release_60/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=322654&r1=322653&r2=322654&view=diff
==============================================================================
--- llvm/branches/release_60/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/branches/release_60/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jan 17 05:56:34 2018
@@ -2375,6 +2375,13 @@ bool X86AsmParser::ParseInstruction(Pars
             .Cases("repne", "repnz", X86::IP_HAS_REPEAT_NE)
             .Default(X86::IP_NO_PREFIX); // Invalid prefix (impossible)
     Flags |= Prefix;
+    if (getLexer().is(AsmToken::EndOfStatement)) {
+      // We don't have real instr with the given prefix
+      //  let's use the prefix as the instr.
+      // TODO: there could be several prefixes one after another
+      Flags = X86::IP_NO_PREFIX;
+      break;
+    }
     Name = Parser.getTok().getString();
     Parser.Lex(); // eat the prefix
     // Hack: we could have something like "rep # some comment" or

Modified: llvm/branches/release_60/test/CodeGen/X86/inline-asm-A-constraint.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/test/CodeGen/X86/inline-asm-A-constraint.ll?rev=322654&r1=322653&r2=322654&view=diff
==============================================================================
--- llvm/branches/release_60/test/CodeGen/X86/inline-asm-A-constraint.ll (original)
+++ llvm/branches/release_60/test/CodeGen/X86/inline-asm-A-constraint.ll Wed Jan 17 05:56:34 2018
@@ -19,7 +19,8 @@ entry:
   %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.extract.trunc, 1
   ret { i64, i64 } %.fca.1.insert
 }
-; CHECK: lock cmpxchg16b
+; CHECK: lock
+; CHECK-NEXT: cmpxchg16b
 
 attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind }

Modified: llvm/branches/release_60/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/test/MC/X86/x86-64.s?rev=322654&r1=322653&r2=322654&view=diff
==============================================================================
--- llvm/branches/release_60/test/MC/X86/x86-64.s (original)
+++ llvm/branches/release_60/test/MC/X86/x86-64.s Wed Jan 17 05:56:34 2018
@@ -99,7 +99,8 @@
 // CHECK: shll $2, %eax
         sall $2, %eax
 
-// CHECK: rep movsb
+// CHECK: rep
+// CHECK-NEXT: movsb
 rep     # comment
 movsb
 
@@ -1557,3 +1558,38 @@ ptwriteq 0xdeadbeef(%rbx,%rcx,8)
 // CHECK: ptwriteq %rax
 // CHECK:  encoding: [0xf3,0x48,0x0f,0xae,0xe0]
 ptwriteq %rax
+
+//  __asm __volatile(
+//    "pushf        \n\t"
+//    "popf       \n\t"
+//    "rep        \n\t"
+//    ".byte  0x0f, 0xa7, 0xd0"
+//  );
+// CHECK: pushfq
+// CHECK-NEXT: popfq
+// CHECK-NEXT: rep
+// CHECK-NEXT: .byte 15
+// CHECK-NEXT: .byte 167
+// CHECK-NEXT: .byte 208
+pushfq
+popfq
+rep
+.byte 15
+.byte 167
+.byte 208
+
+// CHECK: lock
+// CHECK: cmpxchgl
+        cmp $0, %edx
+        je 1f
+        lock
+1:      cmpxchgl %ecx,(%rdi)
+
+// CHECK: rep
+// CHECK-NEXT: byte
+rep
+.byte 0xa4      # movsb
+
+// CHECK: lock
+// This line has to be the last one in the file
+lock




More information about the llvm-branch-commits mailing list