-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEON culling: Use mla operations to shave off some more cycles. ARM32…
… compat.
- Loading branch information
Showing
6 changed files
with
79 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// 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. | ||
|
||
#include "ppsspp_config.h" | ||
|
||
#include <cstdint> | ||
|
||
#ifdef _M_SSE | ||
#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. | ||
|
||
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); | ||
case 3: return vmulq_lane_f32(a, vget_high_f32(b), 1); | ||
} | ||
} | ||
|
||
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); | ||
case 3: return vmlaq_lane_f32(a, b, vget_high_f32(c), 1); | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters