sheisc created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
sheisc requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

The GNU assembler (used in gcc) complains about the syntactic correctness of
the assembly code (at line 9) generated by clang (with the option 
-no-integrated-as).

We need to delete the white space in "{%k1} {z}" (at line 9) to make both GCC 
and LLVM happy.

iron@CSE:demo$ cat -n main.s

   1            .text
   2            .file   "main.c"
   3            .globl  main                    # -- Begin function main
   4            .p2align        4, 0x90
   5            .type   main,@function
   6    main:                                   # @main
   7            .cfi_startproc
   8    # %bb.0:                                # %entry
   9            vmovdqu16 %zmm5 , %zmm5 {%k1} {z}
  10            xorl    %eax, %eax
  11            retq
  12    .Lfunc_end0:
  13            .size   main, .Lfunc_end0-main
  14            .cfi_endproc
  15                                            # -- End function
  16
  17            .ident  "clang"
  18            .section        ".note.GNU-stack","",@progbits

iron@CSE:demo$ clang -c main.s -o main.o

iron@CSE:demo$ gcc -c main.s -o main.o

main.s: Assembler messages:
main.s:9: Error: unknown vector operation: ` {z}'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125789

Files:
  clang/docs/ReleaseNotes.rst
  llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
  llvm/lib/Target/X86/X86MCInstLower.cpp


Index: llvm/lib/Target/X86/X86MCInstLower.cpp
===================================================================
--- llvm/lib/Target/X86/X86MCInstLower.cpp
+++ llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1877,7 +1877,7 @@
       CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";
 
       if (SrcOp1Idx == 2) {
-        CS << " {z}";
+        CS << "{z}";
       }
     }
   }
Index: llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
===================================================================
--- llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
+++ llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
@@ -278,7 +278,7 @@
 
   // MASKZ: zmmX {%kY} {z}
   if (MaskWithZero)
-    OS << " {z}";
+    OS << "{z}";
 }
 
 static bool printFMAComments(const MCInst *MI, raw_ostream &OS,
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -365,7 +365,7 @@
   of clang; use the ``-fclang-abi-compat=14`` option to get the old mangling.
 - Preprocessor character literals with a ``u8`` prefix are now correctly 
treated as
   unsigned character literals. This fixes `Issue 54886 
<https://github.com/llvm/llvm-project/issues/54886>`_.
-- Stopped allowing constriants on non-template functions to be compliant with
+- Stopped allowing constraints on non-template functions to be compliant with
   dcl.decl.general p4.
 
 C++20 Feature Support


Index: llvm/lib/Target/X86/X86MCInstLower.cpp
===================================================================
--- llvm/lib/Target/X86/X86MCInstLower.cpp
+++ llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1877,7 +1877,7 @@
       CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";
 
       if (SrcOp1Idx == 2) {
-        CS << " {z}";
+        CS << "{z}";
       }
     }
   }
Index: llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
===================================================================
--- llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
+++ llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp
@@ -278,7 +278,7 @@
 
   // MASKZ: zmmX {%kY} {z}
   if (MaskWithZero)
-    OS << " {z}";
+    OS << "{z}";
 }
 
 static bool printFMAComments(const MCInst *MI, raw_ostream &OS,
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -365,7 +365,7 @@
   of clang; use the ``-fclang-abi-compat=14`` option to get the old mangling.
 - Preprocessor character literals with a ``u8`` prefix are now correctly treated as
   unsigned character literals. This fixes `Issue 54886 <https://github.com/llvm/llvm-project/issues/54886>`_.
-- Stopped allowing constriants on non-template functions to be compliant with
+- Stopped allowing constraints on non-template functions to be compliant with
   dcl.decl.general p4.
 
 C++20 Feature Support
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D125789: Fix release ... Changwei Zou via Phabricator via cfe-commits

Reply via email to