Linux Audio

Check our new training course

Loading...
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3-------------------------------------------------------------------------------
  4The macro `BITS64' can be defined to indicate that 64-bit integer types are
  5supported by the compiler.
  6-------------------------------------------------------------------------------
  7*/
  8#define BITS64
  9
 10/*
 11-------------------------------------------------------------------------------
 12Each of the following `typedef's defines the most convenient type that holds
 13integers of at least as many bits as specified.  For example, `uint8' should
 14be the most convenient type that can hold unsigned integers of as many as
 158 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
 16implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
 17to the same as `int'.
 18-------------------------------------------------------------------------------
 19*/
 20typedef char flag;
 21typedef unsigned char uint8;
 22typedef signed char int8;
 23typedef int uint16;
 24typedef int int16;
 25typedef unsigned int uint32;
 26typedef signed int int32;
 27#ifdef BITS64
 28typedef unsigned long long int bits64;
 29typedef signed long long int sbits64;
 30#endif
 31
 32/*
 33-------------------------------------------------------------------------------
 34Each of the following `typedef's defines a type that holds integers
 35of _exactly_ the number of bits specified.  For instance, for most
 36implementation of C, `bits16' and `sbits16' should be `typedef'ed to
 37`unsigned short int' and `signed short int' (or `short int'), respectively.
 38-------------------------------------------------------------------------------
 39*/
 40typedef unsigned char bits8;
 41typedef signed char sbits8;
 42typedef unsigned short int bits16;
 43typedef signed short int sbits16;
 44typedef unsigned int bits32;
 45typedef signed int sbits32;
 46#ifdef BITS64
 47typedef unsigned long long int uint64;
 48typedef signed long long int int64;
 49#endif
 50
 51#ifdef BITS64
 52/*
 53-------------------------------------------------------------------------------
 54The `LIT64' macro takes as its argument a textual integer literal and if
 55necessary ``marks'' the literal as having a 64-bit integer type.  For
 56example, the Gnu C Compiler (`gcc') requires that 64-bit literals be
 57appended with the letters `LL' standing for `long long', which is `gcc's
 58name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
 59defined as the identity macro:  `#define LIT64( a ) a'.
 60-------------------------------------------------------------------------------
 61*/
 62#define LIT64( a ) a##LL
 63#endif
 64
 65/*
 66-------------------------------------------------------------------------------
 67The macro `INLINE' can be used before functions that should be inlined.  If
 68a compiler does not support explicit inlining, this macro should be defined
 69to be `static'.
 70-------------------------------------------------------------------------------
 71*/
 72#define INLINE static inline
 73
 74
 75/* For use as a GCC soft-float library we need some special function names. */
 76
 77#ifdef __LIBFLOAT__
 78
 79/* Some 32-bit ops can be mapped straight across by just changing the name. */
 80#define float32_add			__addsf3
 81#define float32_sub			__subsf3
 82#define float32_mul			__mulsf3
 83#define float32_div			__divsf3
 84#define int32_to_float32		__floatsisf
 85#define float32_to_int32_round_to_zero	__fixsfsi
 86#define float32_to_uint32_round_to_zero	__fixunssfsi
 87
 88/* These ones go through the glue code.  To avoid namespace pollution
 89   we rename the internal functions too.  */
 90#define float32_eq			___float32_eq
 91#define float32_le			___float32_le
 92#define float32_lt			___float32_lt
 93
 94/* All the 64-bit ops have to go through the glue, so we pull the same
 95   trick.  */
 96#define float64_add			___float64_add
 97#define float64_sub			___float64_sub
 98#define float64_mul			___float64_mul
 99#define float64_div			___float64_div
