mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nir: replace GCC unroll with an option that works on GCC < 8.0
Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3970>
This commit is contained in:
parent
1a61a5b1d4
commit
d18d07c9d7
1 changed files with 14 additions and 8 deletions
|
|
@ -220,17 +220,23 @@ analyze_constant(const struct nir_alu_instr *instr, unsigned src,
|
|||
|
||||
|
||||
#if defined(__clang__)
|
||||
/* clang wants _Pragma("unroll X") */
|
||||
#define pragma_unroll_5 _Pragma("unroll 5")
|
||||
#define pragma_unroll_7 _Pragma("unroll 7")
|
||||
/* clang wants _Pragma("unroll X") */
|
||||
#define pragma_unroll_5 _Pragma("unroll 5")
|
||||
#define pragma_unroll_7 _Pragma("unroll 7")
|
||||
/* gcc wants _Pragma("GCC unroll X") */
|
||||
#elif defined(__GNUC__)
|
||||
#define pragma_unroll_5 _Pragma("GCC unroll 5")
|
||||
#define pragma_unroll_7 _Pragma("GCC unroll 7")
|
||||
#if __GNUC__ >= 8
|
||||
#define pragma_unroll_5 _Pragma("GCC unroll 5")
|
||||
#define pragma_unroll_7 _Pragma("GCC unroll 7")
|
||||
#else
|
||||
#pragma GCC optimize ("unroll-loops")
|
||||
#define pragma_unroll_5
|
||||
#define pragma_unroll_7
|
||||
#endif
|
||||
#else
|
||||
/* MSVC doesn't have C99's _Pragma() */
|
||||
#define pragma_unroll_5
|
||||
#define pragma_unroll_7
|
||||
/* MSVC doesn't have C99's _Pragma() */
|
||||
#define pragma_unroll_5
|
||||
#define pragma_unroll_7
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue