1 /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15
16 #ifndef TENSORFLOW_CORE_PLATFORM_WINDOWS_INTRINSICS_PORT_H_
17 #define TENSORFLOW_CORE_PLATFORM_WINDOWS_INTRINSICS_PORT_H_
18
19 #ifdef _MSC_VER
20 // the following avx intrinsics are not defined on windows
21 // in immintrin.h so we define them here.
22 //
23 #include "tensorflow/core/platform/types.h"
24
25 #define _mm_load_pd1 _mm_load1_pd
26
27 // only define these intrinsics if immintrin.h doesn't have them (VS2015 and
28 // earlier)
29 #if _MSC_VER < 1910
_mm256_extract_epi32(__m256i a,const int i)30 static inline int _mm256_extract_epi32(__m256i a, const int i) {
31 return a.m256i_i32[i & 7];
32 }
33
_mm256_insert_epi32(__m256i a,int b,const int i)34 static inline __m256i _mm256_insert_epi32(__m256i a, int b, const int i) {
35 __m256i c = a;
36 c.m256i_i32[i & 7] = b;
37 return c;
38 }
39 #endif
40 #endif
41 #endif
42