[llvm] Cpu features cross platform (PR #205447)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 04:07:58 PDT 2026


================
@@ -0,0 +1,51 @@
+//===- TargetDetails.h - Names for target triple components -----*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ORC_RT_TARGETDETAILS_H
+#define ORC_RT_TARGETDETAILS_H
+
+#include <string_view>
+
+namespace orc_rt::target_detail {
+
+/// Architecture names. Darwin spells AArch64 "arm64"; everywhere else it is
+/// "aarch64", so both are present.
+namespace arch {
+inline constexpr std::string_view aarch64 = "aarch64";
+inline constexpr std::string_view arm64 = "arm64";
+inline constexpr std::string_view arm64e = "arm64e";
+inline constexpr std::string_view i386 = "i386";
+inline constexpr std::string_view x86_64 = "x86_64";
+inline constexpr std::string_view x86_64h = "x86_64h";
+} // namespace arch
+
+namespace vendor {
+inline constexpr std::string_view apple = "apple";
+inline constexpr std::string_view pc = "pc";
+inline constexpr std::string_view unknown = "unknown";
+} // namespace vendor
+
+/// These should match llvm feature names.
+namespace feature {
+namespace x86 {
+inline constexpr std::string_view sse4_1 = "sse4.1";
+inline constexpr std::string_view sse4_2 = "sse4.2";
+inline constexpr std::string_view avx = "avx";
+inline constexpr std::string_view avx2 = "avx2";
+} // namespace x86
+namespace aarch64 {
+inline constexpr std::string_view neon = "neon";
+inline constexpr std::string_view dotprod = "dotprod";
+inline constexpr std::string_view fullfp16 = "fullfp16";
+inline constexpr std::string_view sha3 = "sha3";
+} // namespace aarch64
+} // namespace feature
+
+} // namespace orc_rt::target_detail
+
+#endif // ORC_RT_TARGETDETAILS_H
----------------
lhames wrote:

I'm inclined to say that we make this an implementation detail for now? (I have this suspicion that we're going to want to refactor this stuff, and no ORC runtime clients need it yet). What do you think?

https://github.com/llvm/llvm-project/pull/205447


More information about the llvm-commits mailing list