Skip to content

Commit 2f97bd0

Browse files
WIP
1 parent 1705db1 commit 2f97bd0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/xsimd/arch/xsimd_altivec.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <complex>
1616
#include <limits>
1717
#include <type_traits>
18+
#include <endian.h>
1819

1920
#include "../types/xsimd_altivec_register.hpp"
2021

@@ -864,7 +865,11 @@ namespace xsimd
864865
}
865866
else
866867
{
868+
#if BYTE_ORDER == LITTLE_ENDIAN
867869
auto slider = vec_splats((uint8_t)(8 * N));
870+
#else
871+
auto slider = vec_splats((uint8_t)(8 * (16 - N)));
872+
#endif
868873
return (typename batch<T, A>::register_type)vec_slo(x.data, slider);
869874
}
870875
}
@@ -879,7 +884,11 @@ namespace xsimd
879884
}
880885
else
881886
{
887+
#if BYTE_ORDER == LITTLE_ENDIAN
882888
auto slider = vec_splats((uint8_t)(8 * N));
889+
#else
890+
auto slider = vec_splats((uint8_t)(8 * (16 - N)));
891+
#endif
883892
return (typename batch<T, A>::register_type)vec_sro((__vector unsigned char)x.data, slider);
884893
}
885894
}

0 commit comments

Comments
 (0)