mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
ARM: Avoid fast path for BITOP.
GCC will produce certain unaligned multi load-store instructions that will be trapped by the Linux kernel since ARM v6 cannot handle them with unaligned addresses. Better to use the slower but safer implementation instead of generating the exception which should be anyway very slow.
This commit is contained in:
parent
4e9cf4cc7e
commit
7329cc3981
@ -654,8 +654,11 @@ void bitopCommand(client *c) {
|
|||||||
|
|
||||||
/* Fast path: as far as we have data for all the input bitmaps we
|
/* Fast path: as far as we have data for all the input bitmaps we
|
||||||
* can take a fast path that performs much better than the
|
* can take a fast path that performs much better than the
|
||||||
* vanilla algorithm. */
|
* vanilla algorithm. On ARM we skip the fast path since it will
|
||||||
|
* result in GCC compiling the code using multiple-words load/store
|
||||||
|
* operations that are not supported even in ARM >= v6. */
|
||||||
j = 0;
|
j = 0;
|
||||||
|
#ifndef __arm__
|
||||||
if (minlen >= sizeof(unsigned long)*4 && numkeys <= 16) {
|
if (minlen >= sizeof(unsigned long)*4 && numkeys <= 16) {
|
||||||
unsigned long *lp[16];
|
unsigned long *lp[16];
|
||||||
unsigned long *lres = (unsigned long*) res;
|
unsigned long *lres = (unsigned long*) res;
|
||||||
@ -716,6 +719,7 @@ void bitopCommand(client *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* j is set to the next byte to process by the previous loop. */
|
/* j is set to the next byte to process by the previous loop. */
|
||||||
for (; j < maxlen; j++) {
|
for (; j < maxlen; j++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user