llvm/libc/include/llvm-libc-macros/stdfix-macros.h

//===-- Definitions from stdfix.h -----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_MACROS_STDFIX_MACROS_H
#define LLVM_LIBC_MACROS_STDFIX_MACROS_H

#ifdef __FRACT_FBIT__
// _Fract and _Accum types are available
#define LIBC_COMPILER_HAS_FIXED_POINT
#endif // __FRACT_FBIT__

#ifdef LIBC_COMPILER_HAS_FIXED_POINT

#define fract
#define accum
#define sat

// Default values: from ISO/IEC TR 18037:2008 standard - Annex A.3 - Typical
// desktop processor.

#ifdef __SFRACT_FBIT__
#define SFRACT_FBIT
#else
#define SFRACT_FBIT
#endif // SFRACT_FBIT

#ifdef __SFRACT_MIN__
#define SFRACT_MIN
#else
#define SFRACT_MIN
#endif // SFRACT_MIN

#ifdef __SFRACT_MAX__
#define SFRACT_MAX
#else
#define SFRACT_MAX
#endif // SFRACT_MAX

#ifdef __SFRACT_EPSILON__
#define SFRACT_EPSILON
#else
#define SFRACT_EPSILON
#endif // SFRACT_EPSILON

#ifdef __USFRACT_FBIT__
#define USFRACT_FBIT
#else
#define USFRACT_FBIT
#endif // USFRACT_FBIT

#define USFRACT_MIN

#ifdef __USFRACT_MAX__
#define USFRACT_MAX
#else
#define USFRACT_MAX
#endif // USFRACT_MAX

#ifdef __USFRACT_EPSILON__
#define USFRACT_EPSILON
#else
#define USFRACT_EPSILON
#endif // USFRACT_EPSILON

#ifdef __FRACT_FBIT__
#define FRACT_FBIT
#else
#define FRACT_FBIT
#endif // FRACT_FBIT

#ifdef __FRACT_MIN__
#define FRACT_MIN
#else
#define FRACT_MIN
#endif // FRACT_MIN

#ifdef __FRACT_MAX__
#define FRACT_MAX
#else
#define FRACT_MAX
#endif // FRACT_MAX

#ifdef __FRACT_EPSILON__
#define FRACT_EPSILON
#else
#define FRACT_EPSILON
#endif // FRACT_EPSILON

#ifdef __UFRACT_FBIT__
#define UFRACT_FBIT
#else
#define UFRACT_FBIT
#endif // UFRACT_FBIT

#define UFRACT_MIN

#ifdef __UFRACT_MAX__
#define UFRACT_MAX
#else
#define UFRACT_MAX
#endif // UFRACT_MAX

#ifdef __UFRACT_EPSILON__
#define UFRACT_EPSILON
#else
#define UFRACT_EPSILON
#endif // UFRACT_EPSILON

#ifdef __LFRACT_FBIT__
#define LFRACT_FBIT
#else
#define LFRACT_FBIT
#endif // LFRACT_FBIT

#ifdef __LFRACT_MIN__
#define LFRACT_MIN
#else
#define LFRACT_MIN
#endif // LFRACT_MIN

#ifdef __LFRACT_MAX__
#define LFRACT_MAX
#else
#define LFRACT_MAX
#endif // LFRACT_MAX

#ifdef __LFRACT_EPSILON__
#define LFRACT_EPSILON
#else
#define LFRACT_EPSILON
#endif // LFRACT_EPSILON

#ifdef __ULFRACT_FBIT__
#define ULFRACT_FBIT
#else
#define ULFRACT_FBIT
#endif // ULFRACT_FBIT

#define ULFRACT_MIN

#ifdef __ULFRACT_MAX__
#define ULFRACT_MAX
#else
#define ULFRACT_MAX
#endif // ULFRACT_MAX

#ifdef __ULFRACT_EPSILON__
#define ULFRACT_EPSILON
#else
#define ULFRACT_EPSILON
#endif // ULFRACT_EPSILON

#ifdef __SACCUM_FBIT__
#define SACCUM_FBIT
#else
#define SACCUM_FBIT
#endif // SACCUM_FBIT

#ifdef __SACCUM_IBIT__
#define SACCUM_IBIT
#else
#define SACCUM_IBIT
#endif // SACCUM_IBIT

