Skip to content

Commit

Permalink
avx512 set: add simde_x_mm512_set_m256{,d}
Browse files Browse the repository at this point in the history
add tests for all `simde_mm512_set_*` functions
  • Loading branch information
mr-c committed Oct 25, 2023
1 parent 2eedece commit 67e0c50
Show file tree
Hide file tree
Showing 3 changed files with 756 additions and 1 deletion.
1 change: 1 addition & 0 deletions simde/x86/avx512/gather.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "types.h"
#include "../avx2.h"
#include "extract.h"

HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
Expand Down
34 changes: 33 additions & 1 deletion simde/x86/avx512/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,27 @@ simde_x_mm512_set_m128i (simde__m128i a, simde__m128i b, simde__m128i c, simde__
#endif
}

SIMDE_FUNCTION_ATTRIBUTES
simde__m512
simde_x_mm512_set_m256 (simde__m256 a, simde__m256 b) {
#if defined(SIMDE_X86_AVX512F_NATIVE)
SIMDE_ALIGN_TO_64 simde__m256 v[] = { b, a };
return simde_mm512_load_ps(HEDLEY_STATIC_CAST(__m512 *, HEDLEY_STATIC_CAST(void *, v)));
#else
simde__m512_private r_;

r_.m256[0] = b;
r_.m256[1] = a;

return simde__m512_from_private(r_);
#endif
}

SIMDE_FUNCTION_ATTRIBUTES
simde__m512i
simde_x_mm512_set_m256i (simde__m256i a, simde__m256i b) {
#if defined(SIMDE_X86_AVX512F_NATIVE)
SIMDE_ALIGN_LIKE_32(simde__m256i) simde__m256i v[] = { b, a };
SIMDE_ALIGN_TO_64 simde__m256i v[] = { b, a };
return simde_mm512_load_si512(HEDLEY_STATIC_CAST(__m512i *, HEDLEY_STATIC_CAST(void *, v)));
#else
simde__m512i_private r_;
Expand All @@ -431,6 +447,22 @@ simde_x_mm512_set_m256i (simde__m256i a, simde__m256i b) {
#endif
}

SIMDE_FUNCTION_ATTRIBUTES
simde__m512d
simde_x_mm512_set_m256d (simde__m256d a, simde__m256d b) {
#if defined(SIMDE_X86_AVX512F_NATIVE)
SIMDE_ALIGN_TO_64 simde__m256d v[] = { b, a };
return simde_mm512_load_pd(HEDLEY_STATIC_CAST(__m512d *, HEDLEY_STATIC_CAST(void *, v)));
#else
simde__m512d_private r_;

r_.m256d[0] = b;
r_.m256d[1] = a;

return simde__m512d_from_private(r_);
#endif
}

SIMDE_FUNCTION_ATTRIBUTES
simde__m512
simde_mm512_set_ps (simde_float32 e15, simde_float32 e14, simde_float32 e13, simde_float32 e12,
Expand Down
Loading

0 comments on commit 67e0c50

Please sign in to comment.