[svn] - remove x86-optimized hash code.

This commit is contained in:
nenolod 2007-04-03 02:37:03 -07:00
parent 3611dcf761
commit 6c8cbf341b
5 changed files with 15 additions and 204 deletions

View File

@ -1,3 +1,12 @@
nenolod 2007/04/03 09:34:38 UTC (20070403-3358)
Log:
- apparently setting KE_LENGTH to 128 is fine.
Changes: Modified:
+3 -5 trunk/libcharybdis/kqueue.c (File Modified)
nenolod 2007/04/03 09:31:11 UTC (20070403-3356)
Log:
- remove the rest of the MAX_CLIENTS stuff. change kqueue implementation accordingly. (needs testing)

View File

@ -1,4 +1,4 @@
dnl $Id: configure.ac 3356 2007-04-03 09:31:11Z nenolod $
dnl $Id: configure.ac 3360 2007-04-03 09:37:03Z nenolod $
dnl Process this file with autoconf to produce a configure script.
dnl TODO: clean up all the OpenSSL and shared module checking stuff;
@ -8,7 +8,7 @@ dnl said functions need to be just about as complex as they already are.
AC_PREREQ(2.57)
dnl Sneaky way to get an Id tag into the configure script
AC_COPYRIGHT([$Id: configure.ac 3356 2007-04-03 09:31:11Z nenolod $])
AC_COPYRIGHT([$Id: configure.ac 3360 2007-04-03 09:37:03Z nenolod $])
AC_INIT([charybdis],[2.2.0])
@ -913,19 +913,6 @@ if test "$balloc" = no; then
AC_DEFINE([NOBALLOC], 1, [Define to 1 if you wish to disable the block allocator.])
fi
AC_ARG_ENABLE(ricer-hashing,
AC_HELP_STRING([--enable-ricer-hashing],[Enable assembly-based hashing routines.]),
[ricer_hashing=$enableval], [ricer_hashing=no])
FNVHASH_S=""
if test "$ricer_hashing" = "yes"; then
AC_DEFINE([RICER_HASHING], 1, [Define to 1 if you are using the assembly-based hashing routines.])
FNVHASH_S="fnvhash.s"
fi
AC_SUBST(FNVHASH_S)
AC_ARG_ENABLE(small-net,
AC_HELP_STRING([--enable-small-net],[Enable small network support.]),
[small_net=$enableval], [small_net=no])

View File

@ -1 +1 @@
#define SERNO "20070403-3356"
#define SERNO "20070403-3358"

View File

@ -1,7 +1,7 @@
#
# Makefile.in for ircd/src
#
# $Id: Makefile.in 3159 2007-01-25 07:08:21Z nenolod $
# $Id: Makefile.in 3360 2007-04-03 09:37:03Z nenolod $
#
CC = @CC@
INSTALL = @INSTALL@
@ -24,8 +24,6 @@ bindir = @bindir@
libdir = @libdir@
libexecdir = @libexecdir@
FNVHASH_S = @FNVHASH_S@
DOLLAR = $$
IRCD_EXE = ircd
@ -55,7 +53,7 @@ lex.yy.o: lex.yy.c ircd_lexer.l
lex.yy.c: ircd_lexer.l
${LEX} ircd_lexer.l
BASE_SRCS = \
SRCS = \
blacklist.c \
cache.c \
channel.c \
@ -98,10 +96,7 @@ BASE_SRCS = \
snomask.c \
substitution.c \
supported.c \
whowas.c \
$(FNVHASH_S)
SRCS = ${BASE_SRCS:.s=.o}
whowas.c
OBJS = ${SRCS:.c=.o}

View File

