1 | /* |
2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
3 | * All rights reserved. |
4 | * This source code is licensed under the BSD-style license found in the |
5 | * LICENSE file in the root directory of this source tree. |
6 | */ |
7 | |
8 | #pragma once |
9 | |
10 | // We need to do a hack in inline assembly in some clang versions where we have |
11 | // to do `.intel_syntax noprefix`. This was fixed in clang in |
12 | // https://reviews.llvm.org/D113707, which made it into clang-14, but not in |
13 | // Apple's clang-14 that ships with Xcode 14. |
14 | #if defined(__clang__) |
15 | |
16 | #if ( \ |
17 | defined(__apple_build_version__) || \ |
18 | (defined(__has_builtin) && __has_builtin(__builtin_pika_xxhash64))) && \ |
19 | (__clang_major__ < 15) |
20 | #define FBGEMM_USE_CLANG_INTEL_SYNTAX_ASM_HACK 1 |
21 | #elif (__clang_major__ < 14) |
22 | #define FBGEMM_USE_CLANG_INTEL_SYNTAX_ASM_HACK 1 |
23 | #endif |
24 | |
25 | #endif // defined(__clang__) |
26 | |
27 | #ifndef FBGEMM_USE_CLANG_INTEL_SYNTAX_ASM_HACK |
28 | #define FBGEMM_USE_CLANG_INTEL_SYNTAX_ASM_HACK 0 |
29 | #endif |
30 | |