Skip to content

Commit e7faebf

Browse files
committed
Tell the compiler that v4f is aligned
It's guaranteed that this is now aligned on a 16-byte boundary.
1 parent 5ef9c84 commit e7faebf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

configure.ac

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ AM_GLIB_GNU_GETTEXT
272272
# [ax_gcc_version_option=yes],
273273
# [ax_gcc_version_option=no]
274274
# )
275-
AC_MSG_CHECKING([for gcc version])
275+
AC_MSG_CHECKING([for $CC version])
276276
GCC_VERSION=""
277277
version=$($CC -dumpversion)
278278
if test $? = 0; then
@@ -326,7 +326,7 @@ AC_TYPE_SIZE_T
326326

327327
# g++/gcc 4.x and 5.x have rather broken vector support ... 5.4.1 seems to
328328
# work, but 5.4.0 fails to even compile
329-
AC_MSG_CHECKING([for gcc with working vector support])
329+
AC_MSG_CHECKING([for $CC with working vector support])
330330
if test x"$GCC_VERSION_MAJOR" != x"4" -a x"$GCC_VERSION_MAJOR" != x"5"; then
331331
AC_MSG_RESULT([yes])
332332
else
@@ -339,7 +339,7 @@ if test x"$ax_cv_have_var_attribute_vector_size" = x"yes"; then
339339
AC_MSG_CHECKING([for C++ vector shuffle])
340340
AC_LANG_PUSH([C++])
341341
AC_TRY_COMPILE([
342-
typedef float v4f __attribute__((vector_size(4 * sizeof(float))));
342+
typedef float v4f __attribute__((vector_size(4 * sizeof(float)),aligned(16)));
343343
],[
344344
v4f f; f[3] = 99;
345345
],[
@@ -362,7 +362,7 @@ if test x"$have_vector_shuffle" = x"yes"; then
362362
AC_MSG_CHECKING([for C++ vector arithmetic])
363363
AC_LANG_PUSH([C++])
364364
AC_TRY_COMPILE([
365-
typedef float v4f __attribute__((vector_size(4 * sizeof(float))));
365+
typedef float v4f __attribute__((vector_size(4 * sizeof(float)),aligned(16)));
366366
],[
367367
v4f f = {1, 2, 3, 4}; f *= 12.0;
368368
v4f g = {5, 6, 7, 8}; f = g > 0 ? g : -1 * g;
@@ -382,7 +382,7 @@ if test x"$have_vector_arith" = x"yes"; then
382382
AC_MSG_CHECKING([for C++ signed constants in vector templates])
383383
AC_LANG_PUSH([C++])
384384
AC_TRY_COMPILE([
385-
typedef float v4f __attribute__((vector_size(4 * sizeof(float))));
385+
typedef float v4f __attribute__((vector_size(4 * sizeof(float)),aligned(16)));
386386
template <typename T>
387387
static void
388388
h( v4f B )

libvips/conversion/composite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
#ifdef HAVE_VECTOR_ARITH
8686
/* A vector of four floats.
8787
*/
88-
typedef float v4f __attribute__((vector_size(4 * sizeof(float))));
88+
typedef float v4f __attribute__((vector_size(4 * sizeof(float)),aligned(16)));
8989
#endif /*HAVE_VECTOR_ARITH*/
9090

9191
typedef struct _VipsCompositeBase {

0 commit comments

Comments
 (0)