Fix Clang support

The amalgamated release is now confirmed to be working with Clang,
including its integrated assembler.

Fixes #41
This commit is contained in:
Justine Tunney 2021-02-06 00:24:35 -08:00
parent e06c90fafc
commit d7733579d3
103 changed files with 384 additions and 359 deletions

View file

@ -30,7 +30,7 @@
/ @see “Fast CRC Computation for Generic Polynomials Using
/ PCLMULQDQ Instruction V. Gopal, E. Ozturk, et al.,
/ 2009, intel.ly/2ySEwL0
crc32$pclmul:
crc32_pclmul:
.leafprologue
.profilable
movdqu (%rsi),%xmm7
@ -136,7 +136,8 @@ crc32$pclmul:
pxor %xmm1,%xmm0
pextrd $1,%xmm0,%eax
.leafepilogue
.endfn crc32$pclmul,globl,hidden
.endfn crc32_pclmul,globl,hidden
.source __FILE__
/ Definitions of the bit-reflected domain constants k1,k2,k3, etc.
/ and the CRC32+Barrett polynomials given at the end of the paper.
@ -259,4 +260,3 @@ crc32$pclmul:
4194304 7.025 7.059 7.030 462
8388607 7.082 6.980 6.997 464
8388608 7.051 6.985 6.999 464 */
.source __FILE__

View file

@ -6,9 +6,9 @@ COSMOPOLITAN_C_START_
void crc32init(uint32_t[hasatleast 256], uint32_t);
uint32_t crc32_z(uint32_t, const void *, size_t);
extern uint32_t (*const crc32c)(uint32_t, const void *, size_t);
uint32_t crc32c$pure(uint32_t, const void *, size_t) strlenesque hidden;
uint32_t crc32c$sse42(uint32_t, const void *, size_t) strlenesque hidden;
uint32_t crc32$pclmul(uint32_t, const void *, size_t) hidden;
uint32_t crc32c_pure(uint32_t, const void *, size_t) strlenesque hidden;
uint32_t crc32c_sse42(uint32_t, const void *, size_t) strlenesque hidden;
uint32_t crc32_pclmul(uint32_t, const void *, size_t) hidden;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -7,7 +7,7 @@
/ @param rsi is number of elements in rdi
/ @note public domain
/ @see en.wikipedia.org/wiki/Sorting_network
djbsort$avx2:
djbsort_avx2:
push %rbp
mov %rsp,%rbp
push %r15
@ -275,7 +275,7 @@ djbsort$avx2:
call int32_sort_2power
lea (%r12,%rbx,4),%rdi
mov %r14,%rsi
call djbsort$avx2
call djbsort_avx2
.L175: mov %rbx,%r14
mov %r13,%rsi
mov %r12,%rdi
@ -798,7 +798,7 @@ djbsort$avx2:
pop %r15
pop %rbp
ret
.endfn djbsort$avx2,globl,hidden
.endfn djbsort_avx2,globl,hidden
minmax_vector:
cmp $7,%rdx

View file

@ -27,7 +27,7 @@ typedef uint32_t vbitmask_t;
/**
* Returns how many bytes the utf16 string would be as utf8.
*/
int strcmp$avx2(const char *s1, const char *s2) {
int strcmp_avx2(const char *s1, const char *s2) {
if (s1 == s2) return 0;
const unsigned char *p1 = (const unsigned char *)s1;
const unsigned char *p2 = (const unsigned char *)s2;

View file

@ -21,7 +21,7 @@
#include "libc/nexgen32e/strstr.inc"
/ TODO(jart): Fix me.
strstr$sse42:
strstr_sse42:
.leafprologue
mov %rdi,%rax
xor %ecx,%ecx
@ -38,5 +38,5 @@ strstr$sse42:
jmp 5f # youtu.be/nVk1DjMtLWs
4: xor %eax,%eax
5: .leafepilogue
.endfn strstr$sse42,globl,hidden
.endfn strstr_sse42,globl,hidden
.source __FILE__