mailing list of musl libc
 help / color / mirror / code / Atom feed
f4d9d27a02879e6b74d8c1558cda95b54363cebb blob 742 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
.global memset
.type memset,@function
memset:
	movzbq %sil,%rax
	cmp $16,%rdx
	jb .Less_than_16
	test %esi,%esi
	jnz .L_widen_rax  # unlikely
.L_widened:

	lea -1(%rdx),%rcx
	mov %rdi,%r8
	shr $3,%rcx
	mov %rax,-8(%rdi,%rdx)
	rep
	stosq
	mov %r8,%rax
	ret

.L_widen_rax:
	# 64-bit imul has 3-7 cycles latency
	mov $0x101010101010101,%rsi
	imul %rsi,%rax
	jmp .L_widened

.Less_than_16:
	test %edx,%edx
	jz .L_ret

	mov %al,(%rdi)
	mov %al,-1(%rdi,%rdx)
	cmp $2,%edx
	jbe .L_ret

	mov %al,1(%rdi)
	mov %al,-2(%rdi,%rdx)
	# 32-bit imul has 3-4 cycles latency
	imul $0x1010101,%eax
	cmp $4,%edx
	jbe .L_ret

	mov %eax,(%rdi)
	mov %eax,-4(%rdi,%rdx)
	cmp $8,%edx
	jbe .L_ret

	mov %eax,4(%rdi)
	mov %eax,-8(%rdi,%rdx)
.L_ret:
	mov %rdi,%rax
	ret
debug log:

solving 523caa0 ...
found 523caa0 in https://inbox.vuxu.org/musl/1423761423-30050-1-git-send-email-vda.linux@googlemail.com/
found 3cc8fcf in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 3cc8fcf6b718295f4c977da2d7957d7d53d9c421	src/string/x86_64/memset.s

applying [1/1] https://inbox.vuxu.org/musl/1423761423-30050-1-git-send-email-vda.linux@googlemail.com/
diff --git a/src/string/x86_64/memset.s b/src/string/x86_64/memset.s
index 3cc8fcf..523caa0 100644

Checking patch src/string/x86_64/memset.s...
Applied patch src/string/x86_64/memset.s cleanly.

index at:
100644 f4d9d27a02879e6b74d8c1558cda95b54363cebb	src/string/x86_64/memset.s

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).