-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEON: part 1 of implement all intrinsics supported by architecture A64 (
#1090) Add 368 initial implementations and corresponding test cases in 88 families which are listed below: - `abd`, `abdl_high`, `add`, `addhn_high`, `bsl`, `ceq`, `ceqz`, `cgez`, `cgtz`, `cle`, - `cltz`, `cmla`, `cmla_rot180`, `cmla_rot270`, `cmla_rot90`, `cnt`, `copy_lane`, `cvt`, `cvt_n`, `cvtm`, - `cvtp`, `dot`, `dot_lane`, `dup_n`, `eor`, `fms_n`, `ld1`, `ld3`, `ld4`, `maxnm`, - `maxv`, `minnm`, `minv`, `mull`, `mull_high`, `mvn`, `pmin`, `qrdmulh_lane`, `qrshl`, `qrshrn_high_n`, - `qrshrun_high_n`, `qshl_n`, `qshlu_n`, `qshrn_high_n`, `qshrn_n`, `qshrun_n`, `qtbl`, `qtbx`, `raddhn`, `raddhn_high`, - `rbit`, `reinterpret`, `rev16`, `rev32`, `rev64`, `rnd`, `rndi`, `rndm`, `rndp`, `rshrn_high_n`, - `rsubhn`, `rsubhn_high`, `shr_n`, `shrn_n`, `sli_n`, `sri_n`, `st1`, `st1_lane`, `st1_x2`, `st1_x3`, - `st1_x4`, `st1q_x2`, `st1q_x3`, `st1q_x4`, `st2_lane`, `st3`, `st3_lane`, `st4`, `st4_lane`, `tbl`, - `tbx`, `trn`, `trn1`, `trn2`, `tst`, `uzp`, `uzp1`, `uzp2`
- Loading branch information
Showing
100 changed files
with
34,035 additions
and
1,929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
* | ||
* Copyright: | ||
* 2020 Evan Nemerson <[email protected]> | ||
* 2023 Yi-Yen Chung <[email protected]> (Copyright owned by Andes Technology) | ||
*/ | ||
|
||
#if !defined(SIMDE_ARM_NEON_ABD_H) | ||
|
@@ -37,6 +38,23 @@ HEDLEY_DIAGNOSTIC_PUSH | |
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS | ||
SIMDE_BEGIN_DECLS_ | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float16_t | ||
simde_vabdh_f16(simde_float16_t a, simde_float16_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16) | ||
return vabdh_f16(a, b); | ||
#else | ||
simde_float32_t a_ = simde_float16_to_float32(a); | ||
simde_float32_t b_ = simde_float16_to_float32(b); | ||
simde_float32_t r_ = a_ - b_; | ||
return r_ < 0 ? simde_float16_from_float32(-r_) : simde_float16_from_float32(r_); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdh_f16 | ||
#define vabdh_f16(a, b) simde_vabdh_f16((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float32_t | ||
simde_vabds_f32(simde_float32_t a, simde_float32_t b) { | ||
|
@@ -67,6 +85,20 @@ simde_vabdd_f64(simde_float64_t a, simde_float64_t b) { | |
#define vabdd_f64(a, b) simde_vabdd_f64((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float16x4_t | ||
simde_vabd_f16(simde_float16x4_t a, simde_float16x4_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16) | ||
return vabd_f16(a, b); | ||
#else | ||
return simde_vabs_f16(simde_vsub_f16(a, b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabd_f16 | ||
#define vabd_f16(a, b) simde_vabd_f16((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float32x2_t | ||
simde_vabd_f32(simde_float32x2_t a, simde_float32x2_t b) { | ||
|
@@ -220,6 +252,20 @@ simde_vabd_u32(simde_uint32x2_t a, simde_uint32x2_t b) { | |
#define vabd_u32(a, b) simde_vabd_u32((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float16x8_t | ||
simde_vabdq_f16(simde_float16x8_t a, simde_float16x8_t b) { | ||
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16) | ||
return vabdq_f16(a, b); | ||
#else | ||
return simde_vabsq_f16(simde_vsubq_f16(a, b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdq_f16 | ||
#define vabdq_f16(a, b) simde_vabdq_f16((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_float32x4_t | ||
simde_vabdq_f32(simde_float32x4_t a, simde_float32x4_t b) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* SPDX-License-Identifier: MIT | ||
* | ||
* 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: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
* Copyright: | ||
* 2023 Yi-Yen Chung <[email protected]> (Copyright owned by Andes Technology) | ||
*/ | ||
|
||
#if !defined(SIMDE_ARM_NEON_ABDL_HIGH_H) | ||
#define SIMDE_ARM_NEON_ABDL_HIGH_H | ||
|
||
#include "abdl.h" | ||
|
||
HEDLEY_DIAGNOSTIC_PUSH | ||
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS | ||
SIMDE_BEGIN_DECLS_ | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_int16x8_t | ||
simde_vabdl_high_s8(simde_int8x16_t a, simde_int8x16_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_s8(a, b); | ||
#else | ||
return simde_vabdl_s8(simde_vget_high_s8(a), simde_vget_high_s8(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_s8 | ||
#define vabdl_high_s8(a, b) simde_vabdl_high_s8((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_int32x4_t | ||
simde_vabdl_high_s16(simde_int16x8_t a, simde_int16x8_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_s16(a, b); | ||
#else | ||
return simde_vabdl_s16(simde_vget_high_s16(a), simde_vget_high_s16(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_s16 | ||
#define vabdl_high_s16(a, b) simde_vabdl_high_s16((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_int64x2_t | ||
simde_vabdl_high_s32(simde_int32x4_t a, simde_int32x4_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_s32(a, b); | ||
#else | ||
return simde_vabdl_s32(simde_vget_high_s32(a), simde_vget_high_s32(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_s32 | ||
#define vabdl_high_s32(a, b) simde_vabdl_high_s32((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_uint16x8_t | ||
simde_vabdl_high_u8(simde_uint8x16_t a, simde_uint8x16_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_u8(a, b); | ||
#else | ||
return simde_vabdl_u8(simde_vget_high_u8(a), simde_vget_high_u8(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_u8 | ||
#define vabdl_high_u8(a, b) simde_vabdl_high_u8((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_uint32x4_t | ||
simde_vabdl_high_u16(simde_uint16x8_t a, simde_uint16x8_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_u16(a, b); | ||
#else | ||
return simde_vabdl_u16(simde_vget_high_u16(a), simde_vget_high_u16(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_u16 | ||
#define vabdl_high_u16(a, b) simde_vabdl_high_u16((a), (b)) | ||
#endif | ||
|
||
SIMDE_FUNCTION_ATTRIBUTES | ||
simde_uint64x2_t | ||
simde_vabdl_high_u32(simde_uint32x4_t a, simde_uint32x4_t b) { | ||
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) | ||
return vabdl_high_u32(a, b); | ||
#else | ||
return simde_vabdl_u32(simde_vget_high_u32(a), simde_vget_high_u32(b)); | ||
#endif | ||
} | ||
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) | ||
#undef vabdl_high_u32 | ||
#define vabdl_high_u32(a, b) simde_vabdl_high_u32((a), (b)) | ||
#endif | ||
|
||
SIMDE_END_DECLS_ | ||
HEDLEY_DIAGNOSTIC_POP | ||
|
||
#endif /* !defined(SIMDE_ARM_NEON_ABDL_HIGH_H) */ |
Oops, something went wrong.