• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 The libgav1 Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef LIBGAV1_SRC_DSP_X86_COMMON_AVX2_H_
18 #define LIBGAV1_SRC_DSP_X86_COMMON_AVX2_H_
19 
20 #include "src/utils/compiler_attributes.h"
21 #include "src/utils/cpu.h"
22 
23 #if LIBGAV1_TARGETING_AVX2
24 
25 #include <immintrin.h>
26 
27 #include <cassert>
28 #include <cstddef>
29 #include <cstdint>
30 #include <cstring>
31 
32 namespace libgav1 {
33 namespace dsp {
34 namespace avx2 {
35 
36 #include "src/dsp/x86/common_avx2.inc"
37 #include "src/dsp/x86/common_sse4.inc"
38 
39 }  // namespace avx2
40 
41 // NOLINTBEGIN(misc-unused-using-decls)
42 // These function aliases shall not be visible to external code. They are
43 // restricted to x86/*_avx2.cc files only. This scheme exists to distinguish two
44 // possible implementations of common functions, which may differ based on
45 // whether the compiler is permitted to use avx2 instructions.
46 
47 // common_sse4.inc
48 using avx2::Load2;
49 using avx2::Load2x2;
50 using avx2::Load4;
51 using avx2::Load4x2;
52 using avx2::LoadAligned16;
53 using avx2::LoadAligned16Msan;
54 using avx2::LoadHi8;
55 using avx2::LoadHi8Msan;
56 using avx2::LoadLo8;
57 using avx2::LoadLo8Msan;
58 using avx2::LoadUnaligned16;
59 using avx2::LoadUnaligned16Msan;
60 using avx2::MaskHighNBytes;
61 using avx2::RightShiftWithRounding_S16;
62 using avx2::RightShiftWithRounding_S32;
63 using avx2::RightShiftWithRounding_U16;
64 using avx2::RightShiftWithRounding_U32;
65 using avx2::Store2;
66 using avx2::Store4;
67 using avx2::StoreAligned16;
68 using avx2::StoreHi8;
69 using avx2::StoreLo8;
70 using avx2::StoreUnaligned16;
71 
72 // common_avx2.inc
73 using avx2::LoadAligned32;
74 using avx2::LoadAligned32Msan;
75 using avx2::LoadAligned64;
76 using avx2::LoadAligned64Msan;
77 using avx2::LoadUnaligned32;
78 using avx2::LoadUnaligned32Msan;
79 using avx2::SetrM128i;
80 using avx2::StoreAligned32;
81 using avx2::StoreAligned64;
82 using avx2::StoreUnaligned32;
83 // NOLINTEND
84 
85 }  // namespace dsp
86 }  // namespace libgav1
87 
88 #endif  // LIBGAV1_TARGETING_AVX2
89 #endif  // LIBGAV1_SRC_DSP_X86_COMMON_AVX2_H_
90