Make progress towards aarch64 build

This commit is contained in:
Justine Tunney 2023-05-01 19:43:59 -07:00
parent 08ff26c817
commit ca2860947f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15428 changed files with 25694 additions and 23138 deletions

View file

@ -25,6 +25,8 @@
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(1)));
#ifdef __x86_64__
static dontinline antiquity int memcmp_sse(const unsigned char *p,
const unsigned char *q, size_t n) {
unsigned u;
@ -99,6 +101,8 @@ microarchitecture("avx") static int memcmp_avx(const unsigned char *p,
}
}
#endif /* __x86_64__ */
/**
* Compares memory byte by byte.
*
@ -136,6 +140,7 @@ int memcmp(const void *a, const void *b, size_t n) {
const unsigned char *p, *q;
if ((p = a) == (q = b) || !n) return 0;
if ((c = *p - *q)) return c;
#ifdef __x86_64__
if (!IsTiny()) {
if (n <= 16) {
if (n >= 8) {
@ -187,6 +192,7 @@ int memcmp(const void *a, const void *b, size_t n) {
return memcmp_sse(p, q, n);
}
}
#endif /* __x86_64__ */
for (; n; ++p, ++q, --n) {
if ((c = *p - *q)) {
return c;