Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2021-08-23 20:22:01 +0300
committerHenrik Gramner <gramner@twoorioles.com>2021-08-31 12:47:42 +0300
commit64c65de3faf1fa5e0272858203a9590f4ca31927 (patch)
tree9dbb39ddf653a0c04fb36540319665ed75239f76
parent94a0e5ec13febf376d9bf29ed8d0bb693c690c5c (diff)
x86: Automatically convert SSE asm to AVX when compiling for AVX targets
Requires meson 0.51 or newer (older versions will just keep the SSE).
-rw-r--r--.gitlab-ci.yml15
-rw-r--r--meson.build3
-rw-r--r--src/ext/x86/x86inc.asm7
3 files changed, 24 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a566dc..c0029a5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -178,6 +178,21 @@ build-debian-bitdepth-16:
-Dbitdepths=16
- ninja -C build
+build-debian-avx:
+ extends: .debian-amd64-common
+ tags:
+ - docker
+ - avx2
+ - amd64
+ variables:
+ CFLAGS: '-mavx'
+ script:
+ - meson build --buildtype debug
+ --werror
+ - ninja -C build
+ - cd build
+ - time meson test -v --suite checkasm
+
build-win32:
extends: .debian-amd64-common
script:
diff --git a/meson.build b/meson.build
index abbb28b..96ac31e 100644
--- a/meson.build
+++ b/meson.build
@@ -375,6 +375,9 @@ if host_machine.cpu_family().startswith('x86')
cdata_asm.set10('ARCH_X86_64', host_machine.cpu_family() == 'x86_64')
cdata_asm.set10('ARCH_X86_32', host_machine.cpu_family() == 'x86')
cdata_asm.set10('PIC', true)
+
+ # Convert SSE asm into (128-bit) AVX when compiler flags are set to use AVX instructions
+ cdata_asm.set10('FORCE_VEX_ENCODING', cc.get_define('__AVX__') != '')
endif
cdata.set10('ARCH_PPC64LE', host_machine.cpu() == 'ppc64le')
diff --git a/src/ext/x86/x86inc.asm b/src/ext/x86/x86inc.asm
index d7db10e..c9f2d63 100644
--- a/src/ext/x86/x86inc.asm
+++ b/src/ext/x86/x86inc.asm
@@ -79,6 +79,11 @@
%define mangle(x) x
%endif
+; Use VEX-encoding even in non-AVX functions
+%ifndef FORCE_VEX_ENCODING
+ %define FORCE_VEX_ENCODING 0
+%endif
+
%macro SECTION_RODATA 0-1 16
%ifidn __OUTPUT_FORMAT__,win32
SECTION .rdata align=%1
@@ -1008,7 +1013,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%endmacro
%macro INIT_XMM 0-1+
- %assign avx_enabled 0
+ %assign avx_enabled FORCE_VEX_ENCODING
%define RESET_MM_PERMUTATION INIT_XMM %1
%define mmsize 16
%define mova movdqa