@ -1,180 +0,0 @@
/*
* charybdis: a slightly useful ircd.
* fnvhash.s: x86-optimised FNV hashing implementation
*
* Copyright (c) 2006 charybdis development team
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id: fnvhash.s 2725 2006-11-09 23:43:35Z jilles $
*/
/* Safely moves hashv from %edx to %eax and returns back to the calling parent. */
fnv_out:
movzbl 12(%ebp), %ecx
movl -4(%ebp), %eax
movl %eax, %edx
shrl %cl, %edx
movl 12(%ebp), %eax
xorl $2, %eax
decl %eax
andl -4(%ebp), %eax
xorl %edx, %eax
movl %eax, -4(%ebp)
movl -4(%ebp), %eax
leave
ret
/*
* Capitalizes the contents of %eax and adds it to the hashv in %edx.
* Returns hashv in register %eax.
* - nenolod
*/
.globl fnv_hash_upper
.type fnv_hash_upper, @function
fnv_hash_upper:
pushl %ebp
movl %esp, %ebp
subl $4, %esp
movl $-2128831035, -4(%ebp) /* u_int32_t h = FNV1_32_INIT */
.eat_data_upper: /* while loop construct */
movl 8(%ebp), %eax /* move value of *s to %eax */
cmpb $0, (%eax) /* is eax == 0? */
jne .hash_capitalized /* if no, then capitalize and hash */
jmp fnv_out /* if yes, then exit out of the loop */
.hash_capitalized:
movl 8(%ebp), %eax
movzbl (%eax), %eax /* increment s (%eax) */
movzbl ToUpperTab(%eax), %edx /* hashv ^= ToUpperTab(%eax) */
leal -4(%ebp), %eax
xorl %edx, (%eax) /* hashv = 0 */
incl 8(%ebp)
movl -4(%ebp), %eax
imull $16777619, %eax, %eax /* FNV1_32_PRIME */
movl %eax, -4(%ebp) /* add this byte to hashv, and */
jmp .eat_data_upper /* go back for more... */
/*
* Hashes (no case change) the contents of %eax and adds it to the hashv in %edx.
* Returns hashv in register %eax.
* - nenolod
*/
.globl fnv_hash
.type fnv_hash, @function
fnv_hash:
pushl %ebp
movl %esp, %ebp
subl $4, %esp
movl $-2128831035, -4(%ebp) /* u_int32_t h = FNV1_32_INIT */
.eat_data: /* again, the while loop construct */
movl 8(%ebp), %eax /* move value of *s to eax */
cmpb $0, (%eax) /* is eax == 0? */
jne .hash_lowercase /* if not, jump to .hash_lowercase */
jmp fnv_out /* otherwise, jump to fnv_out */
.hash_lowercase:
movl 8(%ebp), %eax
movzbl (%eax), %edx
leal -4(%ebp), %eax
xorl %edx, (%eax)
incl 8(%ebp) /* h << 1 */
movl -4(%ebp), %eax
imull $16777619, %eax, %eax /* FNV1_32_PRIME */
movl %eax, -4(%ebp) /* add this byte to hashv, then */
jmp .eat_data /* check for more... */
/*
* Hashes (no case change) the contents of %eax and adds it to the hashv in %edx.
* Returns hashv in register %eax.
*
* Bounds checking is performed.
* - nenolod
*/
.globl fnv_hash_len
.type fnv_hash_len, @function
fnv_hash_len:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $-2128831035, -4(%ebp)
movl 16(%ebp), %eax
addl 8(%ebp), %eax
movl %eax, -8(%ebp)
.eat_data_len:
movl 8(%ebp), %eax
cmpb $0, (%eax)
je fnv_out
movl 8(%ebp), %eax
cmpl -8(%ebp), %eax
jb .hash_lowercase_len
jmp fnv_out
.hash_lowercase_len:
movl 8(%ebp), %eax
movzbl (%eax), %edx
leal -4(%ebp), %eax
xorl %edx, (%eax)
incl 8(%ebp)
movl -4(%ebp), %eax
imull $16777619, %eax, %eax /* FNV1_32_PRIME */
movl %eax, -4(%ebp)
jmp .eat_data_len
/*
* Hashes (no case change) the contents of %eax and adds it to the hashv in %edx.
* Returns hashv in register %eax.
*
* Bounds checking is performed.
* - nenolod
*/
.globl fnv_hash_upper_len
.type fnv_hash_upper_len, @function
fnv_hash_upper_len:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $-2128831035, -4(%ebp)
movl 16(%ebp), %eax
addl 8(%ebp), %eax
movl %eax, -8(%ebp)
.eat_upper_len:
movl 8(%ebp), %eax
cmpb $0, (%eax)
je fnv_out
movl 8(%ebp), %eax
cmpl -8(%ebp), %eax
jb .hash_uppercase_len
jmp fnv_out
.hash_uppercase_len:
movl 8(%ebp), %eax
movzbl (%eax), %eax
movzbl ToUpperTab(%eax), %edx
leal -4(%ebp), %eax
xorl %edx, (%eax)
incl 8(%ebp)
movl -4(%ebp), %eax
imull $16777619, %eax, %eax /* FNV1_32_PRIME */
movl %eax, -4(%ebp)
jmp .eat_upper_len