Rename CrossSIMD to SIMDHeader, but also keep CrossSIMD.h (will have a future use)

This commit is contained in:
Henrik Rydgård
2024-12-19 15:15:43 +01:00
parent 53cb014c07
commit 5326d87f9c
19 changed files with 89 additions and 77 deletions
+2 -1
View File
@@ -781,7 +781,8 @@ add_library(Common STATIC
Common/Input/InputState.cpp
Common/Input/InputState.h
Common/Math/fast/fast_matrix.c
Common/Math/CrossSIMD.h
Common/Math/SIMDHeaders.h
Common/Math/SIMDHeaders.h
Common/Math/curves.cpp
Common/Math/curves.h
Common/Math/expression_parser.cpp
+1
View File
@@ -541,6 +541,7 @@
<ClInclude Include="Math\lin\matrix4x4.h" />
<ClInclude Include="Math\lin\vec3.h" />
<ClInclude Include="Math\math_util.h" />
<ClInclude Include="Math\SIMDHeaders.h" />
<ClInclude Include="Math\Statistics.h" />
<ClInclude Include="Net\HTTPNaettRequest.h" />
<ClInclude Include="Net\NetBuffer.h" />
+3
View File
@@ -676,6 +676,9 @@
<ClInclude Include="Data\Collections\LinkedList.h">
<Filter>Data\Collections</Filter>
</ClInclude>
<ClInclude Include="Math\SIMDHeaders.h">
<Filter>Math</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ABI.cpp" />
+1 -1
View File
@@ -6,7 +6,7 @@
#include "Common/Common.h"
#include "ppsspp_config.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
extern const float one_over_255_x4[4];
+2 -61
View File
@@ -1,67 +1,8 @@
// CrossSIMD
//
// Compatibility wrappers for SIMD dialects.
//
// In the long run, might do a more general single-source-SIMD wrapper here consisting
// of defines that translate to either NEON or SSE. It would be possible to write quite a lot of
// our various color conversion functions and so on in a pretty generic manner.
// This file will contain cross-instruction-set SIMD instruction wrappers.
#pragma once
#include "ppsspp_config.h"
#include "Common/Math/SIMDHeaders.h"
#include "stdint.h"
#ifdef __clang__
// Weird how you can't just use #pragma in a macro.
#define DO_NOT_VECTORIZE_LOOP _Pragma("clang loop vectorize(disable)")
#else
#define DO_NOT_VECTORIZE_LOOP
#endif
#if PPSSPP_ARCH(SSE2)
#include <emmintrin.h>
#endif
#if PPSSPP_ARCH(ARM_NEON)
#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64)
#include <arm64_neon.h>
#else
#include <arm_neon.h>
#endif
#endif
// Basic types
#if PPSSPP_ARCH(ARM64_NEON)
// No special ones here.
#elif PPSSPP_ARCH(ARM_NEON)
// Compatibility wrappers making ARM64 NEON code run on ARM32
// With optimization on, these should compile down to the optimal code.
static inline float32x4_t vmulq_laneq_f32(float32x4_t a, float32x4_t b, int lane) {
switch (lane & 3) {
case 0: return vmulq_lane_f32(a, vget_low_f32(b), 0);
case 1: return vmulq_lane_f32(a, vget_low_f32(b), 1);
case 2: return vmulq_lane_f32(a, vget_high_f32(b), 0);
default: return vmulq_lane_f32(a, vget_high_f32(b), 1);
}
}
static inline float32x4_t vmlaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c, int lane) {
switch (lane & 3) {
case 0: return vmlaq_lane_f32(a, b, vget_low_f32(c), 0);
case 1: return vmlaq_lane_f32(a, b, vget_low_f32(c), 1);
case 2: return vmlaq_lane_f32(a, b, vget_high_f32(c), 0);
default: return vmlaq_lane_f32(a, b, vget_high_f32(c), 1);
}
}
static inline uint32x4_t vcgezq_f32(float32x4_t v) {
return vcgeq_f32(v, vdupq_n_f32(0.0f));
}
#endif
+66
View File
@@ -0,0 +1,66 @@
#pragma once
// SIMD headers
// Let's include these in one consistent way across the code base.
// Here we'll also add wrappers that paper over differences between different versions
// of an instruction set, like NEON vs ASIMD (64-bit).
#pragma once
#include "ppsspp_config.h"
#include "stdint.h"
#ifdef __clang__
// Weird how you can't just use #pragma in a macro.
#define DO_NOT_VECTORIZE_LOOP _Pragma("clang loop vectorize(disable)")
#else
#define DO_NOT_VECTORIZE_LOOP
#endif
#if PPSSPP_ARCH(SSE2)
#include <emmintrin.h>
#endif
#if PPSSPP_ARCH(ARM_NEON)
#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64)
#include <arm64_neon.h>
#else
#include <arm_neon.h>
#endif
#endif
// Basic types
#if PPSSPP_ARCH(ARM64_NEON)
// No special ones here.
#elif PPSSPP_ARCH(ARM_NEON)
// Compatibility wrappers making ARM64 NEON code run on ARM32
// With optimization on, these should compile down to the optimal code.
static inline float32x4_t vmulq_laneq_f32(float32x4_t a, float32x4_t b, int lane) {
switch (lane & 3) {
case 0: return vmulq_lane_f32(a, vget_low_f32(b), 0);
case 1: return vmulq_lane_f32(a, vget_low_f32(b), 1);
case 2: return vmulq_lane_f32(a, vget_high_f32(b), 0);
default: return vmulq_lane_f32(a, vget_high_f32(b), 1);
}
}
static inline float32x4_t vmlaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c, int lane) {
switch (lane & 3) {
case 0: return vmlaq_lane_f32(a, b, vget_low_f32(c), 0);
case 1: return vmlaq_lane_f32(a, b, vget_low_f32(c), 1);
case 2: return vmlaq_lane_f32(a, b, vget_high_f32(c), 0);
default: return vmlaq_lane_f32(a, b, vget_high_f32(c), 1);
}
}
static inline uint32x4_t vcgezq_f32(float32x4_t v) {
return vcgeq_f32(v, vdupq_n_f32(0.0f));
}
#endif
+1 -1
View File
@@ -1,6 +1,6 @@
#include "ppsspp_config.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "fast_matrix.h"
+1 -1
View File
@@ -39,7 +39,7 @@
#include "GPU/Math3D.h"
#include "GPU/GPU.h"
#include "GPU/GPUCommon.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
enum class GPUReplacementSkip {
MEMSET = 1,
+1 -1
View File
@@ -16,7 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "Core/System.h"
#include "Core/Debugger/MemBlockInfo.h"
#include "Core/HW/MediaEngine.h"
+1 -1
View File
@@ -21,7 +21,7 @@
#include "Common/Data/Convert/ColorConv.h"
#include "Common/Profiler/Profiler.h"
#include "Common/LogReporting.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "Common/Math/lin/matrix4x4.h"
#include "Core/Config.h"
#include "GPU/Common/DrawEngineCommon.h"
+1 -1
View File
@@ -20,7 +20,7 @@
#include "ppsspp_config.h"
#include "Common/Common.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "GPU/Common/IndexGenerator.h"
// Points don't need indexing...
+2 -2
View File
@@ -21,12 +21,12 @@
#include "Common/Common.h"
#include "Common/Log.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "GPU/GPUState.h"
#include "GPU/Common/TextureDecoder.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
const u8 textureBitsPerPixel[16] = {
16, //GE_TFMT_5650,
+1 -1
View File
@@ -28,7 +28,7 @@
#include "Common/Thread/ParallelLoop.h"
#include "ext/xbrz/xbrz.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
// Report the time and throughput for each larger scaling operation in the log
+1 -1
View File
@@ -3,7 +3,7 @@
#include "GPU/Common/VertexDecoderCommon.h"
#include "GPU/GPUState.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
// Candidates for hand-writing
// (found using our custom Very Sleepy).
+1 -1
View File
@@ -6,7 +6,7 @@
#include "Common/GraphicsContext.h"
#include "Common/LogReporting.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/Serialize/SerializeList.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#include "GPU/ge_constants.h"
#include "GPU/GPUCommon.h"
#include "GPU/GPUState.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
// This must be aligned so that the matrices within are aligned.
alignas(16) GPUgstate gstate;
+1 -1
View File
@@ -36,7 +36,7 @@
#include "GPU/Software/SoftGpu.h"
#include "GPU/Software/TransformUnit.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
namespace Rasterizer {
+1 -1
View File
@@ -17,7 +17,7 @@
#include "GPU/Software/Rasterizer.h"
#include "GPU/Software/Sampler.h"
#include "GPU/Software/SoftGpu.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
extern DSStretch g_DarkStalkerStretch;
// For Darkstalkers hack. Ugh.
+1 -1
View File
@@ -21,7 +21,7 @@
#include "Common/Common.h"
#include "Common/Data/Convert/ColorConv.h"
#include "Common/LogReporting.h"
#include "Common/Math/CrossSIMD.h"
#include "Common/Math/SIMDHeaders.h"
#include "Core/Config.h"
#include "GPU/Common/TextureDecoder.h"
#include "GPU/Software/BinManager.h"