mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
Detect compiler support for SIMD intrinsics in conditional compilation
This commit is contained in:
parent
1688ad5f0a
commit
00c904c927
4 changed files with 6 additions and 22 deletions
|
@ -9,15 +9,11 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
#ifdef __AVX2__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <immintrin.h> // AVX2
|
#include <immintrin.h>
|
||||||
|
|
||||||
#ifndef __AVX2__
|
|
||||||
#error Must be compiled with /arch:AVX2 or -mavx2 -mfma.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _mm256_permute4x64_ps(ymm, imm) _mm256_castpd_ps(_mm256_permute4x64_pd(_mm256_castps_pd(ymm), imm));
|
#define _mm256_permute4x64_ps(ymm, imm) _mm256_castpd_ps(_mm256_permute4x64_pd(_mm256_castps_pd(ymm), imm));
|
||||||
|
|
||||||
|
|
|
@ -9,17 +9,13 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
#ifdef __AVX2__
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <immintrin.h> // AVX2
|
#include <immintrin.h>
|
||||||
|
|
||||||
#include "../AudioHRTF.h"
|
#include "../AudioHRTF.h"
|
||||||
|
|
||||||
#ifndef __AVX2__
|
|
||||||
#error Must be compiled with /arch:AVX2 or -mavx2 -mfma.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__clang__)
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
// for some reason, GCC -O2 results in poorly optimized code
|
// for some reason, GCC -O2 results in poorly optimized code
|
||||||
#pragma GCC optimize("Os")
|
#pragma GCC optimize("Os")
|
||||||
|
|
|
@ -9,17 +9,13 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
#ifdef __AVX2__
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
#include "../AudioSRC.h"
|
#include "../AudioSRC.h"
|
||||||
|
|
||||||
#ifndef __AVX2__
|
|
||||||
#error Must be compiled with /arch:AVX2 or -mavx2 -mfma.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// high/low part of int64_t
|
// high/low part of int64_t
|
||||||
#define LO32(a) ((uint32_t)(a))
|
#define LO32(a) ((uint32_t)(a))
|
||||||
#define HI32(a) ((int32_t)((a) >> 32))
|
#define HI32(a) ((int32_t)((a) >> 32))
|
||||||
|
|
|
@ -9,17 +9,13 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
|
#ifdef __AVX512F__
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
#include "../AudioHRTF.h"
|
#include "../AudioHRTF.h"
|
||||||
|
|
||||||
#ifndef __AVX512F__
|
|
||||||
#error Must be compiled with /arch:AVX512 or -mavx512f.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__clang__)
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
// for some reason, GCC -O2 results in poorly optimized code
|
// for some reason, GCC -O2 results in poorly optimized code
|
||||||
#pragma GCC optimize("Os")
|
#pragma GCC optimize("Os")
|
||||||
|
|
Loading…
Reference in a new issue