Skip to content

Commit

Permalink
Shorten x86-64 strlen a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 27, 2010
1 parent 623aac7 commit 107b2fa
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions sysdeps/x86_64/strlen.S
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* strlen(str) -- determine the length of the string STR.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
Modified by Intel Corporation.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -85,22 +84,19 @@ L(exit_less16):
L(exit16):
sub %rdi, %rax
bsf %rdx, %rdx
add %rdx, %rax
add $16, %rax
lea 16(%rdx), %rax
ret
.p2align 4
L(exit32):
sub %rdi, %rax
bsf %rdx, %rdx
add %rdx, %rax
add $32, %rax
lea 32(%rdx), %rax
ret
.p2align 4
L(exit48):
sub %rdi, %rax
bsf %rdx, %rdx
add %rdx, %rax
add $48, %rax
lea 48(%rdx), %rax
ret
END(strlen)
libc_hidden_builtin_def (strlen)

0 comments on commit 107b2fa

Please sign in to comment.