From ec39010390d121c11be6135a5157515da0b708ef Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 18 Feb 2022 17:40:19 -0800 Subject: [PATCH] qsimd_p.h: move macros up Change-Id: Ic15405335d804bdea761fffd16d50c5a18275b23 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qsimd_p.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/global/qsimd_p.h b/src/corelib/global/qsimd_p.h index 432db8f3b5..8d3a63de7b 100644 --- a/src/corelib/global/qsimd_p.h +++ b/src/corelib/global/qsimd_p.h @@ -55,6 +55,15 @@ #include #include +#define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \ + for (; i < static_cast(qMin(static_cast(length), ((4 - ((reinterpret_cast(ptr) >> 2) & 0x3)) & 0x3))); ++i) + +#define ALIGNMENT_PROLOGUE_32BYTES(ptr, i, length) \ + for (; i < static_cast(qMin(static_cast(length), ((8 - ((reinterpret_cast(ptr) >> 2) & 0x7)) & 0x7))); ++i) + +#define SIMD_EPILOGUE(i, length, max) \ + for (int _i = 0; _i < max && i < length; ++i, ++_i) + /* * qt_module_config.prf defines the QT_COMPILER_SUPPORTS_XXX macros. * They mean the compiler supports the necessary flags and the headers @@ -398,17 +407,8 @@ inline bool qHasHwrng() #endif } -#define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \ - for (; i < static_cast(qMin(static_cast(length), ((4 - ((reinterpret_cast(ptr) >> 2) & 0x3)) & 0x3))); ++i) - -#define ALIGNMENT_PROLOGUE_32BYTES(ptr, i, length) \ - for (; i < static_cast(qMin(static_cast(length), ((8 - ((reinterpret_cast(ptr) >> 2) & 0x7)) & 0x7))); ++i) - QT_END_NAMESPACE #endif // __cplusplus -#define SIMD_EPILOGUE(i, length, max) \ - for (int _i = 0; _i < max && i < length; ++i, ++_i) - #endif // QSIMD_P_H