Skip to content

Commit 7be36d1

Browse files
committed
Normalize line endings
1 parent 31497b9 commit 7be36d1

24 files changed

+44282
-44282
lines changed

Extensions/DirectXMathAVX.h

+289-289
Large diffs are not rendered by default.

Extensions/DirectXMathAVX2.h

+972-972
Large diffs are not rendered by default.

Extensions/DirectXMathBE.h

+102-102
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
1-
//-------------------------------------------------------------------------------------
2-
// DirectXMathBE.h -- Big-endian swap extensions for SIMD C++ Math library
3-
//
4-
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
5-
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
6-
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
7-
// PARTICULAR PURPOSE.
8-
//
9-
// Copyright (c) Microsoft Corporation. All rights reserved.
10-
//
11-
// http://go.microsoft.com/fwlink/?LinkID=615560
12-
//-------------------------------------------------------------------------------------
13-
14-
#ifdef _MSC_VER
15-
#pragma once
16-
#endif
17-
18-
#pragma warning(push)
19-
#pragma warning(disable : 4987)
20-
#include <intrin.h>
21-
#pragma warning(pop)
22-
23-
#ifndef _M_ARM
24-
#include <tmmintrin.h>
25-
#endif
26-
27-
#include <DirectXMath.h>
28-
29-
namespace DirectX
30-
{
31-
#if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV)
32-
#define XM_CALLCONV __fastcall
33-
typedef const DirectX::XMVECTOR& HXMVECTOR;
34-
typedef const DirectX::XMMATRIX& FXMMATRIX;
35-
#endif
36-
37-
inline XMVECTOR XM_CALLCONV XMVectorEndian
38-
(
39-
FXMVECTOR V
40-
)
41-
{
42-
#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
43-
static const XMVECTORU32 idx = { 0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F };
44-
45-
int8x8x2_t tbl;
46-
tbl.val[0] = vget_low_f32(V);
47-
tbl.val[1] = vget_high_f32(V);
48-
49-
const __n64 rL = vtbl2_u8( tbl, vget_low_f32(idx) );
50-
const __n64 rH = vtbl2_u8( tbl, vget_high_f32(idx) );
51-
return vcombine_f32( rL, rH );
52-
#else
53-
XMVECTORU32 E;
54-
E.v = V;
55-
uint32_t value = E.u[0];
56-
E.u[0] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
57-
value = E.u[1];
58-
E.u[1] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
59-
value = E.u[2];
60-
E.u[2] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
61-
value = E.u[3];
62-
E.u[3] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
63-
return E.v;
64-
#endif
65-
}
66-
67-
68-
#ifndef _M_ARM
69-
namespace SSSE3
70-
{
71-
72-
inline bool XMVerifySSSE3Support()
73-
{
74-
// Should return true on AMD Bulldozer, Intel Core i7/i5/i3, Intel Atom, or later processors
75-
76-
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
77-
int CPUInfo[4] = {-1};
78-
__cpuid( CPUInfo, 0 );
79-
80-
if ( CPUInfo[0] < 1 )
81-
return false;
82-
83-
__cpuid(CPUInfo, 1 );
84-
85-
// Check for SSSE3 instruction set.
86-
return ( (CPUInfo[2] & 0x200) != 0 );
87-
}
88-
89-
inline XMVECTOR XM_CALLCONV XMVectorEndian
90-
(
91-
FXMVECTOR V
92-
)
93-
{
94-
static const XMVECTORU32 idx = { 0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F };
95-
96-
__m128i Result = _mm_shuffle_epi8( _mm_castps_si128(V), idx );
97-
return _mm_castsi128_ps( Result );
98-
}
99-
100-
}; // namespace SSSE3
101-
#endif // !_M_ARM
102-
1+
//-------------------------------------------------------------------------------------
2+
// DirectXMathBE.h -- Big-endian swap extensions for SIMD C++ Math library
3+
//
4+
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
5+
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
6+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
7+
// PARTICULAR PURPOSE.
8+
//
9+
// Copyright (c) Microsoft Corporation. All rights reserved.
10+
//
11+
// http://go.microsoft.com/fwlink/?LinkID=615560
12+
//-------------------------------------------------------------------------------------
13+
14+
#ifdef _MSC_VER
15+
#pragma once
16+
#endif
17+
18+
#pragma warning(push)
19+
#pragma warning(disable : 4987)
20+
#include <intrin.h>
21+
#pragma warning(pop)
22+
23+
#ifndef _M_ARM
24+
#include <tmmintrin.h>
25+
#endif
26+
27+
#include <DirectXMath.h>
28+
29+
namespace DirectX
30+
{
31+
#if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV)
32+
#define XM_CALLCONV __fastcall
33+
typedef const DirectX::XMVECTOR& HXMVECTOR;
34+
typedef const DirectX::XMMATRIX& FXMMATRIX;
35+
#endif
36+
37+
inline XMVECTOR XM_CALLCONV XMVectorEndian
38+
(
39+
FXMVECTOR V
40+
)
41+
{
42+
#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
43+
static const XMVECTORU32 idx = { 0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F };
44+
45+
int8x8x2_t tbl;
46+
tbl.val[0] = vget_low_f32(V);
47+
tbl.val[1] = vget_high_f32(V);
48+
49+
const __n64 rL = vtbl2_u8( tbl, vget_low_f32(idx) );
50+
const __n64 rH = vtbl2_u8( tbl, vget_high_f32(idx) );
51+
return vcombine_f32( rL, rH );
52+
#else
53+
XMVECTORU32 E;
54+
E.v = V;
55+
uint32_t value = E.u[0];
56+
E.u[0] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
57+
value = E.u[1];
58+
E.u[1] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
59+
value = E.u[2];
60+
E.u[2] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
61+
value = E.u[3];
62+
E.u[3] = ( (value << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | (value >> 24) );
63+
return E.v;
64+
#endif
65+
}
66+
67+
68+
#ifndef _M_ARM
69+
namespace SSSE3
70+
{
71+
72+
inline bool XMVerifySSSE3Support()
73+
{
74+
// Should return true on AMD Bulldozer, Intel Core i7/i5/i3, Intel Atom, or later processors
75+
76+
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
77+
int CPUInfo[4] = {-1};
78+
__cpuid( CPUInfo, 0 );
79+
80+
if ( CPUInfo[0] < 1 )
81+
return false;
82+
83+
__cpuid(CPUInfo, 1 );
84+
85+
// Check for SSSE3 instruction set.
86+
return ( (CPUInfo[2] & 0x200) != 0 );
87+
}
88+
89+
inline XMVECTOR XM_CALLCONV XMVectorEndian
90+
(
91+
FXMVECTOR V
92+
)
93+
{
94+
static const XMVECTORU32 idx = { 0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F };
95+
96+
__m128i Result = _mm_shuffle_epi8( _mm_castps_si128(V), idx );
97+
return _mm_castsi128_ps( Result );
98+
}
99+
100+
}; // namespace SSSE3
101+
#endif // !_M_ARM
102+
103103
}; // namespace DirectX;

0 commit comments

Comments
 (0)