Skip to content

Commit 45f1004

Browse files
Tyler Retzlaffdavid-marchand
Tyler Retzlaff
authored andcommitted
eal/x86: rework some vector constant for MSVC
MSVC __declspec(align(#)) is limited and accepts only integer literals as opposed to constant expressions. Define XMM_SIZE to be 16 instead of sizeof(xmm_t) and static_assert that sizeof(xmm_t) == 16 for compatibility. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
1 parent e9fd1eb commit 45f1004

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/eal/x86/include/rte_vect.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* RTE SSE/AVX related header.
1212
*/
1313

14+
#include <assert.h>
1415
#include <stdint.h>
1516
#include <rte_config.h>
1617
#include <rte_common.h>
@@ -33,9 +34,11 @@ extern "C" {
3334

3435
typedef __m128i xmm_t;
3536

36-
#define XMM_SIZE (sizeof(xmm_t))
37+
#define XMM_SIZE 16
3738
#define XMM_MASK (XMM_SIZE - 1)
3839

40+
static_assert(sizeof(xmm_t) == XMM_SIZE, "");
41+
3942
typedef union rte_xmm {
4043
xmm_t x;
4144
uint8_t u8[XMM_SIZE / sizeof(uint8_t)];

0 commit comments

Comments
 (0)