mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Formatted MOC code
This commit is contained in:
parent
fcf363ee47
commit
4be1312188
6 changed files with 1098 additions and 921 deletions
|
@ -7,6 +7,10 @@ astyle.exe -v --formatted --options=astyle-options.ini --recursive ../doomclassi
|
|||
REM astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/imgui/*.h
|
||||
REM astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/imgui/*.cpp
|
||||
|
||||
astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/moc/*.h
|
||||
astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/moc/*.inl
|
||||
astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/moc/*.cpp
|
||||
|
||||
REM astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/stb/*.h
|
||||
REM astyle.exe -v --formatted --options=astyle-options.ini --recursive libs/tinyexr/*.h
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Common shared include file to hide compiler/os specific functions from the rest of the code.
|
||||
// Common shared include file to hide compiler/os specific functions from the rest of the code.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
||||
|
@ -23,79 +23,79 @@
|
|||
#endif
|
||||
|
||||
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__clang__)) // Windows: MSVC / Intel compiler / clang
|
||||
#include <intrin.h>
|
||||
#include <new.h>
|
||||
#include <intrin.h>
|
||||
#include <new.h>
|
||||
|
||||
#define FORCE_INLINE __forceinline
|
||||
#define FORCE_INLINE __forceinline
|
||||
|
||||
FORCE_INLINE unsigned long find_clear_lsb(unsigned int *mask)
|
||||
{
|
||||
unsigned long idx;
|
||||
_BitScanForward(&idx, *mask);
|
||||
*mask &= *mask - 1;
|
||||
return idx;
|
||||
}
|
||||
FORCE_INLINE unsigned long find_clear_lsb( unsigned int* mask )
|
||||
{
|
||||
unsigned long idx;
|
||||
_BitScanForward( &idx, *mask );
|
||||
*mask &= *mask - 1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
FORCE_INLINE void *aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
return _aligned_malloc(size, alignment);
|
||||
}
|
||||
FORCE_INLINE void* aligned_alloc( size_t alignment, size_t size )
|
||||
{
|
||||
return _aligned_malloc( size, alignment );
|
||||
}
|
||||
|
||||
FORCE_INLINE void aligned_free(void *ptr)
|
||||
{
|
||||
_aligned_free(ptr);
|
||||
}
|
||||
FORCE_INLINE void aligned_free( void* ptr )
|
||||
{
|
||||
_aligned_free( ptr );
|
||||
}
|
||||
|
||||
#elif defined(__GNUG__) || defined(__clang__) // G++ or clang
|
||||
#include <cpuid.h>
|
||||
#include <cpuid.h>
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
|
||||
#include <malloc/malloc.h> // memalign
|
||||
#else
|
||||
#include <malloc.h> // memalign
|
||||
#endif
|
||||
#include <mm_malloc.h>
|
||||
#include <immintrin.h>
|
||||
#include <new>
|
||||
#include <mm_malloc.h>
|
||||
#include <immintrin.h>
|
||||
#include <new>
|
||||
|
||||
#define FORCE_INLINE inline
|
||||
#define FORCE_INLINE inline
|
||||
|
||||
FORCE_INLINE unsigned long find_clear_lsb(unsigned int *mask)
|
||||
{
|
||||
unsigned long idx;
|
||||
idx = __builtin_ctzl(*mask);
|
||||
*mask &= *mask - 1;
|
||||
return idx;
|
||||
}
|
||||
FORCE_INLINE unsigned long find_clear_lsb( unsigned int* mask )
|
||||
{
|
||||
unsigned long idx;
|
||||
idx = __builtin_ctzl( *mask );
|
||||
*mask &= *mask - 1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
FORCE_INLINE void *aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
return memalign(alignment, size);
|
||||
}
|
||||
FORCE_INLINE void* aligned_alloc( size_t alignment, size_t size )
|
||||
{
|
||||
return memalign( alignment, size );
|
||||
}
|
||||
|
||||
FORCE_INLINE void aligned_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
FORCE_INLINE void aligned_free( void* ptr )
|
||||
{
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
// RB: commented out
|
||||
// RB: commented out
|
||||
#if 0
|
||||
FORCE_INLINE void __cpuidex(int* cpuinfo, int function, int subfunction)
|
||||
{
|
||||
__cpuid_count(function, subfunction, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
|
||||
}
|
||||
FORCE_INLINE void __cpuidex( int* cpuinfo, int function, int subfunction )
|
||||
{
|
||||
__cpuid_count( function, subfunction, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3] );
|
||||
}
|
||||
|
||||
FORCE_INLINE unsigned long long _xgetbv(unsigned int index)
|
||||
{
|
||||
unsigned int eax, edx;
|
||||
__asm__ __volatile__(
|
||||
"xgetbv;"
|
||||
: "=a" (eax), "=d"(edx)
|
||||
: "c" (index)
|
||||
);
|
||||
return ((unsigned long long)edx << 32) | eax;
|
||||
}
|
||||
FORCE_INLINE unsigned long long _xgetbv( unsigned int index )
|
||||
{
|
||||
unsigned int eax, edx;
|
||||
__asm__ __volatile__(
|
||||
"xgetbv;"
|
||||
: "=a"( eax ), "=d"( edx )
|
||||
: "c"( index )
|
||||
);
|
||||
return ( ( unsigned long long )edx << 32 ) | eax;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error Unsupported compiler
|
||||
#error Unsupported compiler
|
||||
#endif
|
||||
|
|
|
@ -252,9 +252,9 @@ template<> FORCE_INLINE __m128i simd_cast<__m128i>( __m128i A )
|
|||
return acs->m_array; \
|
||||
}
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float,, 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, , 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, const, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int,, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, , 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, const, 4 )
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -439,8 +439,8 @@ FORCE_INLINE __m128i _mmw_sllv_ones( const __m128i& ishift )
|
|||
static const unsigned int maskLUT[33] =
|
||||
{
|
||||
~0U << 0, ~0U << 1, ~0U << 2, ~0U << 3, ~0U << 4, ~0U << 5, ~0U << 6, ~0U << 7, ~0U << 8, ~0U << 9, ~0U << 10, ~0U << 11, ~0U << 12, ~0U << 13, ~0U << 14, ~0U << 15,
|
||||
~0U << 16, ~0U << 17, ~0U << 18, ~0U << 19, ~0U << 20, ~0U << 21, ~0U << 22, ~0U << 23, ~0U << 24, ~0U << 25, ~0U << 26, ~0U << 27, ~0U << 28, ~0U << 29, ~0U << 30, ~0U << 31,
|
||||
0U
|
||||
~0U << 16, ~0U << 17, ~0U << 18, ~0U << 19, ~0U << 20, ~0U << 21, ~0U << 22, ~0U << 23, ~0U << 24, ~0U << 25, ~0U << 26, ~0U << 27, ~0U << 28, ~0U << 29, ~0U << 30, ~0U << 31,
|
||||
0U
|
||||
};
|
||||
|
||||
__m128i retMask;
|
||||
|
|
|
@ -185,14 +185,14 @@ template<> FORCE_INLINE __m256i simd_cast<__m256i>( __m256i A )
|
|||
return acs->m_array; \
|
||||
}
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float,, 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, , 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, const, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int,, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, , 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, const, 4 )
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float,, 8 )
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float, , 8 )
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float, const, 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int,, 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int, , 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int, const, 8 )
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -194,19 +194,19 @@ template<> FORCE_INLINE __m512i simd_cast<__m512i>( __m512i A )
|
|||
return acs->m_array; \
|
||||
}
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float,, 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, , 4 )
|
||||
MAKE_ACCESSOR( simd_f32, __m128, float, const, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int,, 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, , 4 )
|
||||
MAKE_ACCESSOR( simd_i32, __m128i, int, const, 4 )
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float,, 8 )
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float, , 8 )
|
||||
MAKE_ACCESSOR( simd_f32, __m256, float, const, 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int,, 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int, , 8 )
|
||||
MAKE_ACCESSOR( simd_i32, __m256i, int, const, 8 )
|
||||
|
||||
MAKE_ACCESSOR( simd_f32, __m512, float,, 16 )
|
||||
MAKE_ACCESSOR( simd_f32, __m512, float, , 16 )
|
||||
MAKE_ACCESSOR( simd_f32, __m512, float, const, 16 )
|
||||
MAKE_ACCESSOR( simd_i32, __m512i, int,, 16 )
|
||||
MAKE_ACCESSOR( simd_i32, __m512i, int, , 16 )
|
||||
MAKE_ACCESSOR( simd_i32, __m512i, int, const, 16 )
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue