vppinfra: CLIB_HAVE_VEC128 mandates SSE4.2 70/10670/1
authorDamjan Marion <damarion@cisco.com>
Tue, 20 Feb 2018 07:33:50 +0000 (08:33 +0100)
committerDamjan Marion <damarion@cisco.com>
Tue, 20 Feb 2018 07:53:19 +0000 (08:53 +0100)
Change-Id: I6511110d0472203498a4f8741781eeeeb4f90844
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vnet/classify/vnet_classify.h
src/vnet/ethernet/ethernet.h
src/vppinfra.am
src/vppinfra/vector.h
src/vppinfra/vector_sse42.h [moved from src/vppinfra/vector_sse2.h with 100% similarity]

index 79e7f1a..6cbbf10 100644 (file)
@@ -41,7 +41,7 @@ extern vlib_node_registration_t ip6_classify_node;
 
 #define CLASSIFY_TRACE 0
 
-#if !defined( __aarch64__) && !defined(__arm__)
+#ifdef CLIB_HAVE_VEC128
 #define CLASSIFY_USE_SSE       //Allow usage of SSE operations
 #endif
 
index 389bc1b..fb7e2c5 100644 (file)
@@ -67,6 +67,7 @@ ethernet_mac_address_is_zero (u8 * mac)
   return ((*((u32 *) mac) == 0) && (*((u16 *) (mac + 4)) == 0));
 }
 
+#ifdef CLIB_HAVE_VEC128
 static const u16x8 tagged_ethertypes = {
   (u16) ETHERNET_TYPE_VLAN,
   (u16) ETHERNET_TYPE_DOT1AD,
@@ -78,6 +79,7 @@ static const u16x8 tagged_ethertypes = {
   (u16) ETHERNET_TYPE_VLAN_9200,
   (u16) ETHERNET_TYPE_VLAN_9200
 };
+#endif
 
 static_always_inline int
 ethernet_frame_is_tagged (u16 type)
index 2bb16b2..6b7c77e 100644 (file)
@@ -270,7 +270,7 @@ nobase_include_HEADERS = \
   vppinfra/vector_funcs.h \
   vppinfra/vector_iwmmxt.h \
   vppinfra/vector_neon.h \
-  vppinfra/vector_sse2.h \
+  vppinfra/vector_sse42.h \
   vppinfra/valgrind.h \
   vppinfra/xxhash.h \
   vppinfra/xy.h \
index e786275..13d7ba2 100644 (file)
@@ -50,7 +50,7 @@
 #define CLIB_HAVE_VEC128
 #endif
 
-#if defined (__SSE2__) && __GNUC__ >= 4
+#if defined (__SSE4_2__) && __GNUC__ >= 4
 #define CLIB_HAVE_VEC128
 #endif
 
@@ -73,7 +73,6 @@
 
 #define _vector_size(n) __attribute__ ((vector_size (n)))
 
-#ifdef CLIB_HAVE_VEC64
 /* Signed 64 bit. */
 typedef char i8x8 _vector_size (8);
 typedef short i16x4 _vector_size (8);
@@ -86,9 +85,7 @@ typedef unsigned int u32x2 _vector_size (8);
 
 /* Floating point 64 bit. */
 typedef float f32x2 _vector_size (8);
-#endif /* CLIB_HAVE_VEC64 */
 
-#ifdef CLIB_HAVE_VEC128
 /* Signed 128 bit. */
 typedef i8 i8x16 _vector_size (16);
 typedef i16 i16x8 _vector_size (16);
@@ -118,9 +115,7 @@ typedef u64 u64x4 _vector_size (32);
 
 typedef f32 f32x8 _vector_size (32);
 typedef f64 f64x4 _vector_size (32);
-#endif /* CLIB_HAVE_VEC128 */
 
-#ifdef CLIB_HAVE_VEC512
 /* Signed 512 bit. */
 typedef i8 i8x64 _vector_size (64);
 typedef i16 i16x32 _vector_size (64);
@@ -135,7 +130,6 @@ typedef u64 u64x8 _vector_size (64);
 
 typedef f32 f32x16 _vector_size (64);
 typedef f64 f64x8 _vector_size (64);
-#endif /* CLIB_HAVE_VEC512 */
 
 /* Vector word sized types. */
 #ifndef CLIB_VECTOR_WORD_BITS
@@ -258,8 +252,8 @@ _(i64, 2);
 
 #endif
 
-#if defined (__SSE2__) && __GNUC__ >= 4
-#include <vppinfra/vector_sse2.h>
+#if defined (__SSE4_2__) && __GNUC__ >= 4
+#include <vppinfra/vector_sse42.h>
 #endif
 
 #if defined (__ALTIVEC__)