[v3,19/24] test/xmmt_ops: add dummy vector implementation for LoongArch

Message ID 20220606131054.2097526-20-zhoumin@loongson.cn (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series Support LoongArch architecture |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

zhoumin June 6, 2022, 1:10 p.m. UTC
  The hardware instructions based vector implementation will come
in a future patch. This dummy implementation can also work.

Signed-off-by: Min Zhou <zhoumin@loongson.cn>
---
 app/test/test_xmmt_ops.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Patch

diff --git a/app/test/test_xmmt_ops.h b/app/test/test_xmmt_ops.h
index 3a82d5ecac..7b2c3c37dd 100644
--- a/app/test/test_xmmt_ops.h
+++ b/app/test/test_xmmt_ops.h
@@ -49,6 +49,23 @@  vect_set_epi32(int i3, int i2, int i1, int i0)
 	return data;
 }
 
+#elif defined(RTE_ARCH_LOONGARCH)
+/* loads the xmm_t value from address p(does not need to be 16-byte aligned)*/
+static __rte_always_inline xmm_t
+vect_loadu_sil128(void *p)
+{
+	xmm_t data;
+	data = *(const xmm_t *)p;
+	return data;
+}
+
+/* sets the 4 signed 32-bit integer values and returns the xmm_t variable */
+static __rte_always_inline xmm_t
+vect_set_epi32(int i3, int i2, int i1, int i0)
+{
+	xmm_t data = (xmm_t){.u32 = {i0, i1, i2, i3} };
+	return data;
+}
 #endif
 
 #endif /* _TEST_XMMT_OPS_H_ */