Skip to content

Commit

Permalink
7488 bcopy and bzero should mind signed bits
Browse files Browse the repository at this point in the history
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
rmustacc committed Oct 21, 2016
1 parent 52d2369 commit 5aaab1a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions usr/src/uts/intel/ia32/ml/copy.s
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/* All Rights Reserved */

/*
* Copyright 2015 Joyent, Inc.
* Copyright 2016 Joyent, Inc.
*/

#include <sys/errno.h>
Expand Down Expand Up @@ -470,7 +470,7 @@ bcopy(const void *from, void *to, size_t count)
do_copy:
#define L(s) .bcopy/**/s
cmpq $0x50, %rdx /* 80 */
jge bcopy_ck_size
jae bcopy_ck_size

/*
* Performance data shows many caller's copy small buffers. So for
Expand Down Expand Up @@ -869,7 +869,7 @@ bcopy_patch_end:
.globl bcopy_ck_size
bcopy_ck_size:
cmpq $BCOPY_DFLT_REP, %rdx
jge L(use_rep)
jae L(use_rep)

/*
* Align to a 8-byte boundary. Avoids penalties from unaligned stores
Expand Down Expand Up @@ -927,7 +927,7 @@ L(aligned_loop):
mov %r8, 0x30(%rsi)
mov %r10, 0x38(%rsi)
lea 0x40(%rsi), %rsi
jge L(aligned_loop)
jae L(aligned_loop)

/*
* Copy remaining bytes (0-63)
Expand Down Expand Up @@ -1158,7 +1158,7 @@ do_zero:
xorl %eax, %eax

cmpq $0x50, %rsi /* 80 */
jge L(ck_align)
jae L(ck_align)

/*
* Performance data shows many caller's are zeroing small buffers. So
Expand Down Expand Up @@ -1412,7 +1412,7 @@ L(ck_align):
*/
L(aligned_now):
cmp $BZERO_USE_REP, %rsi
jg L(use_rep)
ja L(use_rep)

/*
* zero 64-bytes per loop
Expand All @@ -1430,7 +1430,7 @@ L(bzero_loop):
movq %rax, 0x30(%rdi)
movq %rax, 0x38(%rdi)
leaq 0x40(%rdi), %rdi
jge L(bzero_loop)
jae L(bzero_loop)

/*
* Clear any remaining bytes..
Expand Down

0 comments on commit 5aaab1a

Please sign in to comment.