cOMS/stdlib/Simd.h
Dennis Eichhorn 4f1cbd98f9
Some checks failed
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (autobuild, c-cpp) (push) Has been cancelled
started templating
2025-03-21 01:08:09 +00:00

39 lines
991 B
C

/**
* Jingga
*
* @copyright Jingga
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
#ifndef COMS_STDLIB_SIMD_H
#define COMS_STDLIB_SIMD_H
// Adjusts the step size based on the memory alignment
inline
int32 intrin_validate_steps(const byte* mem, int32 steps) {
if (steps >= 16 && ((uintptr_t) mem & 63) == 0) {
return 16;
} else if (steps >= 8 && ((uintptr_t) mem & 31) == 0) {
return 8;
} else if (steps >= 4 && ((uintptr_t) mem & 15) == 0) {
return 4;
} else {
return 1;
}
}
#if __aarch64__
#include <arm_neon.h>
#else
#include "../architecture/x86/simd/SIMD_F32.h"
#include "../architecture/x86/simd/SIMD_F64.h"
#include "../architecture/x86/simd/SIMD_I8.h"
#include "../architecture/x86/simd/SIMD_I16.h"
#include "../architecture/x86/simd/SIMD_I32.h"
#include "../architecture/x86/simd/SIMD_I64.h"
#include "../architecture/x86/simd/SIMD_SVML.h"
#endif
#endif