]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Align varshift table to 32-bytes
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 9 Jun 2022 04:16:51 +0000 (21:16 -0700)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 9 Jun 2022 19:50:26 +0000 (12:50 -0700)
This ensures the load will never split a cache line.

sysdeps/x86_64/multiarch/varshift.c
sysdeps/x86_64/multiarch/varshift.h

index c8210f0546c87e0442361db300001cdb617fa0dc..d27767520aafbf75fc2c17b34605f82ae099bef7 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include "varshift.h"
+#include <stdint.h>
 
-const int8_t ___m128i_shift_right[31] attribute_hidden =
+const int8_t ___m128i_shift_right[31] attribute_hidden
+    __attribute__((aligned(32))) =
   {
     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
index af306944887af7401686404d28b31fb4aba40a07..ffd12d79e42fcdc9d1db8094550fb58558ad09cc 100644 (file)
@@ -19,7 +19,8 @@
 #include <stdint.h>
 #include <tmmintrin.h>
 
-extern const int8_t ___m128i_shift_right[31] attribute_hidden;
+extern const int8_t ___m128i_shift_right[31] attribute_hidden
+    __attribute__ ((aligned (32)));
 
 static __inline__ __m128i
 __m128i_shift_right (__m128i value, unsigned long int offset)