commit a610f016e2fe7260b54616ce0ab139b215e86972
parent 829bddd3166109fff8f122fd174f9b76846f53f5
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 30 Jun 2023 16:05:24 +0200
Extensive rework of the POSIX Makefile
The CLFAGS_SIMD macro is no longer dynamically generated by the make.sh
script. It is now always set to -march=native, which allows the compiler
to enable all instruction subsets supported by the current CPU rather
than enabling them from the CPU flags in /proc/cpuinfo . Additionally,
the user can now activate a specific instruction set directly through
this macro. Be careful in this case to correctly configure the
SIMD_WIDTH macro by respecting the sets of instructions used (see
below).
Add the SIMD_WIDTH macro which, if not set, is automatically defined to
the largest vector width that RSIMD can handle on the current CPU. This
macro is then used to define which files should be compiled with the
library and which headers should be installed. The tests to compile and
to run are also defined from this macro.
Split the linker flags in 2 different macros: the SOFLAGS macro defines
the flags when creating a shared object, i.e. a dynamic library, and the
LDFLAGS macro defines the linker options for all linking operations,
i.e. when creating a shared object or an executable.
Add the BUILD_TYPE macro which controls if the compilation is done in
RELEASE or in DEBUG: the CFLAGS and LDFLAGS macros are defined according
to BUILD_TYPE.
Add building the library as a static library. The new LIB_TYPE macro
controls whether the generated library is a shared object or an archive,
depending on whether its value is SHARED or STATIC respectively. Note
that the new macro PCFLAGS, whose value depends on LIB_TYPE, controls
whether pkg-config fetches dependencies for static linking or not.
Do not hide the compiler commands anymore (except for the file
dependency check). There is no particular advantage in doing this and it
is sane to see the compiler options used. In the same spirit, the
commands executed by the clean, distclean targets are also displayed to
show what they do.
Add the lint target which uses shellcheck to check the make.sh script.
Use the new install function in the make.sh script to install the files.
It creates the target directory if necessary and copies the files only
if they are updated, thus avoiding forcing the reconstruction for
projects relying on the library after copying its unchanged header
files.
Diffstat:
7 files changed, 232 insertions(+), 224 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -10,4 +10,4 @@ test*
.test
.simd
.pkg
-rsimd.pc
+rsimd*.pc
diff --git a/Makefile b/Makefile
@@ -18,65 +18,80 @@
include config.mk
+LIBNAME_STATIC = librsimd.a
+LIBNAME_SHARED = librsimd.so
+LIBNAME = $(LIBNAME_$(LIB_TYPE))
+
################################################################################
-# RSys building
+# Library building
################################################################################
-SRC = $(SRC_SIMD)\
- src/aosf44.c\
- src/aosq.c\
- src/math4.c
-
+SRC_SIMD128 = src/aosf44.c src/aosq.c src/math4.c
+SRC_SIMD256 = src/math8.c $(SRC_SIMD128)
+SRC = $(SRC_SIMD$(SIMD_WIDTH))
OBJ = $(SRC:.c=.o)
DEP = $(SRC:.c=.d)
build_library: .simd .pkg $(DEP)
- @$(MAKE) -f.simd -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) librsimd.so
+ @$(MAKE) -f.simd -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) \
+ $$(if [ -n "$(LIBNAME)" ]; then\
+ echo "$(LIBNAME)";\
+ else\
+ echo "$(LIBNAME_SHARED)";\
+ fi)
$(OBJ): config.mk
-librsimd.so: $(OBJ)
- @echo "LD $@"
- @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+$(LIBNAME_SHARED): $(OBJ)
+ $(CC) -std=c99 $(CFLAGS) $(DPDC_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(DPDC_LIBS)
-.simd: make.sh config.mk
- @$(SHELL) make.sh config_simd > $@
+$(LIBNAME_STATIC): $(OBJ)
+ $(AR) -rc $@ $?
+ $(RANLIB) $@
.pkg: make.sh config.mk
- @$(SHELL) make.sh config_pkg && echo "pkg done" > $@ || exit 1
+ @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \
+ echo "rsys $(RSYS_VERSION) not found"; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SLEEF_VERSION) sleef; then \
+ echo "sleef $(SLEEF_VERSION) not found"; exit 1; fi
+ @echo "config done" > $@
+
+.simd: make.sh config.mk
+ @$(SHELL) make.sh config_simd > $@
.SUFFIXES: .c .d .o
.c.d:
- @$(CC) $(CFLAGS) $(INCS) -MM -MT "$(@:.d=.o) $@" $< -MF $@
+ @$(CC) -std=c99 $(CFLAGS) $(DPDC_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@
.c.o:
- @echo "CC $@"
- @$(CC) $(CFLAGS) $(INCS) -DRSIMD_SHARED_BUILD -c $< -o $@
+ $(CC) -std=c99 $(CFLAGS) $(DPDC_CFLAGS) -DRSIMD_SHARED_BUILD -c $< -o $@
################################################################################
# Miscellaneous targets
################################################################################
all: build_library build_tests
-clean: .simd
- @$(MAKE) -f.simd -fMakefile clean__
-
clean__: clean_test
- @rm -f $(OBJ) $(TEST_OBJ) librsimd.so rsimd.pc .pkg .simd
+ rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME) rsimd.pc .pkg .simd
distclean: clean
@rm -f $(DEP) $(TEST_DEP) .test
+lint:
+ shellcheck -o all make.sh
+
+build_tests clean install .test test uninstall: .simd
+ @$(MAKE) -f.simd -fMakefile $@__
+
################################################################################
# Installation
################################################################################
-API_REGULAR=\
+API_SIMD128=\
src/aosf33.h\
src/aosf44.h\
src/aosq.h\
src/math.h\
src/mathX.h\
src/math4.h\
- src/math8.h\
src/rsimd.h\
src/soaXfY.h\
src/soaXfY_begin.h\
@@ -86,92 +101,121 @@ API_REGULAR=\
src/soa4f2.h\
src/soa4f3.h\
src/soa4f4.h\
- src/soa8f2.h\
- src/soa8f3.h\
- src/soa8f4.h\
src/vXf_begin.h\
- src/vXf_end.h
-API_AVX=\
- src/avx/avx.h\
- src/avx/avxf.h\
- src/avx/avxi.h
-API_SSE=\
+ src/vXf_end.h\
src/sse/sse.h\
src/sse/ssef.h\
src/sse/ssei.h\
src/sse/sse_swz.h
+API_SIMD256=\
+ src/math8.h\
+ src/soa8f2.h\
+ src/soa8f3.h\
+ src/soa8f4.h\
+ src/avx/avx.h\
+ src/avx/avxf.h\
+ src/avx/avxi.h\
+ $(API_SIMD128)
+API = $(API_SIMD$(SIMD_WIDTH))
-pkg: .simd
- @$(MAKE) -f.simd -fMakefile pkg__
-
-pkg__:
+pkg:
@echo "Setup rsimd.pc"
@sed -e 's#@PREFIX@#$(PREFIX)#g' \
- -e 's#@VERSION@#$(VERSION)#g' \
- -e 's#@SLEEF_VERSION@#$(SLEEF_VERSION)#g' \
- -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g' \
- -e 's#@CFLAGS_SIMD@#$(CFLAGS_SIMD)#g' \
- rsimd.pc.in > rsimd.pc
-
-install: build_library pkg
- mkdir -p $(DESTDIR)$(PREFIX)/lib
- mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig
- mkdir -p $(DESTDIR)$(PREFIX)/include/rsimd/avx
- mkdir -p $(DESTDIR)$(PREFIX)/include/rsimd/sse
- mkdir -p $(DESTDIR)$(PREFIX)/share/doc/rsimd
- cp librsimd.so $(DESTDIR)$(PREFIX)/lib
- cp rsimd.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig
- cp COPYING README.md $(DESTDIR)$(PREFIX)/share/doc/rsimd
- cp $(API_REGULAR) $(DESTDIR)$(PREFIX)/include/rsimd
- cp $(API_AVX) $(DESTDIR)$(PREFIX)/include/rsimd/avx
- cp $(API_SSE) $(DESTDIR)$(PREFIX)/include/rsimd/sse
-
-uninstall:
- rm -f $(DESTDIR)$(PREFIX)/lib/librsimd.so
+ -e 's#@VERSION@#$(VERSION)#g' \
+ -e 's#@SLEEF_VERSION@#$(SLEEF_VERSION)#g' \
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g' \
+ -e 's#@CFLAGS_SIMD@#$(CFLAGS_SIMD)#g' \
+ rsimd.pc.in > rsimd.pc
+
+# Remove the include directive rather than setting it to "./src". to prevent
+# the source directory from having a higher priority than the system include
+# directories. In such a situation, the local "math.h" file could be included
+# instead of the "math.h" header provided by the C standard library. Note that
+# this is no longer a problem with the common pc file : the "math.h" file is
+# installed in the "rsimd" subdirectory, which is therefore a prefix of the
+# header file allowing it to be distinguished from the header of the standard
+# library
+rsimd-local.pc: rsimd.pc.in
+ @sed -e '1,2d'\
+ -e 's#^libdir=.*#libdir=./#'\
+ -e 's#@VERSION@#$(VERSION)#g' \
+ -e 's#@SLEEF_VERSION@#$(SLEEF_VERSION)#g' \
+ -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g' \
+ -e 's#@CFLAGS_SIMD@#$(CFLAGS_SIMD)#g' \
+ -e 's#-I$${includedir}##g'\
+ rsimd.pc.in > $@
+
+install__: build_library pkg
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME)
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" rsimd.pc
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/rsimd" $(API)
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/rsimd" COPYING README.md
+
+uninstall__:
+ rm -f $(DESTDIR)$(PREFIX)/lib/$(LIBNAME)
rm -f $(DESTDIR)$(PREFIX)/lib/pkgconfig/rsimd.pc
rm -f $(DESTDIR)$(PREFIX)/share/doc/rsimd/COPYING
rm -f $(DESTDIR)$(PREFIX)/share/doc/rsimd/README.md
- rm -f $$(echo $(API_REGULAR) | sed 's,src\/,$(DESTDIR)$(PREFIX)\/include\/rsimd\/,g')
- rm -f $$(echo $(API_AVX) | sed 's,src\/,$(DESTDIR)$(PREFIX)\/include\/rsimd\/,g')
- rm -f $$(echo $(API_SSE) | sed 's,src\/,$(DESTDIR)$(PREFIX)\/include\/rsimd\/,g')
+ rm -f $$(echo $(API) | sed 's,src\/,$(DESTDIR)$(PREFIX)\/include\/rsimd\/,g')
################################################################################
# Tests
################################################################################
-TEST_SSE2 =\
- test_aosf33\
- test_aosf44\
- test_aosq\
- test_math4\
- test_soa4f2\
- test_soa4f3\
- test_soa4f4\
- test_v4f\
- test_v4i
-TEST_AVX =\
- test_math8\
- test_soa8f2\
- test_soa8f3\
- test_soa8f4
-TEST_SSE4_1 =\
- test_v4f_sse4_1\
- test_v4i_sse4_1
-TEST_FMA =\
- test_v4f_fma\
- test_soa8f2_fma\
- test_soa8f3_fma\
- test_soa8f4_fma
-
-TEST = $(TEST_SSE2) $(TEST_AVX) $(TEST_SSE4_1) $(TEST_FMA)
-
-test: build_tests
- @$(SHELL) make.sh run_test $(TEST)
-
-build_tests: build_library .test
- @$(MAKE) -fMakefile -f.test test_bin
-
-.test: make.sh config.mk
- @$(SHELL) make.sh config_test $(TEST) > $@
+TEST_SIMD128=\
+ src/test_aosf33.c\
+ src/test_aosf44.c\
+ src/test_aosq.c\
+ src/test_math4.c\
+ src/test_soa4f2.c\
+ src/test_soa4f3.c\
+ src/test_soa4f4.c\
+ src/test_v4f.c\
+ src/test_v4i.c
+TEST_SIMD256=\
+ src/test_math8.c\
+ src/test_soa8f2.c\
+ src/test_soa8f3.c\
+ src/test_soa8f4.c\
+ $(TEST_SIMD128)
+TEST_SRC = $(TEST_SIMD$(SIMD_WIDTH))
+TEST_OBJ = $(TEST_SRC:.c=.o)
+TEST_DEP = $(TEST_SRC:.c=.d)
+
+PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG)
+RSIMD_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags rsimd-local.pc)
+RSIMD_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs rsimd-local.pc)
+
+build_tests__: build_library $(TEST_DEP) .test .simd
+ @$(MAKE) -f.simd -fMakefile -f.test \
+ $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin
+
+test__: build_tests
+ @$(SHELL) make.sh run_test $(TEST_SRC)
+
+.test__: Makefile make.sh
+ $(SHELL) make.sh config_test $(TEST_SRC) > .test
clean_test:
- @$(SHELL) make.sh clean_test $(TEST)
+ @$(SHELL) make.sh clean_test $(TEST_SRC)
+
+$(TEST_OBJ): config.mk rsimd-local.pc
+ $(CC) -std=c89 $(CFLAGS) $(RSIMD_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@
+
+test_aosf33 \
+test_aosf44 \
+test_aosq \
+test_soa4f2 \
+test_soa4f3 \
+test_soa4f4 \
+test_soa8f2 \
+test_soa8f3 \
+test_soa8f4 \
+test_v4f \
+test_v4i \
+: rsimd-local.pc
+ $(CC) -o $@ src/$@.o $(LDFLAGS) $(RSIMD_LIBS) $(RSYS_LIBS)
+
+test_math4 \
+test_math8 \
+: rsimd-local.pc
+ $(CC) -o $@ src/$@.o $(LDFLAGS) $(RSIMD_LIBS) $(RSYS_LIBS) -lm
diff --git a/config.mk b/config.mk
@@ -1,36 +1,71 @@
VERSION = 0.3.0 # Library version
-
PREFIX = /usr/local
+
+LIB_TYPE = SHARED
+#LIB_TYPE = STATIC
+
+BUILD_TYPE = RELEASE
+#BUILD_TYPE = DEBUG
+
+# If not set, SIMD WIDTH is retrieved from host CPU
+#SIMD_WIDTH = 128
+#SIMD_WIDTH = 256
+
+################################################################################
+# Tools
+################################################################################
+AR = ar
+CC = cc
PKG_CONFIG = pkg-config
+RANLIB = ranlib
################################################################################
# Dependencies
################################################################################
+PCFLAGS_SHARED =
+PCFLAGS_STATIC = --static
+PCFLAGS = $(PCFLAGS_$(LIB_TYPE))
+
RSYS_VERSION = 0.12
-RSYS_INC = $$($(PKG_CONFIG) --cflags rsys)
-RSYS_LIB = $$($(PKG_CONFIG) --libs rsys)
+RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys)
+RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys)
SLEEF_VERSION = 3.6
-SLEEF_INC = $$($(PKG_CONFIG) --cflags sleef)
-SLEEF_LIB = $$($(PKG_CONFIG) --libs sleef)
+SLEEF_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags sleef)
+SLEEF_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs sleef)
-INCS = $(RSYS_INC) $(SLEEF_INC)
-LIBS = $(RSYS_LIB) $(SLEEF_LIB)
+DPDC_CFLAGS = $(RSYS_CFLAGS) $(SLEEF_CFLAGS)
+DPDC_LIBS = $(RSYS_LIBS) $(SLEEF_LIBS)
################################################################################
# Compilation options
################################################################################
-CC = cc # Compiler
-
-CPPFLAGS = -DNDEBUG
WFLAGS =\
-Wall\
+ -Wcast-align\
-Wconversion\
-Wextra\
-Wmissing-declarations\
-Wmissing-prototypes\
-Wshadow
+CFLAGS_SIMD = -march=native
+CFLAGS_COMMON =\
+ -pedantic\
+ -fPIC\
+ -fvisibility=hidden\
+ -fstrict-aliasing\
+ $(WFLAGS)\
+ $(CFLAGS_SIMD)
+
+CFLAGS_DEBUG = -g $(CFLAGS_COMMON)
+CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON)
+CFLAGS = $(CFLAGS_$(BUILD_TYPE))
+
+################################################################################
+# Linker options
+################################################################################
+SOFLAGS = -shared -Wl,--no-undefined
-CFLAGS = -O2 -std=c99 -pedantic -fPIC -fvisibility=hidden -fstrict-aliasing\
- -Wl,--no-undefined $(WFLAGS) $(CPPFLAGS) $(CFLAGS_SIMD)# Compiler options
-LDFLAGS = -shared # Linker options
+LDFLAGS_DEBUG =
+LDFLAGS_RELEASE = -s
+LDFLAGS = $(LDFLAGS_$(BUILD_TYPE))
diff --git a/make.sh b/make.sh
@@ -42,141 +42,71 @@ check_cpuflag()
################################################################################
# Main functions
################################################################################
-run_test()
+config_simd()
{
- n=0
-
- for i in "$@"; do
- printf "%s " "${i}"
- if ./"${i}" > /dev/null 2>&1; then
- printf "\e[1;32mOK\e[m\n"
- else
- printf "\e[1;31mErreur\e[m\n"
- n=$((n+1))
- fi
- done
-
- if [ "${n}" -ne 0 ]; then
- printf "%d errors\n" "${n}"
- exit 1
+ simd_width="$(showvar SIMD_WIDTH)"
+ avx="$(check_cpuflag avx)"
+ if [ -z "${simd_width}" ] \
+ && [ -n "${avx}" ]; then
+ simd_width=256
fi
+ printf "SIMD_WIDTH = %s\n" "${simd_width}"
}
-clean_test()
+config_test()
{
for i in "$@"; do
- rm -f "${i}"
+ test=$(basename "${i}" ".c")
+ test_list="${test_list} ${test}"
+ printf "%s: src/%s.o\n" "${test}" "${test}"
done
+ printf "test_bin: %s\n" "${test_list}"
}
-config_simd()
+run_test()
{
- cflags=""
- src=""
-
- sse2="$(check_cpuflag sse2)"
- sse4_1="$(check_cpuflag sse4_1)"
- avx="$(check_cpuflag avx)"
- fma="$(check_cpuflag fma)"
-
- if [ -z "${sse2}" ]; then
- >&2 echo "The SSE2 instruction set must be supported."
- exit 1
- else
- >&2 echo "Use the SSE2 instruction set"
- cflags="${cflags} -msse2"
- fi
-
- if [ -n "${sse4_1}" ]; then
- >&2 echo "Use the SSE4.1 instruction set"
- cflags="${cflags} -msse4.1"
- fi
-
- if [ -n "${avx}" ]; then
- >&2 echo "Use the AVX instruction set"
- cflags="${cflags} -mavx"
- src="${src} src/math8.c"
- fi
-
- if [ -n "${fma}" ]; then
- >&2 echo "Use the FMA instruction set"
- cflags="${cflags} -mfma"
- fi
+ for i in "$@"; do
+ test=$(basename "${i}" ".c")
- printf "CFLAGS_SIMD = %s\n" "${cflags}"
- printf "SRC_SIMD = %s\n" "${src}"
+ printf "%s " "${test}"
+ if ./"${test}" > /dev/null 2>&1; then
+ printf "\e[1;32mOK\e[m\n"
+ else
+ printf "\e[1;31mError\e[m\n"
+ n=$((n+1))
+ fi
+ done 2> /dev/null
}
-config_test()
+clean_test()
{
- sse4_1="$(check_cpuflag sse4_1)"
- avx="$(check_cpuflag avx)"
- fma="$(check_cpuflag fma)"
-
- cc="$(showvar CC)"
- cflags="$(showvar CFLAGS)"
- incs="$(showvar INCS)"
-
for i in "$@"; do
- cflags=""
- case "${i}" in
- *_sse4_1)
- [ -z "${sse4_1}" ] && continue
- prefix=$(echo "${i}" | sed 's/_sse4_1//')
- cflags="-msse4.1"
- ;;
- *_fma)
- [ -z "${fma}" ] && continue
- prefix=$(echo "${i}" | sed 's/_fma//')
- cflags="-mfma"
- ;;
- test_soa8* | test_math8)
- [ -z "${avx}" ] && continue
- prefix="${i}"
- cflags="-mavx"
- ;;
- *)
- prefix="${i}"
- cflags="-msse2"
- ;;
- esac
-
- printf "%s: librsimd.so\n" "${i}"
-
- # shellcheck disable=SC2086
- ${cc} ${cflags} ${incs} -MM -MT "${i}" "src/${prefix}.c" -MF -
-
- printf "\t@echo \"CC \$@\"\n"
- printf "\t@\$(CC) \$(CFLAGS) %s \$(RSYS_INC) -L\$\$(pwd) "\
-"-o \$@ src/%s.c -lrsimd -lm\n" "${cflags}" "${prefix}"
-
- test_list="${test_list} ${i}"
+ rm -f "$(basename "${i}" ".c")"
done
- printf "test_bin: %s\n" "${test_list}"
}
-
-config_pkg()
+install()
{
- pkg_config=$(showvar PKG_CONFIG)
+ prefix=$1
+ shift 1
- rsys_version=$(showvar RSYS_VERSION)
- sleef_version=$(showvar SLEEF_VERSION)
- dependencies="\
- RSys rsys ${rsys_version}
- Sleef sleef ${sleef_version}"
+ for i in "$@"; do
+ # Remove the "src" directory and append the "prefix"
+ dst="${prefix}/${i#*/}"
- printf "%s\n" "${dependencies}" | while read -r i; do
- name=$(printf "%s" "${i}" | cut -d' ' -f1)
- pc=$(printf "%s" "${i}" | cut -d' ' -f2)
- version=$(printf "%s" "${i}" | cut -d' ' -f3)
+ # Create the Install directory if required
+ dir="${dst%/*}"
+ if [ ! -d "${dir}" ]; then
+ mkdir -p "${dir}"
+ fi
- if ! "${pkg_config}" --atleast-version "${version}" "${pc}"; then
- >&2 printf "\e[1;31merror\e[0m:%s %s: dependency is missing\n" \
- "${name}" "${version}"
- exit 1
+ if cmp -s "${i}" "${dst}"; then
+ printf "Up to date %s\n" "${dst}"
+ else
+ printf "Installing %s\n" "${dst}"
+ cp "${i}" "${dst}"
fi
- done || exit $?
+ done
}
"$@"
diff --git a/src/rsimd.h b/src/rsimd.h
@@ -34,4 +34,3 @@
#endif
#endif /* RSIMD_H */
-
diff --git a/src/soaXfY_begin.h b/src/soaXfY_begin.h
@@ -43,7 +43,7 @@
#error "Unexpected macro definition"
#endif
-/* Macros genric to RSIMD_WIDTH__ and RSIMD_SOA_DIMENSION__ */
+/* Macros generic to RSIMD_WIDTH__ and RSIMD_SOA_DIMENSION__ */
#define RSIMD_soaXfY_PREFIX__ \
CONCAT(CONCAT(CONCAT(soa, RSIMD_WIDTH__), f), RSIMD_SOA_DIMENSION__)
#define RSIMD_soaXfY__(Func) CONCAT(CONCAT(RSIMD_soaXfY_PREFIX__, _), Func)
diff --git a/src/sse/ssei.h b/src/sse/ssei.h
@@ -221,7 +221,7 @@ v4i_min(const v4i_T v0, const v4i_T v1)
v4i_store(a, v0);
v4i_store(b, v1);
return v4i_set
- (MMIN(a[0], b[0]),
+ (MMIN(a[0], b[0]),
MMIN(a[1], b[1]),
MMIN(a[2], b[2]),
MMIN(a[3], b[3]));
@@ -239,7 +239,7 @@ v4i_max(const v4i_T v0, const v4i_T v1)
v4i_store(a, v0);
v4i_store(b, v1);
return v4i_set
- (MMAX(a[0], b[0]),
+ (MMAX(a[0], b[0]),
MMAX(a[1], b[1]),
MMAX(a[2], b[2]),
MMAX(a[3], b[3]));