Changeset 95bda0a for libcfa/src/common.hfa
- Timestamp:
- Oct 8, 2022, 4:29:32 PM (23 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 301071a, affb51b
- Parents:
- b2ddaf3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/common.hfa
rb2ddaf3 r95bda0a 10 10 // Created On : Wed Jul 11 17:54:36 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 5 14:02:04 202113 // Update Count : 1812 // Last Modified On : Sat Oct 8 08:32:57 2022 13 // Update Count : 23 14 14 // 15 15 … … 31 31 long long int llabs( long long int ); 32 32 } // extern "C" 33 34 static inline { 33 static inline __attribute__((always_inline)) { 35 34 unsigned char abs( signed char v ) { return abs( (int)v ); } 36 35 // use default C routine for int … … 44 43 long double fabsl( long double ); 45 44 } // extern "C" 46 static inline {45 static inline __attribute__((always_inline)) { 47 46 float abs( float x ) { return fabsf( x ); } 48 47 double abs( double x ) { return fabs( x ); } … … 55 54 long double cabsl( long double _Complex ); 56 55 } // extern "C" 57 static inline {56 static inline __attribute__((always_inline)) { 58 57 float abs( float _Complex x ) { return cabsf( x ); } 59 58 double abs( double _Complex x ) { return cabs( x ); } … … 66 65 //--------------------------------------- 67 66 68 static inline {67 static inline __attribute__((always_inline)) { 69 68 char min( char v1, char v2 ) { return v1 < v2 ? v1 : v2; } // optimization 70 69 int min( int v1, int v2 ) { return v1 < v2 ? v1 : v2; } … … 74 73 long long int min( long long int v1, long long int v2 ) { return v1 < v2 ? v1 : v2; } 75 74 unsigned long long int min( unsigned long long int v1, unsigned int v2 ) { return v1 < v2 ? v1 : v2; } 76 forall( T | { int ?<?( T, T ); } ) 75 forall( T | { int ?<?( T, T ); } ) // generic 77 76 T min( T v1, T v2 ) { return v1 < v2 ? v1 : v2; } 78 77 … … 84 83 long long int max( long long int v1, long long int v2 ) { return v1 > v2 ? v1 : v2; } 85 84 unsigned long long int max( unsigned long long int v1, unsigned long long int v2 ) { return v1 > v2 ? v1 : v2; } 86 forall( T | { int ?>?( T, T ); } ) 85 forall( T | { int ?>?( T, T ); } ) // generic 87 86 T max( T v1, T v2 ) { return v1 > v2 ? v1 : v2; } 88 87
Note: See TracChangeset
for help on using the changeset viewer.