Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143173649
D18401.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18401.diff
View Options
Index: head/lib/libc/amd64/string/memmove.S
===================================================================
--- head/lib/libc/amd64/string/memmove.S
+++ head/lib/libc/amd64/string/memmove.S
@@ -139,6 +139,8 @@
ALIGN_TEXT
1256:
+ testb $15,%dil
+ jnz 100f
.if \erms == 1
rep
movsb
@@ -146,6 +148,34 @@
shrq $3,%rcx /* copy by 64-bit words */
rep
movsq
+ movq %rdx,%rcx
+ andl $7,%ecx /* any bytes left? */
+ jne 100408b
+.endif
+ \end
+ ret
+100:
+ movq (%rsi),%r8
+ movq 8(%rsi),%r9
+ movq %rdi,%r10
+ movq %rdi,%rcx
+ andq $15,%rcx
+ leaq -16(%rdx,%rcx),%rdx
+ neg %rcx
+ leaq 16(%rdi,%rcx),%rdi
+ leaq 16(%rsi,%rcx),%rsi
+ movq %rdx,%rcx
+.if \erms == 1
+ rep
+ movsb
+ movq %r8,(%r10)
+ movq %r9,8(%r10)
+.else
+ shrq $3,%rcx /* copy by 64-bit words */
+ rep
+ movsq
+ movq %r8,(%r10)
+ movq %r9,8(%r10)
movq %rdx,%rcx
andl $7,%ecx /* any bytes left? */
jne 100408b
Index: head/sys/amd64/amd64/support.S
===================================================================
--- head/sys/amd64/amd64/support.S
+++ head/sys/amd64/amd64/support.S
@@ -302,6 +302,8 @@
ALIGN_TEXT
1256:
+ testb $15,%dil
+ jnz 100f
.if \erms == 1
rep
movsb
@@ -309,6 +311,34 @@
shrq $3,%rcx /* copy by 64-bit words */
rep
movsq
+ movq %rdx,%rcx
+ andl $7,%ecx /* any bytes left? */
+ jne 100408b
+.endif
+ \end
+ ret
+100:
+ movq (%rsi),%r8
+ movq 8(%rsi),%r9
+ movq %rdi,%r10
+ movq %rdi,%rcx
+ andq $15,%rcx
+ leaq -16(%rdx,%rcx),%rdx
+ neg %rcx
+ leaq 16(%rdi,%rcx),%rdi
+ leaq 16(%rsi,%rcx),%rsi
+ movq %rdx,%rcx
+.if \erms == 1
+ rep
+ movsb
+ movq %r8,(%r10)
+ movq %r9,8(%r10)
+.else
+ shrq $3,%rcx /* copy by 64-bit words */
+ rep
+ movsq
+ movq %r8,(%r10)
+ movq %r9,8(%r10)
movq %rdx,%rcx
andl $7,%ecx /* any bytes left? */
jne 100408b
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 27, 10:59 PM (10 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28061007
Default Alt Text
D18401.diff (1 KB)
Attached To
Mode
D18401: amd64: align memmove buffers to 16 bytes before using rep movs
Attached
Detach File
Event Timeline
Log In to Comment