aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@google.com>2019-08-29 22:18:57 -0700
committerMarat Dukhan <maratek@google.com>2019-08-29 22:20:18 -0700
commit4822bd4a8a57612c1001833e94b7e2315840f1e1 (patch)
tree4e0460605f8d618ad8a9ec06edefb7ad28aa68d3
parent40183e6a622e609c3b0ae8810d9873bd9fbac57c (diff)
downloadpsimd-4822bd4a8a57612c1001833e94b7e2315840f1e1.tar.gz
psimd_load_splat_* functions
New psimd_load_splat_[u8/s8/u16/s16/u32/s32/f32] functions load a single value and duplicate it to all lanes
-rw-r--r--include/psimd.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/psimd.h b/include/psimd.h
index 3332192..cc2d391 100644
--- a/include/psimd.h
+++ b/include/psimd.h
@@ -295,6 +295,34 @@
return *((const psimd_f32*) address);
}
+ PSIMD_INTRINSIC psimd_s8 psimd_load_splat_s8(const void* address) {
+ return psimd_splat_s8(*((const int8_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_u8 psimd_load_splat_u8(const void* address) {
+ return psimd_splat_u8(*((const uint8_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_s16 psimd_load_splat_s16(const void* address) {
+ return psimd_splat_s16(*((const int16_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_u16 psimd_load_splat_u16(const void* address) {
+ return psimd_splat_u16(*((const uint16_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_s32 psimd_load_splat_s32(const void* address) {
+ return psimd_splat_s32(*((const int32_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_u32 psimd_load_splat_u32(const void* address) {
+ return psimd_splat_u32(*((const uint32_t*) address));
+ }
+
+ PSIMD_INTRINSIC psimd_f32 psimd_load_splat_f32(const void* address) {
+ return psimd_splat_f32(*((const float*) address));
+ }
+
PSIMD_INTRINSIC psimd_f32 psimd_load1_f32(const void* address) {
return (psimd_f32) { *((const float*) address), 0.0f, 0.0f, 0.0f };
}