xref: /llvm-project/libc/src/stdfix/abslr.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
12c45bda8Slntue //===-- Implementation of abslr function ----------------------------------===//
22c45bda8Slntue //
32c45bda8Slntue // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42c45bda8Slntue // See https://llvm.org/LICENSE.txt for license information.
52c45bda8Slntue // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62c45bda8Slntue //
72c45bda8Slntue //===----------------------------------------------------------------------===//
82c45bda8Slntue 
92c45bda8Slntue #include "abslr.h"
102c45bda8Slntue #include "src/__support/common.h"
112c45bda8Slntue #include "src/__support/fixed_point/fx_bits.h"
12*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
132c45bda8Slntue 
14*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
152c45bda8Slntue 
162c45bda8Slntue LLVM_LIBC_FUNCTION(long fract, abslr, (long fract x)) {
172c45bda8Slntue   return fixed_point::abs(x);
182c45bda8Slntue }
192c45bda8Slntue 
20*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
21