mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-07 11:58:55 +00:00
CLEANUP: http/h1: rely on HA_UNALIGNED_LE instead of checking for CPU families
Now that we have flags indicating the CPU's capabilities, better use them instead of missing some updates for new CPU families (ARMv8 was missing there).
This commit is contained in:
parent
2c315ee75e
commit
02ac950a11
10
src/h1.c
10
src/h1.c
@ -386,9 +386,7 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
|
||||
|
||||
case H1_MSG_RQURI:
|
||||
http_msg_rquri:
|
||||
#if defined(__x86_64__) || \
|
||||
defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \
|
||||
defined(__ARM_ARCH_7A__)
|
||||
#ifdef HA_UNALIGNED_LE
|
||||
/* speedup: skip bytes not between 0x21 and 0x7e inclusive */
|
||||
while (ptr <= end - sizeof(int)) {
|
||||
int x = *(int *)ptr - 0x21212121;
|
||||
@ -734,16 +732,14 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
|
||||
* also remove the sign bit test so that bytes 0x8e..0x0d break the
|
||||
* loop, but we don't care since they're very rare in header values.
|
||||
*/
|
||||
#if defined(__x86_64__)
|
||||
#ifdef HA_UNALIGNED_LE64
|
||||
while (ptr <= end - sizeof(long)) {
|
||||
if ((*(long *)ptr - 0x0e0e0e0e0e0e0e0eULL) & 0x8080808080808080ULL)
|
||||
goto http_msg_hdr_val2;
|
||||
ptr += sizeof(long);
|
||||
}
|
||||
#endif
|
||||
#if defined(__x86_64__) || \
|
||||
defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \
|
||||
defined(__ARM_ARCH_7A__)
|
||||
#ifdef HA_UNALIGNED_LE
|
||||
while (ptr <= end - sizeof(int)) {
|
||||
if ((*(int*)ptr - 0x0e0e0e0e) & 0x80808080)
|
||||
goto http_msg_hdr_val2;
|
||||
|
@ -640,9 +640,7 @@ char *http_find_hdr_value_end(char *s, const char *e)
|
||||
|
||||
quoted = qdpair = 0;
|
||||
|
||||
#if defined(__x86_64__) || \
|
||||
defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \
|
||||
defined(__ARM_ARCH_7A__)
|
||||
#ifdef HA_UNALIGNED_LE
|
||||
/* speedup: skip everything not a comma nor a double quote */
|
||||
for (; s <= e - sizeof(int); s += sizeof(int)) {
|
||||
unsigned int c = *(int *)s; // comma
|
||||
|
Loading…
Reference in New Issue
Block a user