diff --git a/libc/src/__support/FPUtil/aarch64/FMA.h b/libc/src/__support/FPUtil/aarch64/FMA.h --- a/libc/src/__support/FPUtil/aarch64/FMA.h +++ b/libc/src/__support/FPUtil/aarch64/FMA.h @@ -9,6 +9,7 @@ #ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_FMA_H #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_FMA_H +#include "src/__support/macros/attributes.h" // LIBC_INLINE #include "src/__support/macros/properties/architectures.h" #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA @@ -26,20 +27,20 @@ namespace fputil { template -cpp::enable_if_t, T> fma(T x, T y, T z) { +LIBC_INLINE cpp::enable_if_t, T> fma(T x, T y, T z) { float result; - __asm__ __volatile__("fmadd %s0, %s1, %s2, %s3\n\t" - : "=w"(result) - : "w"(x), "w"(y), "w"(z)); + LIBC_INLINE_ASM("fmadd %s0, %s1, %s2, %s3\n\t" + : "=w"(result) + : "w"(x), "w"(y), "w"(z)); return result; } template -cpp::enable_if_t, T> fma(T x, T y, T z) { +LIBC_INLINE cpp::enable_if_t, T> fma(T x, T y, T z) { double result; - __asm__ __volatile__("fmadd %d0, %d1, %d2, %d3\n\t" - : "=w"(result) - : "w"(x), "w"(y), "w"(z)); + LIBC_INLINE_ASM("fmadd %d0, %d1, %d2, %d3\n\t" + : "=w"(result) + : "w"(x), "w"(y), "w"(z)); return result; } diff --git a/libc/src/__support/FPUtil/riscv64/FMA.h b/libc/src/__support/FPUtil/riscv64/FMA.h --- a/libc/src/__support/FPUtil/riscv64/FMA.h +++ b/libc/src/__support/FPUtil/riscv64/FMA.h @@ -9,6 +9,7 @@ #ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_RISCV64_FMA_H #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_RISCV64_FMA_H +#include "src/__support/macros/attributes.h" // LIBC_INLINE #include "src/__support/macros/properties/architectures.h" #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA @@ -26,20 +27,20 @@ namespace fputil { template -cpp::enable_if_t, T> fma(T x, T y, T z) { +LIBC_INLINE cpp::enable_if_t, T> fma(T x, T y, T z) { float result; - __asm__ __volatile__("fmadd.s %0, %1, %2, %3\n\t" - : "=f"(result) - : "f"(x), "f"(y), "f"(z)); + LIBC_INLINE_ASM("fmadd.s %0, %1, %2, %3\n\t" + : "=f"(result) + : "f"(x), "f"(y), "f"(z)); return result; } template -cpp::enable_if_t, T> fma(T x, T y, T z) { +LIBC_INLINE cpp::enable_if_t, T> fma(T x, T y, T z) { double result; - __asm__ __volatile__("fmadd.d %0, %1, %2, %3\n\t" - : "=f"(result) - : "f"(x), "f"(y), "f"(z)); + LIBC_INLINE_ASM("fmadd.d %0, %1, %2, %3\n\t" + : "=f"(result) + : "f"(x), "f"(y), "f"(z)); return result; } diff --git a/libc/src/__support/FPUtil/x86_64/FMA.h b/libc/src/__support/FPUtil/x86_64/FMA.h --- a/libc/src/__support/FPUtil/x86_64/FMA.h +++ b/libc/src/__support/FPUtil/x86_64/FMA.h @@ -9,6 +9,7 @@ #ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_FMA_H #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_FMA_H +#include "src/__support/macros/attributes.h" // LIBC_INLINE #include "src/__support/macros/properties/architectures.h" #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -697,6 +697,7 @@ ":__support_fputil_fenv_impl", ":__support_fputil_float_properties", ":__support_fputil_fp_bits", + ":__support_macros_attributes", ":__support_macros_optimization", ":__support_macros_properties_cpu_features", ":__support_uint128",