| #include <riscv_vector.h> | |
| #include <springbok.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include "pw_unit_test/framework.h" | |
| #include "softrvv.h" | |
| namespace softrvv_vsext_test { | |
| namespace { | |
| int16_t src1[] = {-1, -2, 3, -4, 5}; | |
| const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); | |
| int32_t dest[AVL_CONST]; | |
| int32_t ref_dest[] = {-1, -2, 3, -4, 5}; | |
| class SoftRvvVsextTest : public ::testing::Test { | |
| protected: | |
| void SetUp() override { memset(dest, 0, sizeof(dest)); } | |
| }; | |
| TEST_F(SoftRvvVsextTest, VF2) { | |
| softrvv::vsext_v<int32_t, int16_t>(dest, src1, AVL_CONST); | |
| ASSERT_EQ(memcmp(dest, ref_dest, sizeof(dest)), 0); | |
| } | |
| } // namespace | |
| } // namespace softrvv_vsext_test |