100#define int32_to_float64		___int32_to_float64
101#define float64_to_int32_round_to_zero	___float64_to_int32_round_to_zero
102#define float64_to_uint32_round_to_zero	___float64_to_uint32_round_to_zero
103#define float64_to_float32		___float64_to_float32
104#define float32_to_float64		___float32_to_float64
105#define float64_eq			___float64_eq
106#define float64_le			___float64_le
107#define float64_lt			___float64_lt
108
109#if 0
110#define float64_add			__adddf3
111#define float64_sub			__subdf3
112#define float64_mul			__muldf3
113#define float64_div			__divdf3
114#define int32_to_float64		__floatsidf
115#define float64_to_int32_round_to_zero	__fixdfsi
116#define float64_to_uint32_round_to_zero	__fixunsdfsi
117#define float64_to_float32		__truncdfsf2
118#define float32_to_float64		__extendsfdf2
119#endif
120
121#endif
v5.14.15
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3-------------------------------------------------------------------------------
  4The macro `BITS64' can be defined to indicate that 64-bit integer types are
  5supported by the compiler.
  6-------------------------------------------------------------------------------
  7*/
  8#define BITS64
  9
 10/*
 11-------------------------------------------------------------------------------
 12Each of the following `typedef's defines the most convenient type that holds
 13integers of at least as many bits as specified.  For example, `uint8' should
 14be the most convenient type that can hold unsigned integers of as many as
 158 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
 16implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
 17to the same as `int'.
 18-------------------------------------------------------------------------------
 19*/
 20typedef char flag;
 21typedef unsigned char uint8;
 22typedef signed char int8;
 23typedef int uint16;
 24typedef int int16;
 25typedef unsigned int uint32;
 26typedef signed int int32;
 27#ifdef BITS64
 28typedef unsigned long long int bits64;
 29typedef signed long long int sbits64;
 30#endif
 31
 32/*
 33-------------------------------------------------------------------------------
 34Each of the following `typedef's defines a type that holds integers
 35of _exactly_ the number of bits specified.  For instance, for most
 36implementation of C, `bits16' and `sbits16' should be `typedef'ed to
 37`unsigned short int' and `signed short int' (or `short int'), respectively.
 38-------------------------------------------------------------------------------
 39*/
 40typedef unsigned char bits8;
 41typedef signed char sbits8;
 42typedef unsigned short int bits16;
 43typedef signed short int sbits16;
 44typedef unsigned int bits32;
 45typedef signed int sbits32;
 46#ifdef BITS64
 47typedef unsigned long long int uint64;
 48typedef signed long long int int64;
 49#endif
 50
 51#ifdef BITS64
 52/*
 53-------------------------------------------------------------------------------
 54The `LIT64' macro takes as its argument a textual integer literal and if
 55necessary ``marks'' the literal as having a 64-bit integer type.  For
 56example, the Gnu C Compiler (`gcc') requires that 64-bit literals be
 57appended with the letters `LL' standing for `long long', which is `gcc's
 58name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
 59defined as the identity macro:  `#define LIT64( a ) a'.
 60-------------------------------------------------------------------------------
 61*/
 62#define LIT64( a ) a##LL
 63#endif
 64
 65/*
 66-------------------------------------------------------------------------------
 67The macro `INLINE' can be used before functions that should be inlined.  If
 68a compiler does not support explicit inlining, this macro should be defined
 69to be `static'.
 70-------------------------------------------------------------------------------
 71*/
 72#define INLINE static inline
 73
 74
 75/* For use as a GCC soft-float library we need some special function names. */
 76
 77#ifdef __LIBFLOAT__
 78
 79/* Some 32-bit ops can be mapped straight across by just changing the name. */
 80#define float32_add			__addsf3
 81#define float32_sub			__subsf3
 82#define float32_mul			__mulsf3
 83#define float32_div			__divsf3
 84#define int32_to_float32		__floatsisf
 85#define float32_to_int32_round_to_zero	__fixsfsi
 86#define float32_to_uint32_round_to_zero	__fixunssfsi
 87
 88/* These ones go through the glue code.  To avoid namespace pollution
 89   we rename the internal functions too.  */
 90#define float32_eq			___float32_eq
 91#define float32_le			___float32_le
 92#define float32_lt			___float32_lt
 93
 94/* All the 64-bit ops have to go through the glue, so we pull the same
 95   trick.  */
 96#define float64_add			___float64_add
 97#define float64_sub			___float64_sub
 98#define float64_mul			___float64_mul
 99#define float64_div			___float64_div
100#define int32_to_float64		___int32_to_float64
101#define float64_to_int32_round_to_zero	___float64_to_int32_round_to_zero
102#define float64_to_uint32_round_to_zero	___float64_to_uint32_round_to_zero
103#define float64_to_float32		___float64_to_float32
104#define float32_to_float64		___float32_to_float64
105#define float64_eq			___float64_eq
106#define float64_le			___float64_le
107#define float64_lt			___float64_lt
108
109#if 0
110#define float64_add			__adddf3
111#define float64_sub			__subdf3
112#define float64_mul			__muldf3
113#define float64_div			__divdf3
114#define int32_to_float64		__floatsidf
115#define float64_to_int32_round_to_zero	__fixdfsi
116#define float64_to_uint32_round_to_zero	__fixunsdfsi
117#define float64_to_float32		__truncdfsf2
118#define float32_to_float64		__extendsfdf2
119#endif
120
121#endif