#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_MULTIPLY_ADD_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_MULTIPLY_ADD_H
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
#include "src/__support/macros/properties/cpu_features.h"
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
template <typename T>
LIBC_INLINE cpp::enable_if_t<(sizeof(T) > sizeof(void *)), T>
multiply_add(const T &x, const T &y, const T &z) { … }
template <typename T>
LIBC_INLINE cpp::enable_if_t<(sizeof(T) <= sizeof(void *)), T>
multiply_add(T x, T y, T z) { … }
}
}
#if defined(LIBC_TARGET_CPU_HAS_FMA)
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
LIBC_INLINE float multiply_add(float x, float y, float z) {
return __builtin_fmaf(x, y, z);
}
LIBC_INLINE double multiply_add(double x, double y, double z) {
return __builtin_fma(x, y, z);
}
}
}
#endif
#endif