From b1ad813b474ab7935b2c40d84c99c2b59cd67f79 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 17 Nov 2021 14:03:01 -0500 Subject: [PATCH] [clang] Address review comments on https://reviews.llvm.org/D113707 - Drop a needless `l` size suffix on a mov instruction in AT&T mode - Move varying bits of test flags to front - Add a comment about MS mode test --- clang/lib/Headers/x86gprintrin.h | 6 +++--- clang/test/CodeGen/inline-asm-intel.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/clang/lib/Headers/x86gprintrin.h b/clang/lib/Headers/x86gprintrin.h index 83f13f0cf2085..01e741f1eb611 100644 --- a/clang/lib/Headers/x86gprintrin.h +++ b/clang/lib/Headers/x86gprintrin.h @@ -26,10 +26,10 @@ #endif #define __SSC_MARK(Tag) \ - __asm__ __volatile__("mov{l} {%%ebx, %%eax|eax, ebx}; " \ - "mov{l} {%0, %%ebx|ebx, %0}; " \ + __asm__ __volatile__("mov {%%ebx, %%eax|eax, ebx}; " \ + "mov {%0, %%ebx|ebx, %0}; " \ ".byte 0x64, 0x67, 0x90; " \ - "mov{l} {%%eax, %%ebx|ebx, eax};" ::"i"(Tag) \ + "mov {%%eax, %%ebx|ebx, eax};" ::"i"(Tag) \ : "%eax"); #endif /* __X86GPRINTRIN_H */ diff --git a/clang/test/CodeGen/inline-asm-intel.c b/clang/test/CodeGen/inline-asm-intel.c index 25d88b1140fe3..fb737a6e85e25 100644 --- a/clang/test/CodeGen/inline-asm-intel.c +++ b/clang/test/CodeGen/inline-asm-intel.c @@ -1,15 +1,17 @@ // REQUIRES: x86-registered-target /// 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 -// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple x86_64-unknown-unknown -mllvm -x86-asm-syntax=att -inline-asm=intel -O0 -S %s -o - | FileCheck --check-prefix=ATT %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -mllvm -x86-asm-syntax=att -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - | FileCheck --check-prefix=ATT %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -mllvm -x86-asm-syntax=att -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - | FileCheck --check-prefix=ATT %s /// Accept intel inline asm and write it out as intel: -// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple i386-unknown-unknown -mllvm -x86-asm-syntax=intel -inline-asm=intel -O0 -S %s -o - | FileCheck --check-prefix=INTEL %s -// RUN: %clang_cc1 -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -triple x86_64-unknown-unknown -mllvm -x86-asm-syntax=intel -inline-asm=intel -O0 -S %s -o - | FileCheck --check-prefix=INTEL %s +// RUN: %clang_cc1 -triple i386-unknown-unknown -mllvm -x86-asm-syntax=intel -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - | FileCheck --check-prefix=INTEL %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -mllvm -x86-asm-syntax=intel -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - | FileCheck --check-prefix=INTEL %s -// 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 +/// Check MS compat mode (_MSC_VER defined). The driver always picks intel +/// output in that mode, so test only that. +// RUN: %clang_cc1 -triple i386-pc-win32 -mllvm -x86-asm-syntax=intel -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 | FileCheck --check-prefix=INTEL %s +// RUN: %clang_cc1 -triple x86_64-pc-win32 -mllvm -x86-asm-syntax=intel -inline-asm=intel -Werror -target-feature +hreset -target-feature +pconfig -target-feature +sgx -ffreestanding -O0 -S %s -o - -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 | FileCheck --check-prefix=INTEL %s // Test that intrinsics headers still work with -masm=intel. #ifdef _MSC_VER