From a287c06c278f88817feb435fa0f2dd53471c90b7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Oct 2023 23:10:28 +0200 Subject: compat/defs: add unroll pragma --- compat/defs.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/compat/defs.hpp b/compat/defs.hpp index 7fa74c9f..6b80f6ea 100644 --- a/compat/defs.hpp +++ b/compat/defs.hpp @@ -61,3 +61,20 @@ #else #define fm_no_unique_address no_unique_address #endif + +#ifdef _MSC_VER +#define fm_UNROLL _Pragma("loop(ivdep)") +#define fm_UNROLL_4 fm_UNROLL +#define fm_UNROLL_8 fm_UNROLL +#else +#ifndef __SIZEOF_POINTER__ +#error "missing __SIZEOF_POINTER__" +#endif +#define fm_UNROLL_4 _Pragma("GCC unroll 4") +#define fm_UNROLL_8 _Pragma("GCC unroll 8") +#if __SIZEOF_POINTER__ >= 8 +#define fm_UNROLL _Pragma("GCC unroll 8") +#else +#define fm_UNROLL _Pragma("GCC unroll 4") +#endif +#endif -- cgit v1.2.3