#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_NEAREST_INTEGER_H
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_NEAREST_INTEGER_H
#include "src/__support/architectures.h"
#if !defined(LLVM_LIBC_ARCH_AARCH64)
#error "Invalid include"
#endif
namespace __llvm_libc {
namespace fputil {
static inline float nearest_integer(float x) {
float result;
__asm__ __volatile__("frintn %s0, %s1\n\t" : "=w"(result) : "w"(x));
return result;
}
static inline double nearest_integer(double x) {
double result;
__asm__ __volatile__("frintn %d0, %d1\n\t" : "=w"(result) : "w"(x));
return result;
}
}
}
#endif