[PATCH] D113707: [clang] Make -masm=intel affect inline asm style

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 07:08:10 PST 2021


hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: clang/lib/Headers/x86gprintrin.h:29
 #define __SSC_MARK(Tag)                                                        \
-  __asm__ __volatile__("movl %%ebx, %%eax; movl %0, %%ebx; .byte 0x64, 0x67, " \
-                       "0x90; movl %%eax, %%ebx;" ::"i"(Tag)                   \
+  __asm__ __volatile__("mov{l} {%%ebx, %%eax|eax, ebx}; "                      \
+                       "mov{l} {%0, %%ebx|ebx, %0}; "                          \
----------------
the 'l' suffix is probably not even needed for any of these movs?


================
Comment at: clang/test/CodeGen/inline-asm-intel.c:3
+
+/// Accept intel inline asm but write it out as att:
+// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple i386-unknown-unknown -mllvm -x86-asm-syntax=att -inline-asm=intel -O0 -S %s -o - | FileCheck --check-prefix=ATT %s
----------------
Could the interesting flags (-triple x86_64-unknown-unknown -mllvm -x86-asm-syntax=att -inline-asm=intel) be put right at the beginning or end of the run lines? They're pretty long, so easy to get lost in the woods otherwise.

(I think the triple slash prefix is uncommon in clang tests.)


================
Comment at: clang/test/CodeGen/inline-asm-intel.c:11
+
+// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple i386-pc-win32 -mllvm -x86-asm-syntax=intel -inline-asm=intel -O0 -S %s -o - -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 | FileCheck  --check-prefix=INTEL %s
+// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple x86_64-pc-win32 -mllvm -x86-asm-syntax=intel -inline-asm=intel -O0 -S %s -o - -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 | FileCheck  --check-prefix=INTEL %s
----------------
Maybe give these a comment too?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113707/new/

https://reviews.llvm.org/D113707



More information about the cfe-commits mailing list