[clang] 2da0df5 - [X86][bugfix] redefine __SSC_MARK to escape cpp string literal concatenation problem
Xiang1 Zhang via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 31 18:38:04 PDT 2022
Author: Xiang1 Zhang
Date: 2022-09-01T09:37:23+08:00
New Revision: 2da0df5e7cac2d06e0632522a3451e3a2dbd1a37
URL: https://github.com/llvm/llvm-project/commit/2da0df5e7cac2d06e0632522a3451e3a2dbd1a37
DIFF: https://github.com/llvm/llvm-project/commit/2da0df5e7cac2d06e0632522a3451e3a2dbd1a37.diff
LOG: [X86][bugfix] redefine __SSC_MARK to escape cpp string literal concatenation problem
Reviewed By: pengfei, RKSimon
Differential Revision: https://reviews.llvm.org/D132636
Added:
Modified:
clang/lib/Headers/x86gprintrin.h
Removed:
################################################################################
diff --git a/clang/lib/Headers/x86gprintrin.h b/clang/lib/Headers/x86gprintrin.h
index 2c2fbb97c9ac8..81d736086cf5d 100644
--- a/clang/lib/Headers/x86gprintrin.h
+++ b/clang/lib/Headers/x86gprintrin.h
@@ -26,22 +26,19 @@
#endif
#if defined(__i386__)
-#define __FULLBX "ebx"
+#define __SAVE_GPRBX "mov {%%ebx, %%eax |eax, ebx};"
+#define __RESTORE_GPRBX "mov {%%eax, %%ebx |ebx, eax};"
#define __TMPGPR "eax"
#else
// When in 64-bit target, the 32-bit operands generate a 32-bit result,
// zero-extended to a 64-bit result in the destination general-purpose,
// It means "mov x %ebx" will clobber the higher 32 bits of rbx, so we
// should preserve the 64-bit register rbx.
-#define __FULLBX "rbx"
+#define __SAVE_GPRBX "mov {%%rbx, %%rax |rax, rbx};"
+#define __RESTORE_GPRBX "mov {%%rax, %%rbx |rbx, rax};"
#define __TMPGPR "rax"
#endif
-#define __MOVEGPR(__r1, __r2) "mov {%%"__r1 ", %%"__r2 "|"__r2 ", "__r1"};"
-
-#define __SAVE_GPRBX __MOVEGPR(__FULLBX, __TMPGPR)
-#define __RESTORE_GPRBX __MOVEGPR(__TMPGPR, __FULLBX)
-
#define __SSC_MARK(__Tag) \
__asm__ __volatile__( __SAVE_GPRBX \
"mov {%0, %%ebx|ebx, %0}; " \
More information about the cfe-commits
mailing list