2017-02-28 18:16:38 +01:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2019-01-23 21:10:43 +01:00
|
|
|
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
|
2017-02-28 18:16:38 +01:00
|
|
|
*/
|
|
|
|
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
|
|
|
|
2018-06-29 23:36:51 +02:00
|
|
|
#define HT_IMPL
|
2017-02-28 18:16:38 +01:00
|
|
|
#include "hashtable.h"
|
2017-03-15 10:21:39 +01:00
|
|
|
#include "util.h"
|
2017-02-28 18:16:38 +01:00
|
|
|
|
2018-06-29 23:36:51 +02:00
|
|
|
uint32_t (*htutil_hashfunc_string)(uint32_t crc, const char *str);
|
2017-02-28 18:16:38 +01:00
|
|
|
|
2018-06-29 23:36:51 +02:00
|
|
|
void htutil_init(void) {
|
|
|
|
if(SDL_HasSSE42()) {
|
|
|
|
log_info("Using SSE4.2-accelerated CRC32 as the string hash function");
|
|
|
|
htutil_hashfunc_string = crc32str_sse42;
|
2018-01-12 19:26:07 +01:00
|
|
|
} else {
|
2018-06-29 23:36:51 +02:00
|
|
|
log_info("Using software fallback CRC32 as the string hash function");
|
|
|
|
htutil_hashfunc_string = crc32str;
|
2018-01-12 19:26:07 +01:00
|
|
|
}
|
2017-02-28 18:47:47 +01:00
|
|
|
}
|