Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jun 2018 04:18:42 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334826 - head/sys/amd64/amd64
Message-ID:  <201806080418.w584Igfj085188@repo.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help
Author: mjg
Date: Fri Jun  8 04:18:42 2018
New Revision: 334826
URL: https://svnweb.freebsd.org/changeset/base/334826

Log:
  amd64: remove now unused bzero, bcmp and bcopy. move pagecopy higher up.

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==============================================================================
--- head/sys/amd64/amd64/support.S	Fri Jun  8 03:22:39 2018	(r334825)
+++ head/sys/amd64/amd64/support.S	Fri Jun  8 04:18:42 2018	(r334826)
@@ -40,37 +40,31 @@
 
 	.text
 
-/*
- * bcopy family
- * void bzero(void *buf, u_int len)
- */
-
-/* done */
-ENTRY(bzero)
+/* Address: %rdi */
+ENTRY(pagezero)
 	PUSH_FRAME_POINTER
-	movq	%rsi,%rcx
+	movq	$PAGE_SIZE/8,%rcx
 	xorl	%eax,%eax
-	shrq	$3,%rcx
 	rep
 	stosq
-	movq	%rsi,%rcx
-	andq	$7,%rcx
-	rep
-	stosb
 	POP_FRAME_POINTER
 	ret
-END(bzero)
+END(pagezero)
 
-/* Address: %rdi */
-ENTRY(pagezero)
+/*
+ * pagecopy(%rdi=from, %rsi=to)
+ */
+ENTRY(pagecopy)
 	PUSH_FRAME_POINTER
 	movq	$PAGE_SIZE/8,%rcx
-	xorl	%eax,%eax
+	movq	%rdi,%r9
+	movq	%rsi,%rdi
+	movq	%r9,%rsi
 	rep
-	stosq
+	movsq
 	POP_FRAME_POINTER
 	ret
-END(pagezero)
+END(pagecopy)
 
 /* Address: %rdi */
 ENTRY(sse2_pagezero)
@@ -96,95 +90,7 @@ ENTRY(sse2_pagezero)
 	ret
 END(sse2_pagezero)
 
-ENTRY(bcmp)
-	PUSH_FRAME_POINTER
-	test	%rdx,%rdx
-	je	1f
-	cmpq	$64,%rdx
-	jg	4f
-
-	xor	%ecx,%ecx
-2:
-	movzbl	(%rdi,%rcx,1),%eax
-	movzbl	(%rsi,%rcx,1),%r8d
-	cmp	%r8b,%al
-	jne	3f
-	add	$0x1,%rcx
-	cmp	%rcx,%rdx
-	jne	2b
-1:
-	xor	%eax,%eax
-	POP_FRAME_POINTER
-	retq
-3:
-	mov	$1,%eax
-	POP_FRAME_POINTER
-	retq
-4:
-	movq	%rdx,%rcx
-	shrq	$3,%rcx
-	repe
-	cmpsq
-	jne	5f
-
-	movq	%rdx,%rcx
-	andq	$7,%rcx
-	repe
-	cmpsb
-5:
-	setne	%al
-	movsbl	%al,%eax
-	POP_FRAME_POINTER
-	ret
-END(bcmp)
-
 /*
- * bcopy(src, dst, cnt)
- *       rdi, rsi, rdx
- *  ws@tools.de     (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
- */
-ENTRY(bcopy)
-	PUSH_FRAME_POINTER
-	xchgq	%rsi,%rdi
-	movq	%rdx,%rcx
-
-	movq	%rdi,%rax
-	subq	%rsi,%rax
-	cmpq	%rcx,%rax			/* overlapping && src < dst? */
-	jb	1f
-
-	shrq	$3,%rcx				/* copy by 64-bit words */
-	rep
-	movsq
-	movq	%rdx,%rcx
-	andq	$7,%rcx				/* any bytes left? */
-	rep
-	movsb
-	POP_FRAME_POINTER
-	ret
-
-	/* ALIGN_TEXT */
-1:
-	addq	%rcx,%rdi			/* copy backwards */
-	addq	%rcx,%rsi
-	decq	%rdi
-	decq	%rsi
-	andq	$7,%rcx				/* any fractional bytes? */
-	std
-	rep
-	movsb
-	movq	%rdx,%rcx			/* copy remainder by 32-bit words */
-	shrq	$3,%rcx
-	subq	$7,%rsi
-	subq	$7,%rdi
-	rep
-	movsq
-	cld
-	POP_FRAME_POINTER
-	ret
-END(bcopy)
-
-/*
  * memmove(dst, src, cnt)
  *         rdi, rsi, rdx
  * Adapted from bcopy written by:
@@ -290,21 +196,6 @@ ENTRY(memset)
 	POP_FRAME_POINTER
 	ret
 END(memset)
-
-/*
- * pagecopy(%rdi=from, %rsi=to)
- */
-ENTRY(pagecopy)
-	PUSH_FRAME_POINTER
-	movq	$PAGE_SIZE/8,%rcx
-	movq	%rdi,%r9
-	movq	%rsi,%rdi
-	movq	%r9,%rsi
-	rep
-	movsq
-	POP_FRAME_POINTER
-	ret
-END(pagecopy)
 
 /* fillw(pat, base, cnt) */
 /*       %rdi,%rsi, %rdx */



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?201806080418.w584Igfj085188>