mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
cpu: Format additions to sse2neon to match the rest of the file
This commit is contained in:
parent
a60eab6e36
commit
7353696014
@ -132,24 +132,26 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* RPCS3 additions */
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
static inline int posix_memalign(void** memptr, size_t alignment, size_t size) {
|
static inline int posix_memalign(void** memptr, size_t alignment, size_t size)
|
||||||
|
{
|
||||||
// Check for valid alignment (must be a power of two and multiple of sizeof(void*))
|
// Check for valid alignment (must be a power of two and multiple of sizeof(void*))
|
||||||
if (alignment == 0 || (alignment & (alignment - 1)) != 0 || alignment % sizeof(void*) != 0) {
|
if (alignment == 0 || (alignment & (alignment - 1)) != 0 || alignment % sizeof(void*) != 0)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate memory using _aligned_malloc
|
// Allocate memory using _aligned_malloc
|
||||||
void* ptr = _aligned_malloc(size, alignment);
|
void* ptr = _aligned_malloc(size, alignment);
|
||||||
if (ptr == NULL) {
|
if (!ptr)
|
||||||
|
// NOTE: _aligned_malloc sets errno, ideally we should use that to generate the return code
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
// Set the output pointer
|
// Success
|
||||||
*memptr = ptr;
|
*memptr = ptr;
|
||||||
return 0; // Success
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* End RPCS3 additions */
|
||||||
|
|
||||||
/* "__has_builtin" can be used to query support for built-in functions
|
/* "__has_builtin" can be used to query support for built-in functions
|
||||||
* provided by gcc/clang and other compilers that support it.
|
* provided by gcc/clang and other compilers that support it.
|
||||||
|
Loading…
Reference in New Issue
Block a user