#ifdef __SACCUM_MIN__
#define SACCUM_MIN
#else
#define SACCUM_MIN
#endif // SACCUM_MIN

#ifdef __SACCUM_MAX__
#define SACCUM_MAX
#else
#define SACCUM_MAX
#endif // SACCUM_MAX

#ifdef __SACCUM_EPSILON__
#define SACCUM_EPSILON
#else
#define SACCUM_EPSILON
#endif // SACCUM_EPSILON

#ifdef __USACCUM_FBIT__
#define USACCUM_FBIT
#else
#define USACCUM_FBIT
#endif // USACCUM_FBIT

#ifdef __USACCUM_IBIT__
#define USACCUM_IBIT
#else
#define USACCUM_IBIT
#endif // USACCUM_IBIT

#define USACCUM_MIN

#ifdef __USACCUM_MAX__
#define USACCUM_MAX
#else
#define USACCUM_MAX
#endif // USACCUM_MAX

#ifdef __USACCUM_EPSILON__
#define USACCUM_EPSILON
#else
#define USACCUM_EPSILON
#endif // USACCUM_EPSILON

#ifdef __ACCUM_FBIT__
#define ACCUM_FBIT
#else
#define ACCUM_FBIT
#endif // ACCUM_FBIT

#ifdef __ACCUM_IBIT__
#define ACCUM_IBIT
#else
#define ACCUM_IBIT
#endif // ACCUM_IBIT

#ifdef __ACCUM_MIN__
#define ACCUM_MIN
#else
#define ACCUM_MIN
#endif // ACCUM_MIN

#ifdef __ACCUM_MAX__
#define ACCUM_MAX
#else
#define ACCUM_MAX
#endif // ACCUM_MAX

#ifdef __ACCUM_EPSILON__
#define ACCUM_EPSILON
#else
#define ACCUM_EPSILON
#endif // ACCUM_EPSILON

#ifdef __UACCUM_FBIT__
#define UACCUM_FBIT
#else
#define UACCUM_FBIT
#endif // UACCUM_FBIT

#ifdef __UACCUM_IBIT__
#define UACCUM_IBIT
#else
#define UACCUM_IBIT
#endif // UACCUM_IBIT

#define UACCUM_MIN

#ifdef __UACCUM_MAX__
#define UACCUM_MAX
#else
#define UACCUM_MAX
#endif // UACCUM_MAX

#ifdef __UACCUM_EPSILON__
#define UACCUM_EPSILON
#else
#define UACCUM_EPSILON
#endif // UACCUM_EPSILON

#ifdef __LACCUM_FBIT__
#define LACCUM_FBIT
#else
#define LACCUM_FBIT
#endif // LACCUM_FBIT

#ifdef __LACCUM_IBIT__
#define LACCUM_IBIT
#else
#define LACCUM_IBIT
#endif // LACCUM_IBIT

#ifdef __LACCUM_MIN__
#define LACCUM_MIN
#else
#define LACCUM_MIN
#endif // LACCUM_MIN

#ifdef __LACCUM_MAX__
#define LACCUM_MAX
#else
#define LACCUM_MAX
#endif // LACCUM_MAX

#ifdef __LACCUM_EPSILON__
#define LACCUM_EPSILON
#else
#define LACCUM_EPSILON
#endif // LACCUM_EPSILON

#ifdef __ULACCUM_FBIT__
#define ULACCUM_FBIT
#else
#define ULACCUM_FBIT
#endif // ULACCUM_FBIT

#ifdef __ULACCUM_IBIT__
#define ULACCUM_IBIT
#else
#define ULACCUM_IBIT
#endif // ULACCUM_IBIT

#define ULACCUM_MIN

#ifdef __ULACCUM_MAX__
#define ULACCUM_MAX
#else
#define ULACCUM_MAX
#endif // ULACCUM_MAX

#ifdef __ULACCUM_EPSILON__
#define ULACCUM_EPSILON
#else
#define ULACCUM_EPSILON
#endif // ULACCUM_EPSILON

#endif // LIBC_COMPILER_HAS_FIXED_POINT

#endif // LLVM_LIBC_MACROS_STDFIX_MACROS_H