diff options
author | Marat Dukhan <maratek@google.com> | 2019-08-29 22:16:24 -0700 |
---|---|---|
committer | Marat Dukhan <maratek@google.com> | 2019-08-29 22:16:24 -0700 |
commit | 40183e6a622e609c3b0ae8810d9873bd9fbac57c (patch) | |
tree | 81480555fbd5c155539187dfbc3fd13450c6bbbc | |
parent | 90a938f30ba414ada2f4b00674ee9631d7d85e19 (diff) | |
download | psimd-40183e6a622e609c3b0ae8810d9873bd9fbac57c.tar.gz |
psimd_storeN_s32 and psimd_storeN_u32 functions
-rw-r--r-- | LICENSE | 1 | ||||
-rw-r--r-- | include/psimd.h | 42 |
2 files changed, 43 insertions, 0 deletions
@@ -2,6 +2,7 @@ The MIT License (MIT) Copyright (c) 2017 Facebook Inc. Copyright (c) 2014-2017 Georgia Institute of Technology +Copyright 2019 Google LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/include/psimd.h b/include/psimd.h index b8aede6..3332192 100644 --- a/include/psimd.h +++ b/include/psimd.h @@ -403,16 +403,50 @@ *((psimd_f32*) address) = value; } + PSIMD_INTRINSIC void psimd_store1_s32(void* address, psimd_s32 value) { + *((int32_t*) address) = value[0]; + } + + PSIMD_INTRINSIC void psimd_store1_u32(void* address, psimd_u32 value) { + *((uint32_t*) address) = value[0]; + } + PSIMD_INTRINSIC void psimd_store1_f32(void* address, psimd_f32 value) { *((float*) address) = value[0]; } + PSIMD_INTRINSIC void psimd_store2_s32(void* address, psimd_s32 value) { + int32_t* address_s32 = (int32_t*) address; + address_s32[0] = value[0]; + address_s32[1] = value[1]; + } + + PSIMD_INTRINSIC void psimd_store2_u32(void* address, psimd_u32 value) { + uint32_t* address_u32 = (uint32_t*) address; + address_u32[0] = value[0]; + address_u32[1] = value[1]; + } + PSIMD_INTRINSIC void psimd_store2_f32(void* address, psimd_f32 value) { float* address_f32 = (float*) address; address_f32[0] = value[0]; address_f32[1] = value[1]; } + PSIMD_INTRINSIC void psimd_store3_s32(void* address, psimd_s32 value) { + int32_t* address_s32 = (int32_t*) address; + address_s32[0] = value[0]; + address_s32[1] = value[1]; + address_s32[2] = value[2]; + } + + PSIMD_INTRINSIC void psimd_store3_u32(void* address, psimd_u32 value) { + uint32_t* address_u32 = (uint32_t*) address; + address_u32[0] = value[0]; + address_u32[1] = value[1]; + address_u32[2] = value[2]; + } + PSIMD_INTRINSIC void psimd_store3_f32(void* address, psimd_f32 value) { float* address_f32 = (float*) address; address_f32[0] = value[0]; @@ -420,6 +454,14 @@ address_f32[2] = value[2]; } + PSIMD_INTRINSIC void psimd_store4_s32(void* address, psimd_s32 value) { + psimd_store_s32(address, value); + } + + PSIMD_INTRINSIC void psimd_store4_u32(void* address, psimd_u32 value) { + psimd_store_u32(address, value); + } + PSIMD_INTRINSIC void psimd_store4_f32(void* address, psimd_f32 value) { psimd_store_f32(address, value); } |