[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
bylaws wrote: @efriedma-quic Fair enough, I found this cleaned up things on the compiler-rt side but even then it still needed changes to handle concatenating a #, and I'd imagine that to be the same for any other existing user. It would still be nice to have something equivalent to A64NAME for user code but that probably better fits in mingw. https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
https://github.com/bylaws closed https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
efriedma-quic wrote: I can sort of see how a define could be useful, but this doesn't match any existing usage of __USER_LABEL_PREFIX__ given the relevant rules. I think reusing the name is more likely to cause confusion, rather than help anyone. https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
@@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); + } else { +resetDataLayout("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", +Triple.isWindowsArm64EC() ? "#" : ""); jroelofs wrote: Ok, mind adding just this part to _this_ patch? ``` // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64ec-windows-msvc < /dev/null | FileCheck -match-full-lines -check-prefix ARM64EC-MSVC %s // ARM64EC-MSVC: #define __USER_LABEL_PREFIX__ # ``` https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
@@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); + } else { +resetDataLayout("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", +Triple.isWindowsArm64EC() ? "#" : ""); bylaws wrote: See #78916 https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
@@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); mstorsjo wrote: AFAIK Windows+MachO is used in some cases for JIT scenarios, because the runtime linking support in the JIT is much more complete for MachO than it is for PE/COFF. https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
@@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); jroelofs wrote: Weird, I wonder when Windows+AArch64+Mach-O is ever used... maybe @compnerd knows? https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
@@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); + } else { +resetDataLayout("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", +Triple.isWindowsArm64EC() ? "#" : ""); jroelofs wrote: - [ ] this needs a test https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-aarch64 Author: Billy Laws (bylaws) Changes This is required so that the linker knows that any symbols defined in assembly code are ARM64EC rather than X86_64. CC: @cjacek --- Full diff: https://github.com/llvm/llvm-project/pull/78913.diff 1 Files Affected: - (modified) clang/lib/Basic/Targets/AArch64.cpp (+6-4) ``diff diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index d47181bfca4fc86..4f57c30279a91fb 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); + } else { +resetDataLayout("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", +Triple.isWindowsArm64EC() ? "#" : ""); + } } TargetInfo::BuiltinVaListKind `` https://github.com/llvm/llvm-project/pull/78913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC (PR #78913)
https://github.com/bylaws created https://github.com/llvm/llvm-project/pull/78913 This is required so that the linker knows that any symbols defined in assembly code are ARM64EC rather than X86_64. CC: @cjacek >From 4e2390bd8ec88af0bae6bb4fa99ebef1f966849a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Tue, 19 Sep 2023 18:03:41 +0100 Subject: [PATCH] [Clang][AArch64] Define __USER_LABEL_PREFIX__ to # for ARM64EC This is required so that the linker knows that any symbols defined in assembly code are ARM64EC rather than X86_64. --- clang/lib/Basic/Targets/AArch64.cpp | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index d47181bfca4fc8..4f57c30279a91f 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -1462,10 +1462,12 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple , } void WindowsARM64TargetInfo::setDataLayout() { - resetDataLayout(Triple.isOSBinFormatMachO() - ? "e-m:o-i64:64-i128:128-n32:64-S128" - : "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", - Triple.isOSBinFormatMachO() ? "_" : ""); + if (Triple.isOSBinFormatMachO()) { +resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128", "_"); + } else { +resetDataLayout("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128", +Triple.isWindowsArm64EC() ? "#" : ""); + } } TargetInfo::BuiltinVaListKind ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits