Skip to content

Commit

Permalink
Warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Aug 12, 2024
1 parent 2dd3acc commit dc3eaa4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion source/Fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ namespace Langulus::SIMD
/// @return the filled register
template<int R> NOD() LANGULUS(INLINED)
auto Fill(const CT::Scalar auto& s) noexcept {
using T = Decvq<TypeOf<decltype(s)>>;

#if LANGULUS_SIMD(128BIT)
if constexpr (R <= 16) {
using T = Decvq<TypeOf<decltype(s)>>;
if constexpr (CT::SignedInteger8<T>) return V128<T> {simde_mm_set1_epi8 ( GetFirst(s))};
else if constexpr (CT::UnsignedInteger8<T>) return V128<T> {simde_x_mm_set1_epu8 ( GetFirst(s))};
else if constexpr (CT::SignedInteger16<T>) return V128<T> {simde_mm_set1_epi16 ( GetFirst(s))};
Expand All @@ -39,6 +39,7 @@ namespace Langulus::SIMD

#if LANGULUS_SIMD(256BIT)
if constexpr (R <= 32) {
using T = Decvq<TypeOf<decltype(s)>>;
if constexpr (CT::Integer8<T>) return V256<T> {simde_mm256_set1_epi8 ( GetFirst(s))};
else if constexpr (CT::Integer16<T>) return V256<T> {simde_mm256_set1_epi16 ( GetFirst(s))};
else if constexpr (CT::Integer32<T>) return V256<T> {simde_mm256_set1_epi32 ( GetFirst(s))};
Expand All @@ -52,6 +53,7 @@ namespace Langulus::SIMD

#if LANGULUS_SIMD(512BIT)
if constexpr (R <= 64) {
using T = Decvq<TypeOf<decltype(s)>>;
if constexpr (CT::Integer8<T>) return V512<T> {simde_mm512_set1_epi8 (GetFirst(s))};
else if constexpr (CT::Integer16<T>) return V512<T> {simde_mm512_set1_epi16 (GetFirst(s))};
else if constexpr (CT::Integer32<T>) return V512<T> {simde_mm512_set1_epi32 (GetFirst(s))};
Expand Down
2 changes: 1 addition & 1 deletion source/Load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace Langulus::SIMD
// DEF value, or directly if vector is of the proper size
// Should perform faster if 'v' is aligned properly
constexpr auto S = Inner::DecideCount<R, FORCE_OUT>();
constexpr auto RS = sizeof(T) * S;
UNUSED() constexpr auto RS = sizeof(T) * S;

#if LANGULUS_SIMD(128BIT)
if constexpr (RS <= 16) {
Expand Down
4 changes: 3 additions & 1 deletion source/SetGet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ namespace Langulus::SIMD
template<auto DEF, Offset CHUNK, CT::Vector FROM, Offset...INDICES>
LANGULUS(INLINED)
auto Set(ExpandedSequence<INDICES...>, const FROM& values) {
using T = Decay<TypeOf<FROM>>;
(void)values;

#if LANGULUS_SIMD(128BIT)
if constexpr (CHUNK == 16) {
using T = Decay<TypeOf<FROM>>;
LANGULUS_SIMD_VERBOSE("Setting 128bit register from ", CountOf<FROM>, " elements");
if constexpr (CT::Integer8<T>) return V128<T> {simde_mm_setr_epi8 (Get<int8_t, DEF, INDICES, 16>(values)...)};
else if constexpr (CT::Integer16<T>) return V128<T> {simde_mm_setr_epi16(Get<int16_t, DEF, INDICES, 8>(values)...)};
Expand All @@ -81,6 +81,7 @@ namespace Langulus::SIMD

#if LANGULUS_SIMD(256BIT)
if constexpr (CHUNK == 32) {
using T = Decay<TypeOf<FROM>>;
LANGULUS_SIMD_VERBOSE("Setting 256bit register from ", CountOf<FROM>, " elements");
if constexpr (CT::Integer8<T>) return V256<T> {simde_mm256_setr_epi8 (Get<int8_t, DEF, INDICES, 32>(values)...)};
else if constexpr (CT::Integer16<T>) return V256<T> {simde_mm256_setr_epi16(Get<int16_t, DEF, INDICES, 16>(values)...)};
Expand All @@ -105,6 +106,7 @@ namespace Langulus::SIMD

#if LANGULUS_SIMD(512BIT)
if constexpr (CHUNK == 64) {
using T = Decay<TypeOf<FROM>>;
LANGULUS_SIMD_VERBOSE("Setting 512bit register from ", CountOf<FROM>, " elements");
if constexpr (CT::Integer8<T>) return V512<T> {simde_mm512_setr_epi8 (Get<int8_t, DEF, INDICES, 64>(values)...)};
else if constexpr (CT::Integer16<T>) return V512<T> {simde_mm512_setr_epi16(Get<int16_t, DEF, INDICES, 32>(values)...)};
Expand Down
3 changes: 2 additions & 1 deletion test/TestPack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@


TEMPLATE_TEST_CASE("Pack 64 bits", "[pack]", ::std::int64_t, ::std::uint64_t) {
using T = TestType;

#if LANGULUS_SIMD(128BIT)
GIVEN("A 128bit sequence of numbers") {
using T = TestType;
const T n[2] {4, 8};
const auto r = SIMD::Load<0>(n);

Expand Down Expand Up @@ -77,6 +77,7 @@ TEMPLATE_TEST_CASE("Pack 64 bits", "[pack]", ::std::int64_t, ::std::uint64_t) {

#if LANGULUS_SIMD(256BIT)
GIVEN("A 256bit sequence of numbers") {
using T = TestType;
const T n[4] {4, 8, 12, 16};
const auto r = SIMD::Load<0>(n);

Expand Down
3 changes: 2 additions & 1 deletion test/TestUnpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@


TEMPLATE_TEST_CASE("Unpack 8 bits", "[unpack]", ::std::int8_t, ::std::uint8_t) {
using T = TestType;

#if LANGULUS_SIMD(128BIT)
GIVEN("A 128bit sequence of numbers") {
using T = TestType;
const T n[16] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
const auto r = SIMD::Load<0>(n);

Expand Down Expand Up @@ -134,6 +134,7 @@ TEMPLATE_TEST_CASE("Unpack 8 bits", "[unpack]", ::std::int8_t, ::std::uint8_t) {

#if LANGULUS_SIMD(256BIT)
GIVEN("A 256bit sequence of numbers") {
using T = TestType;
const T n[32] {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
Expand Down

0 comments on commit dc3eaa4

Please sign in to comment.