Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions avxintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,13 @@ FORCE_INLINE __m256i _mm256_set1_epi8(int8_t a)
return ret;
}

FORCE_INLINE __m256i _mm256_set1_epi16(int16_t a)
{
__m256i ret;
ret.vect_s16[0] = ret.vect_s16[1] = vdupq_n_s16(a);
return ret;
}

FORCE_INLINE __m256i _mm256_set1_epi32(int32_t a)
{
__m256i ret;
Expand Down
9 changes: 9 additions & 0 deletions data/avx2neontestdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,15 @@ static test_mm256_set1_epi8_data_model g_test_mm256_set1_epi8_data = {
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'},
};

typedef struct {
int16_t a;
int16_t expect[16];
} test_mm256_set1_epi16_data_model;
static test_mm256_set1_epi16_data_model g_test_mm256_set1_epi16_data = {
2019,
{2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019},
};

typedef struct {
int32_t a;
int32_t expect[8];
Expand Down
11 changes: 11 additions & 0 deletions tests/a2ntest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,10 @@ const char *RunTest(InstructionTest test, int *flag)
ret = "MM256_SET1_EPI8";
*flag = test_mm256_set1_epi8();
break;
case UT_MM256_SET1_EPI16:
ret = "MM256_SET1_EPI16";
*flag = test_mm256_set1_epi16();
break;
case UT_MM256_SET1_EPI32:
ret = "MM256_SET1_EPI32";
*flag = test_mm256_set1_epi32();
Expand Down Expand Up @@ -4716,6 +4720,13 @@ int test_mm256_set1_epi8()
return comp_return(g_test_mm256_set1_epi8_data.expect, &dst, sizeof(dst));
}

int test_mm256_set1_epi16()
{
__m256i dst = _mm256_set1_epi16(g_test_mm256_set1_epi16_data.a);

return comp_return(g_test_mm256_set1_epi16_data.expect, &dst, sizeof(dst));
}

int test_mm256_set1_epi32()
{
__m256i dst = _mm256_set1_epi32(g_test_mm256_set1_epi32_data.a);
Expand Down
2 changes: 2 additions & 0 deletions tests/a2ntest.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ typedef enum {
UT_MM256_SET_M128I,
UT_MM256_SET1_EPI64X,
UT_MM256_SET1_EPI8,
UT_MM256_SET1_EPI16,
UT_MM_SETZERO_SI128,
UT_MM256_SETZERO_SI256,
UT_MM512_SETZERO_SI512,
Expand Down Expand Up @@ -596,6 +597,7 @@ int test_mm_set1_ps(void);
int test_mm_set1_epi64x(void);
int test_mm_set1_pd(void);
int test_mm256_set1_epi8(void);
int test_mm256_set1_epi16(void);
int test_mm256_set1_epi32(void);
int test_mm256_set1_epi64x(void);
int test_mm256_set1_pd(void);
Expand Down