[libc][NFC] Move aligned access implementations to separate header
[llvm-project.git] / libc / src / __support / FPUtil / PlatformDefs.h
blob175a62a1c930ebf2cfd30d46d824a89d76314e5c
1 //===-- Platform specific macro definitions ---------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_PLATFORM_DEFS_H
10 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_PLATFORM_DEFS_H
12 #include "src/__support/macros/properties/architectures.h"
14 #if defined(LIBC_TARGET_ARCH_IS_X86)
15 #define X87_FPU
16 #endif
18 // https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-Details/Basic-data-types
19 // https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
20 // https://docs.amd.com/bundle/HIP-Programming-Guide-v5.1/page/Programming_with_HIP.html
21 #if defined(_WIN32) || defined(__arm__) || defined(__NVPTX__) || \
22 defined(__AMDGPU__) || (defined(__APPLE__) && defined(__aarch64__))
23 #define LONG_DOUBLE_IS_DOUBLE
24 #endif
26 #if !defined(LONG_DOUBLE_IS_DOUBLE) && defined(X87_FPU)
27 #define SPECIAL_X86_LONG_DOUBLE
28 #endif
30 #endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_PLATFORM_DEFS_H