diff --git a/src/xenia/base/math.h b/src/xenia/base/math.h index c6132f5b4..678090e89 100644 --- a/src/xenia/base/math.h +++ b/src/xenia/base/math.h @@ -31,6 +31,8 @@ #if XE_ARCH_AMD64 #include +#elif XE_ARCH_ARM64 +#include #endif namespace xe { @@ -383,6 +385,24 @@ template int64_t m128_i64(const __m128& v) { return m128_i64(_mm_castps_pd(v)); } +#elif XE_ARCH_ARM64 +// Utilities for NEON values. +template +float m128_f32(const float32x4_t& v) { + return vgetq_lane_f32(v, N); +} +template +int32_t m128_i32(const int32x4_t& v) { + return vgetq_lane_s32(v, N); +} +template +double m128_f64(const float64x2_t& v) { + return vgetq_lane_f64(v, N); +} +template +int64_t m128_i64(const int64x2_t& v) { + return vgetq_lane_s64(v, N); +} #endif // Similar to the C++ implementation of XMConvertFloatToHalf and