2017-11-24 15:14:10 +01:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2018-01-04 18:14:31 +01:00
|
|
|
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
|
2017-11-24 15:14:10 +01:00
|
|
|
*/
|
|
|
|
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
|
|
|
|
2017-11-24 15:14:10 +01:00
|
|
|
#include <immintrin.h>
|
|
|
|
#include "util_sse42.h"
|
|
|
|
|
|
|
|
uint32_t crc32str_sse42(uint32_t crc, const char *str) {
|
|
|
|
const uint8_t *s = (const uint8_t*)str;
|
|
|
|
|
|
|
|
while(*s) {
|
|
|
|
crc = _mm_crc32_u8(crc, *s++);
|
|
|
|
}
|
|
|
|
|
|
|
|
return crc;
|
|
|
|
}
|