Commit 2fbc6339 authored by Yi-Yen Chung's avatar Yi-Yen Chung Committed by GitHub

NEON: Implement some f16XN types and f16 related intrinsics. (#1071)

* [NEON] Add vmulq_f16 and vmul_f16.

* [NEON] Add vmulq_f16 and vmul_f16 test.

* [NEON] Add vget_lane_f16 and vgetq_lane_f16.

* [NEON] Add vsubh_f16 and vsub_f16.

* [NEON] Add vextq_f16.

* [NEON] Add vget_low_f16.

* [NEON] Add vmulq_lane_f16.

* [NEON] Add vmul_n_f16.

* [NEON] Add vget_high_f16.

* [NEON] Add vsetq_lane_f16.

* [NEON] Add vcombine_f16.

* [NEON] Add vcvtaq_s32_f32, vcvtas_s32_f32, and vcvta_s32_f32.

* [NEON] Add vpadd_f16.

* [NEON] Add vuzp1_f16.

* [NEON] Add vuzp2_f16.

* [NEON] Add vmaxq_f16 and vmax_f16.

* [NEON] Add vcvtas_u32_f32, vcvta_u32_f32, vcvtaq_u32_f32.

* [NEON] Add type simde_float16x8x2_t.

* [NEON] Add vld2q_f16.

* [NEON] Add vld1q_dup_f16.

* [NEON] Add vpmax_f16.

* [NEON] Add vrsqrtsq_f16, vrsqrtsh_f16, vrsqrts_f16.

* [NEON] Add vcgtq_f16, vcgt_f16, vcgth_f16.

* [NEON] Add vdiv_f32 and vdivq_f32.

* [NEON] Add vrecps_f16 and vrecpsq_f16.

* [NEON] Add vset_lane_f16.

* [NEON] Add vrecpe_f16, vrecpeq_f16.

* [NEON] Add vfmaq_f16.

* [NEON] Add vabsq_f16 and vabs_f16.

* [NEON] Add vcltq_f16 and vclth_f16.

* [NEON] Add vmin_f16 and vminq_f16.

* [NEON] Add vclt_f16.

* [NEON] Add vclezq_f16, vclez_f16, and vclezh_f16.

* [NEON] Add vzip_f16 and vzipq_f16.

* [NEON] Add vzip1_f16 and vzip1q_f16.

* [NEON] Add vzip2_f16 and vzip2q_f16.

* [NEON] Add vst2_f16 and vst2q_f16.

* [NEON] Add type simde_float16x4x2.

* [NEON] Add 16 intrinsics of vreinterpret series.

* [SIMDE] Add sqrtl() in simde_math_sqrtl.

* [NEON] Add vrndnq_f16, vrndns_f16, and vrndn_f16.

* [NEON] Add sqrt in meson.build.

* [NEON] Add 7 sqrt related intrinsics.

* [Fix] Add the judge whether define sqrt() or not.

* [NEON] Add vrsqrteq_f16, vrsqrte_f16, and vrsqrteh_f16.

* [NEON] Add vqrshrnh_n_s16 and vqrshrnh_n_u16.

* [NEON] Add vqrshrunh_n_s16.

* [Fix] Add new conditions for fp16 intrinsics.

* [License] Add Copyright.
parent 64f94c68
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_H) #if !defined(SIMDE_ARM_NEON_H)
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
#include "neon/cvtn.h" #include "neon/cvtn.h"
#include "neon/combine.h" #include "neon/combine.h"
#include "neon/create.h" #include "neon/create.h"
#include "neon/div.h"
#include "neon/dot.h" #include "neon/dot.h"
#include "neon/dot_lane.h" #include "neon/dot_lane.h"
#include "neon/dup_lane.h" #include "neon/dup_lane.h"
...@@ -184,6 +186,7 @@ ...@@ -184,6 +186,7 @@
#include "neon/shr_n.h" #include "neon/shr_n.h"
#include "neon/shrn_n.h" #include "neon/shrn_n.h"
#include "neon/sqadd.h" #include "neon/sqadd.h"
#include "neon/sqrt.h"
#include "neon/sra_n.h" #include "neon/sra_n.h"
#include "neon/sri_n.h" #include "neon/sri_n.h"
#include "neon/st1.h" #include "neon/st1.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_ABS_H) #if !defined(SIMDE_ARM_NEON_ABS_H)
...@@ -47,6 +48,45 @@ simde_vabsd_s64(int64_t a) { ...@@ -47,6 +48,45 @@ simde_vabsd_s64(int64_t a) {
#define vabsd_s64(a) simde_vabsd_s64(a) #define vabsd_s64(a) simde_vabsd_s64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vabsh_f16(simde_float16_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vabsh_f16(a);
#else
simde_float32_t a_ = simde_float16_to_float32(a);
return (a_ >= 0.0f) ? simde_float16_from_float32(a_) : simde_float16_from_float32(-a_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vabsh_f16
#define vabsh_f16(a) simde_vabsh_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vabs_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vabs_f16(a);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vabsh_f16(a_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vabs_f16
#define vabs_f16(a) simde_vabs_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vabs_f32(simde_float32x2_t a) { simde_vabs_f32(simde_float32x2_t a) {
...@@ -211,6 +251,29 @@ simde_vabs_s64(simde_int64x1_t a) { ...@@ -211,6 +251,29 @@ simde_vabs_s64(simde_int64x1_t a) {
#define vabs_s64(a) simde_vabs_s64(a) #define vabs_s64(a) simde_vabs_s64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vabsq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vabsq_f16(a);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vabsh_f16(a_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vabsq_f16
#define vabsq_f16(a) simde_vabsq_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vabsq_f32(simde_float32x4_t a) { simde_vabsq_f32(simde_float32x4_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Christopher Moore <moore@free.fr> * 2020 Christopher Moore <moore@free.fr>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_CGT_H) #if !defined(SIMDE_ARM_NEON_CGT_H)
...@@ -78,6 +79,23 @@ simde_vcgtd_u64(uint64_t a, uint64_t b) { ...@@ -78,6 +79,23 @@ simde_vcgtd_u64(uint64_t a, uint64_t b) {
#define vcgtd_u64(a, b) simde_vcgtd_u64((a), (b)) #define vcgtd_u64(a, b) simde_vcgtd_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
uint16_t
simde_vcgth_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return HEDLEY_STATIC_CAST(uint16_t, vcgth_f16(a, b));
#else
simde_float32_t a_ = simde_float16_to_float32(a);
simde_float32_t b_ = simde_float16_to_float32(b);
return (a_ > b_) ? UINT16_MAX : 0;
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vcgth_f16
#define vcgth_f16(a, b) simde_vcgth_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
uint32_t uint32_t
simde_vcgts_f32(simde_float32_t a, simde_float32_t b) { simde_vcgts_f32(simde_float32_t a, simde_float32_t b) {
...@@ -92,6 +110,30 @@ simde_vcgts_f32(simde_float32_t a, simde_float32_t b) { ...@@ -92,6 +110,30 @@ simde_vcgts_f32(simde_float32_t a, simde_float32_t b) {
#define vcgts_f32(a, b) simde_vcgts_f32((a), (b)) #define vcgts_f32(a, b) simde_vcgts_f32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x8_t
simde_vcgtq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vcgtq_f16(a, b);
#else
simde_float16x8_private
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
simde_uint16x8_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcgth_f16(a_.values[i], b_.values[i]);
}
return simde_uint16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcgtq_f16
#define vcgtq_f16(a, b) simde_vcgtq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t simde_uint32x4_t
simde_vcgtq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vcgtq_f32(simde_float32x4_t a, simde_float32x4_t b) {
...@@ -442,6 +484,30 @@ simde_vcgtq_u64(simde_uint64x2_t a, simde_uint64x2_t b) { ...@@ -442,6 +484,30 @@ simde_vcgtq_u64(simde_uint64x2_t a, simde_uint64x2_t b) {
#define vcgtq_u64(a, b) simde_vcgtq_u64((a), (b)) #define vcgtq_u64(a, b) simde_vcgtq_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x4_t
simde_vcgt_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vcgt_f16(a, b);
#else
simde_float16x4_private
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
simde_uint16x4_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcgth_f16(a_.values[i], b_.values[i]);
}
return simde_uint16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcgt_f16
#define vcgt_f16(a, b) simde_vcgt_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t simde_uint32x2_t
simde_vcgt_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vcgt_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Christopher Moore <moore@free.fr> * 2020 Christopher Moore <moore@free.fr>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_CLEZ_H) #if !defined(SIMDE_ARM_NEON_CLEZ_H)
...@@ -78,6 +79,44 @@ simde_vclezs_f32(simde_float32_t a) { ...@@ -78,6 +79,44 @@ simde_vclezs_f32(simde_float32_t a) {
#define vclezs_f32(a) simde_vclezs_f32(a) #define vclezs_f32(a) simde_vclezs_f32(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
uint16_t
simde_vclezh_f16(simde_float16_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return HEDLEY_STATIC_CAST(uint16_t, vclezh_f16(a));
#else
simde_float32_t a_ = simde_float16_to_float32(a);
return (a_ <= 0.0f) ? UINT16_MAX : 0;
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vclezh_f16
#define vclezh_f16(a) simde_vclezh_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x8_t
simde_vclezq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vclezq_f16(a);
#else
simde_float16x8_private a_ = simde_float16x8_to_private(a);
simde_uint16x8_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vclezh_f16(a_.values[i]);
}
return simde_uint16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vclezq_f16
#define vclezq_f16(a) simde_vclezq_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t simde_uint32x4_t
simde_vclezq_f32(simde_float32x4_t a) { simde_vclezq_f32(simde_float32x4_t a) {
...@@ -246,6 +285,28 @@ simde_vclezq_s64(simde_int64x2_t a) { ...@@ -246,6 +285,28 @@ simde_vclezq_s64(simde_int64x2_t a) {
#define vclezq_s64(a) simde_vclezq_s64(a) #define vclezq_s64(a) simde_vclezq_s64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x4_t
simde_vclez_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vclez_f16(a);
#else
simde_float16x4_private a_ = simde_float16x4_to_private(a);
simde_uint16x4_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vclezh_f16(a_.values[i]);
}
return simde_uint16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vclez_f16
#define vclez_f16(a) simde_vclez_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t simde_uint32x2_t
simde_vclez_f32(simde_float32x2_t a) { simde_vclez_f32(simde_float32x2_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Christopher Moore <moore@free.fr> * 2020 Christopher Moore <moore@free.fr>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_CLT_H) #if !defined(SIMDE_ARM_NEON_CLT_H)
...@@ -77,6 +78,23 @@ simde_vcltd_u64(uint64_t a, uint64_t b) { ...@@ -77,6 +78,23 @@ simde_vcltd_u64(uint64_t a, uint64_t b) {
#define vcltd_u64(a, b) simde_vcltd_u64((a), (b)) #define vcltd_u64(a, b) simde_vcltd_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
uint16_t
simde_vclth_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return HEDLEY_STATIC_CAST(uint16_t, vclth_f16(a, b));
#else
simde_float32_t a_ = simde_float16_to_float32(a);
simde_float32_t b_ = simde_float16_to_float32(b);
return (a_ < b_) ? UINT16_MAX : 0;
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vclth_f16
#define vclth_f16(a, b) simde_vclth_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
uint32_t uint32_t
simde_vclts_f32(simde_float32_t a, simde_float32_t b) { simde_vclts_f32(simde_float32_t a, simde_float32_t b) {
...@@ -91,6 +109,30 @@ simde_vclts_f32(simde_float32_t a, simde_float32_t b) { ...@@ -91,6 +109,30 @@ simde_vclts_f32(simde_float32_t a, simde_float32_t b) {
#define vclts_f32(a, b) simde_vclts_f32((a), (b)) #define vclts_f32(a, b) simde_vclts_f32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x8_t
simde_vcltq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vcltq_f16(a, b);
#else
simde_float16x8_private
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
simde_uint16x8_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vclth_f16(a_.values[i], b_.values[i]);
}
return simde_uint16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcltq_f16
#define vcltq_f16(a, b) simde_vcltq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t simde_uint32x4_t
simde_vcltq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vcltq_f32(simde_float32x4_t a, simde_float32x4_t b) {
...@@ -450,6 +492,30 @@ simde_vcltq_u64(simde_uint64x2_t a, simde_uint64x2_t b) { ...@@ -450,6 +492,30 @@ simde_vcltq_u64(simde_uint64x2_t a, simde_uint64x2_t b) {
#define vcltq_u64(a, b) simde_vcltq_u64((a), (b)) #define vcltq_u64(a, b) simde_vcltq_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint16x4_t
simde_vclt_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vclt_f16(a, b);
#else
simde_float16x4_private
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
simde_uint16x4_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vclth_f16(a_.values[i], b_.values[i]);
}
return simde_uint16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vclt_f16
#define vclt_f16(a, b) simde_vclt_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t simde_uint32x2_t
simde_vclt_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vclt_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_COMBINE_H) #if !defined(SIMDE_ARM_NEON_COMBINE_H)
...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vcombine_f16(simde_float16x4_t low, simde_float16x4_t high) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vcombine_f16(low, high);
#else
simde_float16x8_private r_;
simde_float16x4_private
low_ = simde_float16x4_to_private(low),
high_ = simde_float16x4_to_private(high);
size_t halfway = (sizeof(r_.values) / sizeof(r_.values[0])) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway ; i++) {
r_.values[i] = low_.values[i];
r_.values[i + halfway] = high_.values[i];
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vcombine_f16
#define vcombine_f16(low, high) simde_vcombine_f16((low), (high))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vcombine_f32(simde_float32x2_t low, simde_float32x2_t high) { simde_vcombine_f32(simde_float32x2_t low, simde_float32x2_t high) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Sean Maher <seanptmaher@gmail.com> * 2020 Sean Maher <seanptmaher@gmail.com>
* 2020-2021 Evan Nemerson <evan@nemerson.com> * 2020-2021 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_CVT_H) #if !defined(SIMDE_ARM_NEON_CVT_H)
...@@ -486,7 +487,6 @@ simde_vcvt_u64_f64(simde_float64x1_t a) { ...@@ -486,7 +487,6 @@ simde_vcvt_u64_f64(simde_float64x1_t a) {
#define vcvt_u64_f64(a) simde_vcvt_u64_f64(a) #define vcvt_u64_f64(a) simde_vcvt_u64_f64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_int16x8_t simde_int16x8_t
simde_vcvtq_s16_f16(simde_float16x8_t a) { simde_vcvtq_s16_f16(simde_float16x8_t a) {
...@@ -1169,6 +1169,135 @@ simde_vcvtq_f64_u64(simde_uint64x2_t a) { ...@@ -1169,6 +1169,135 @@ simde_vcvtq_f64_u64(simde_uint64x2_t a) {
#define vcvtq_f64_u64(a) simde_vcvtq_f64_u64(a) #define vcvtq_f64_u64(a) simde_vcvtq_f64_u64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
int32_t
simde_vcvtas_s32_f32(simde_float32 a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vcvtas_s32_f32(a);
#else
if (HEDLEY_UNLIKELY(a < HEDLEY_STATIC_CAST(simde_float32, INT32_MIN))) {
return INT32_MIN;
} else if (HEDLEY_UNLIKELY(a > HEDLEY_STATIC_CAST(simde_float32, INT32_MAX))) {
return INT32_MAX;
} else if (HEDLEY_UNLIKELY(simde_math_isnanf(a))) {
return 0;
} else {
// Round to Nearest with Ties to Away (a.k.a Rounding away from zero) rounding mode.
// For example, 23.2 gets rounded to 24, and −23.2 gets rounded to −24.
return HEDLEY_STATIC_CAST(int32_t, simde_math_roundf(a));
}
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vcvtas_s32_f32
#define vcvtas_s32_f32(a) simde_vcvtas_s32_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde_vcvtas_u32_f32(simde_float32 a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vcvtas_u32_f32(a);
#else
if (HEDLEY_UNLIKELY(a > HEDLEY_STATIC_CAST(simde_float32, UINT32_MAX))) {
return UINT32_MAX;
} else if (HEDLEY_UNLIKELY(simde_math_isnanf(a))) {
return 0;
} else {
// Round to Nearest with Ties to Away (a.k.a Rounding away from zero) rounding mode.
// For example, 23.2 gets rounded to 24, and −23.2 gets rounded to −24.
if(a < 0) return 0;
return HEDLEY_STATIC_CAST(uint32_t, simde_math_roundf(a));
}
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vcvtas_u32_f32
#define vcvtas_u32_f32(a) simde_vcvtas_u32_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x2_t
simde_vcvta_s32_f32(simde_float32x2_t a) {
simde_float32x2_private a_ = simde_float32x2_to_private(a);
simde_int32x2_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcvtas_s32_f32(a_.values[i]);
}
return simde_int32x2_from_private(r_);
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcvta_s32_f32
#define vcvta_s32_f32(a) simde_vcvta_s32_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_int32x4_t
simde_vcvtaq_s32_f32(simde_float32x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE)
return vcvtaq_s32_f32(a);
#else
simde_float32x4_private a_ = simde_float32x4_to_private(a);
simde_int32x4_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcvtas_s32_f32(a_.values[i]);
}
return simde_int32x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcvtaq_s32_f32
#define vcvtaq_s32_f32(a) simde_vcvtaq_s32_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t
simde_vcvta_u32_f32(simde_float32x2_t a) {
simde_float32x2_private a_ = simde_float32x2_to_private(a);
simde_uint32x2_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcvtas_u32_f32(a_.values[i]);
}
return simde_uint32x2_from_private(r_);
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcvta_u32_f32
#define vcvta_u32_f32(a) simde_vcvta_u32_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x4_t
simde_vcvtaq_u32_f32(simde_float32x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE)
return vcvtaq_u32_f32(a);
#else
simde_float32x4_private a_ = simde_float32x4_to_private(a);
simde_uint32x4_private r_;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vcvtas_u32_f32(a_.values[i]);
}
return simde_uint32x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vcvtaq_u32_f32
#define vcvtaq_u32_f32(a) simde_vcvtaq_u32_f32(a)
#endif
SIMDE_END_DECLS_ SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP HEDLEY_DIAGNOSTIC_POP
......
/* 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 <eric681@andestech.com> (Copyright owned by Andes Technology)
*/
#if !defined(SIMDE_ARM_NEON_DIV_H)
#define SIMDE_ARM_NEON_DIV_H
#include "types.h"
#include "reinterpret.h"
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t
simde_vdiv_f32(simde_float32x2_t a, simde_float32x2_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vdiv_f32(a, b);
#else
simde_float32x2_private
r_,
a_ = simde_float32x2_to_private(a),
b_ = simde_float32x2_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = a_.values[i] / b_.values[i];
}
return simde_float32x2_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdiv_f32
#define vdiv_f32(a, b) simde_vdiv_f32((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t
simde_vdivq_f32(simde_float32x4_t a, simde_float32x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vdivq_f32(a, b);
#else
simde_float32x4_private
r_,
a_ = simde_float32x4_to_private(a),
b_ = simde_float32x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = a_.values[i] / b_.values[i];
}
return simde_float32x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vdivq_f32
#define vdivq_f32(a, b) simde_vdivq_f32((a), (b))
#endif
SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP
#endif /* !defined(SIMDE_ARM_NEON_MUL_H) */
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_EXT_H) #if !defined(SIMDE_ARM_NEON_EXT_H)
...@@ -398,6 +399,32 @@ simde_vext_u64(simde_uint64x1_t a, simde_uint64x1_t b, const int n) ...@@ -398,6 +399,32 @@ simde_vext_u64(simde_uint64x1_t a, simde_uint64x1_t b, const int n)
#define vext_u64(a, b, n) simde_vext_u64((a), (b), (n)) #define vext_u64(a, b, n) simde_vext_u64((a), (b), (n))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vextq_f16(simde_float16x8_t a, simde_float16x8_t b, const int n)
SIMDE_REQUIRE_CONSTANT_RANGE(n, 0, 7) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
simde_float16x8_t r;
SIMDE_CONSTIFY_8_(vextq_f16, r, (HEDLEY_UNREACHABLE(), a), n, a, b);
return r;
#else
simde_float16x8_private
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b),
r_ = a_;
const size_t n_ = HEDLEY_STATIC_CAST(size_t, n);
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
size_t src = i + n_;
r_.values[i] = (src < (sizeof(r_.values) / sizeof(r_.values[0]))) ? a_.values[src] : b_.values[src & 7];
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vextq_f16
#define vextq_f16(a, b, n) simde_vextq_f16((a), (b), (n))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vextq_f32(simde_float32x4_t a, simde_float32x4_t b, const int n) simde_vextq_f32(simde_float32x4_t a, simde_float32x4_t b, const int n)
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2021 Atharva Nimbalkar <atharvakn@gmail.com> * 2021 Atharva Nimbalkar <atharvakn@gmail.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_FMA_H) #if !defined(SIMDE_ARM_NEON_FMA_H)
...@@ -62,6 +63,20 @@ simde_vfma_f64(simde_float64x1_t a, simde_float64x1_t b, simde_float64x1_t c) { ...@@ -62,6 +63,20 @@ simde_vfma_f64(simde_float64x1_t a, simde_float64x1_t b, simde_float64x1_t c) {
#define vfma_f64(a, b, c) simde_vfma_f64(a, b, c) #define vfma_f64(a, b, c) simde_vfma_f64(a, b, c)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vfmaq_f16(simde_float16x8_t a, simde_float16x8_t b, simde_float16x8_t c) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA) && defined(SIMDE_ARM_NEON_FP16)
return vfmaq_f16(a, b, c);
#else
return simde_vaddq_f16(a, simde_vmulq_f16(b, c));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vfmaq_f16
#define vfmaq_f16(a, b, c) simde_vfmaq_f16(a, b, c)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vfmaq_f32(simde_float32x4_t a, simde_float32x4_t b, simde_float32x4_t c) { simde_vfmaq_f32(simde_float32x4_t a, simde_float32x4_t b, simde_float32x4_t c) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_GET_HIGH_H) #if !defined(SIMDE_ARM_NEON_GET_HIGH_H)
...@@ -34,6 +35,28 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,28 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vget_high_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vget_high_f16(a);
#else
simde_float16x4_private r_;
simde_float16x8_private a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = a_.values[i + (sizeof(r_.values) / sizeof(r_.values[0]))];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vget_high_f16
#define vget_high_f16(a) simde_vget_high_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vget_high_f32(simde_float32x4_t a) { simde_vget_high_f32(simde_float32x4_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_GET_LANE_H) #if !defined(SIMDE_ARM_NEON_GET_LANE_H)
...@@ -34,6 +35,27 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,27 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vget_lane_f16(simde_float16x4_t v, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
simde_float16_t r;
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
SIMDE_CONSTIFY_4_(vget_lane_f16, r, (HEDLEY_UNREACHABLE(), SIMDE_FLOAT16_VALUE(0.0)), lane, v);
#else
simde_float16x4_private v_ = simde_float16x4_to_private(v);
r = v_.values[lane];
#endif
return r;
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vget_lane_f16
#define vget_lane_f16(v, lane) simde_vget_lane_f16((v), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vget_lane_f32(simde_float32x2_t v, const int lane) simde_vget_lane_f32(simde_float32x2_t v, const int lane)
...@@ -247,6 +269,27 @@ simde_vget_lane_u64(simde_uint64x1_t v, const int lane) ...@@ -247,6 +269,27 @@ simde_vget_lane_u64(simde_uint64x1_t v, const int lane)
#define vget_lane_u64(v, lane) simde_vget_lane_u64((v), (lane)) #define vget_lane_u64(v, lane) simde_vget_lane_u64((v), (lane))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vgetq_lane_f16(simde_float16x8_t v, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
simde_float16_t r;
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
SIMDE_CONSTIFY_8_(vget_lane_f16, r, (HEDLEY_UNREACHABLE(), SIMDE_FLOAT16_VALUE(0.0)), lane, v);
#else
simde_float16x8_private v_ = simde_float16x8_to_private(v);
r = v_.values[lane];
#endif
return r;
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vgetq_lane_f16
#define vgetq_lane_f16(v, lane) simde_vgetq_lane_f16((v), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vgetq_lane_f32(simde_float32x4_t v, const int lane) simde_vgetq_lane_f32(simde_float32x4_t v, const int lane)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_GET_LOW_H) #if !defined(SIMDE_ARM_NEON_GET_LOW_H)
...@@ -34,6 +35,28 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,28 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vget_low_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vget_low_f16(a);
#else
simde_float16x4_private r_;
simde_float16x8_private a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = a_.values[i];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vget_low_f16
#define vget_low_f16(a) simde_vget_low_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vget_low_f32(simde_float32x4_t a) { simde_vget_low_f32(simde_float32x4_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2021 Evan Nemerson <evan@nemerson.com> * 2021 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_LD1_DUP_H) #if !defined(SIMDE_ARM_NEON_LD1_DUP_H)
...@@ -177,6 +178,20 @@ simde_vld1_dup_u64(uint64_t const * ptr) { ...@@ -177,6 +178,20 @@ simde_vld1_dup_u64(uint64_t const * ptr) {
#define vld1_dup_u64(a) simde_vld1_dup_u64((a)) #define vld1_dup_u64(a) simde_vld1_dup_u64((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vld1q_dup_f16(simde_float16 const * ptr) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vld1q_dup_f16(ptr);
#else
return simde_vdupq_n_f16(*ptr);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vld1q_dup_f16
#define vld1q_dup_f16(a) simde_vld1q_dup_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vld1q_dup_f32(simde_float32 const * ptr) { simde_vld1q_dup_f32(simde_float32 const * ptr) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_LD2_H) #if !defined(SIMDE_ARM_NEON_LD2_H)
...@@ -673,6 +674,40 @@ simde_vld2q_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(4)]) { ...@@ -673,6 +674,40 @@ simde_vld2q_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(4)]) {
#define vld2q_u64(a) simde_vld2q_u64((a)) #define vld2q_u64(a) simde_vld2q_u64((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8x2_t
simde_vld2q_f16(simde_float16_t const ptr[HEDLEY_ARRAY_PARAM(16)]) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vld2q_f16(ptr);
#else
#if defined(SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_) && HEDLEY_GCC_VERSION_CHECK(12,0,0)
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_
#endif
simde_float16x8_private r_[2];
for (size_t i = 0 ; i < (sizeof(r_) / sizeof(r_[0])); i++) {
for (size_t j = 0 ; j < (sizeof(r_[0].values) / sizeof(r_[0].values[0])) ; j++) {
r_[i].values[j] = ptr[i + (j * (sizeof(r_) / sizeof(r_[0])))];
}
}
#if defined(SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_) && HEDLEY_GCC_VERSION_CHECK(12,0,0)
HEDLEY_DIAGNOSTIC_POP
#endif
simde_float16x8x2_t r = { {
simde_float16x8_from_private(r_[0]),
simde_float16x8_from_private(r_[1]),
} };
return r;
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vld2q_f16
#define vld2q_f16(a) simde_vld2q_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4x2_t simde_float32x4x2_t
simde_vld2q_f32(simde_float32_t const ptr[HEDLEY_ARRAY_PARAM(8)]) { simde_vld2q_f32(simde_float32_t const ptr[HEDLEY_ARRAY_PARAM(8)]) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_MAX_H) #if !defined(SIMDE_ARM_NEON_MAX_H)
...@@ -36,6 +37,52 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -36,6 +37,52 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vmaxh_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmaxh_f16(a, b);
#else
simde_float32_t r_;
simde_float32_t a_ = simde_float16_to_float32(a);
simde_float32_t b_ = simde_float16_to_float32(b);
#if !defined(SIMDE_FAST_NANS)
r_ = (a_ >= b_) ? a_ : ((a_ < b_) ? b_ : SIMDE_MATH_NANF);
#else
r_ = (a_ > b_) ? a_ : b_;
#endif
return simde_float16_from_float32(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmaxh_f16
#define vmaxh_f16(a, b) simde_vmaxh_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vmax_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmax_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vmaxh_f16(a_.values[i], b_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmax_f16
#define vmax_f16(a, b) simde_vmax_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vmax_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vmax_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -293,6 +340,30 @@ simde_x_vmax_u64(simde_uint64x1_t a, simde_uint64x1_t b) { ...@@ -293,6 +340,30 @@ simde_x_vmax_u64(simde_uint64x1_t a, simde_uint64x1_t b) {
#endif #endif
} }
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vmaxq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmaxq_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vmaxh_f16(a_.values[i], b_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmaxq_f16
#define vmaxq_f16(a, b) simde_vmaxq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vmaxq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vmaxq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_MIN_H) #if !defined(SIMDE_ARM_NEON_MIN_H)
...@@ -36,6 +37,52 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -36,6 +37,52 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vminh_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vminh_f16(a, b);
#else
simde_float32_t r_;
simde_float32_t a_ = simde_float16_to_float32(a);
simde_float32_t b_ = simde_float16_to_float32(b);
#if !defined(SIMDE_FAST_NANS)
r_ = (a_ <= b_) ? a_ : ((a_ > b_) ? b_ : SIMDE_MATH_NANF);
#else
r_ = (a_ < b_) ? a_ : b_;
#endif
return simde_float16_from_float32(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vminh_f16
#define vminh_f16(a, b) simde_vminh_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vmin_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmin_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vminh_f16(a_.values[i], b_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmin_f16
#define vmin_f16(a, b) simde_vmin_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vmin_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vmin_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -321,6 +368,30 @@ simde_x_vmin_u64(simde_uint64x1_t a, simde_uint64x1_t b) { ...@@ -321,6 +368,30 @@ simde_x_vmin_u64(simde_uint64x1_t a, simde_uint64x1_t b) {
#endif #endif
} }
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vminq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vminq_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vminh_f16(a_.values[i], b_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vminq_f16
#define vminq_f16(a, b) simde_vminq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vminq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vminq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_MUL_H) #if !defined(SIMDE_ARM_NEON_MUL_H)
...@@ -36,6 +37,49 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -36,6 +37,49 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vmulh_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmulh_f16(a, b);
#else
simde_float32_t a_ = simde_float16_to_float32(a);
simde_float32_t b_ = simde_float16_to_float32(b);
return simde_float16_from_float32(a_ * b_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmulh_f16
#define vmulh_f16(a, b) simde_vmulh_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vmul_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmul_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
simde_float32_t tmp_a_ = simde_float16_to_float32(a_.values[i]);
simde_float32_t tmp_b_ = simde_float16_to_float32(b_.values[i]);
r_.values[i] = simde_float16_from_float32(tmp_a_ * tmp_b_);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmul_f16
#define vmul_f16(a, b) simde_vmul_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vmul_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vmul_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -302,6 +346,32 @@ simde_x_vmul_u64(simde_uint64x1_t a, simde_uint64x1_t b) { ...@@ -302,6 +346,32 @@ simde_x_vmul_u64(simde_uint64x1_t a, simde_uint64x1_t b) {
return simde_uint64x1_from_private(r_); return simde_uint64x1_from_private(r_);
} }
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vmulq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmulq_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
simde_float32_t tmp_a_ = simde_float16_to_float32(a_.values[i]);
simde_float32_t tmp_b_ = simde_float16_to_float32(b_.values[i]);
r_.values[i] = simde_float16_from_float32(tmp_a_ * tmp_b_);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmulq_f16
#define vmulq_f16(a, b) simde_vmulq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vmulq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vmulq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_MUL_LANE_H) #if !defined(SIMDE_ARM_NEON_MUL_LANE_H)
#define SIMDE_ARM_NEON_MUL_LANE_H #define SIMDE_ARM_NEON_MUL_LANE_H
#include "types.h" #include "types.h"
#include "mul.h"
HEDLEY_DIAGNOSTIC_PUSH HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
...@@ -353,6 +355,27 @@ simde_vmul_laneq_u32(simde_uint32x2_t a, simde_uint32x4_t b, const int lane) ...@@ -353,6 +355,27 @@ simde_vmul_laneq_u32(simde_uint32x2_t a, simde_uint32x4_t b, const int lane)
#define vmul_laneq_u32(a, b, lane) simde_vmul_laneq_u32((a), (b), (lane)) #define vmul_laneq_u32(a, b, lane) simde_vmul_laneq_u32((a), (b), (lane))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vmulq_lane_f16(simde_float16x8_t a, simde_float16x4_t b, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
simde_float16x4_private b_ = simde_float16x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vmulh_f16(a_.values[i], b_.values[lane]);
}
return simde_float16x8_from_private(r_);
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmulq_lane_f16
#define vmulq_lane_f16(a, b, lane) simde_vmulq_lane_f16((a), (b), (lane))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vmulq_lane_f32(simde_float32x4_t a, simde_float32x2_t b, const int lane) simde_vmulq_lane_f32(simde_float32x4_t a, simde_float32x2_t b, const int lane)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_MUL_N_H) #if !defined(SIMDE_ARM_NEON_MUL_N_H)
...@@ -36,6 +37,20 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -36,6 +37,20 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vmul_n_f16(simde_float16x4_t a, simde_float16 b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmul_n_f16(a, b);
#else
return simde_vmul_f16(a, simde_vdup_n_f16(b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmul_n_f16
#define vmul_n_f16(a, b) simde_vmul_n_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vmul_n_f32(simde_float32x2_t a, simde_float32 b) { simde_vmul_n_f32(simde_float32x2_t a, simde_float32 b) {
...@@ -120,6 +135,20 @@ simde_vmul_n_u32(simde_uint32x2_t a, uint32_t b) { ...@@ -120,6 +135,20 @@ simde_vmul_n_u32(simde_uint32x2_t a, uint32_t b) {
#define vmul_n_u32(a, b) simde_vmul_n_u32((a), (b)) #define vmul_n_u32(a, b) simde_vmul_n_u32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vmulq_n_f16(simde_float16x8_t a, simde_float16 b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vmulq_n_f16(a, b);
#else
return simde_vmulq_f16(a, simde_vdupq_n_f16(b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vmulq_n_f16
#define vmulq_n_f16(a, b) simde_vmulq_n_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vmulq_n_f32(simde_float32x4_t a, simde_float32 b) { simde_vmulq_n_f32(simde_float32x4_t a, simde_float32 b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020-2021 Evan Nemerson <evan@nemerson.com> * 2020-2021 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_PADD_H) #if !defined(SIMDE_ARM_NEON_PADD_H)
...@@ -96,6 +97,20 @@ simde_vpadds_f32(simde_float32x2_t a) { ...@@ -96,6 +97,20 @@ simde_vpadds_f32(simde_float32x2_t a) {
#define vpadds_f32(a) simde_vpadds_f32((a)) #define vpadds_f32(a) simde_vpadds_f32((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vpadd_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && !SIMDE_DETECT_CLANG_VERSION_NOT(9,0,0) && defined(SIMDE_ARM_NEON_FP16)
return vpadd_f16(a, b);
#else
return simde_vadd_f16(simde_vuzp1_f16(a, b), simde_vuzp2_f16(a, b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vpadd_f16
#define vpadd_f16(a, b) simde_vpadd_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vpadd_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vpadd_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_PMAX_H) #if !defined(SIMDE_ARM_NEON_PMAX_H)
...@@ -67,6 +68,20 @@ simde_vpmaxqd_f64(simde_float64x2_t a) { ...@@ -67,6 +68,20 @@ simde_vpmaxqd_f64(simde_float64x2_t a) {
#define vpmaxqd_f64(a) simde_vpmaxqd_f64((a)) #define vpmaxqd_f64(a) simde_vpmaxqd_f64((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vpmax_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vpmax_f16(a, b);
#else
return simde_vmax_f16(simde_vuzp1_f16(a, b), simde_vuzp2_f16(a, b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vpmax_f16
#define vpmax_f16(a, b) simde_vpmax_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vpmax_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vpmax_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_QRSHRN_N_H) #if !defined(SIMDE_ARM_NEON_QRSHRN_N_H)
...@@ -35,6 +36,26 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -35,6 +36,26 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vqrshrnh_n_s16(a, n) vqrshrnh_n_s16(a, n)
#else
#define simde_vqrshrnh_n_s16(a, n) simde_vqmovnh_s16(simde_x_vrshrh_n_s16(a, n))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vqrshrnh_n_s16
#define vqrshrnh_n_s16(a, n) simde_vqrshrnh_n_s16(a, n)
#endif
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vqrshrnh_n_u16(a, n) vqrshrnh_n_u16(a, n)
#else
#define simde_vqrshrnh_n_u16(a, n) simde_vqmovnh_u16(simde_x_vrshrh_n_u16(a, n))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vqrshrnh_n_u16
#define vqrshrnh_n_u16(a, n) simde_vqrshrnh_n_u16(a, n)
#endif
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vqrshrns_n_s32(a, n) vqrshrns_n_s32(a, n) #define simde_vqrshrns_n_s32(a, n) vqrshrns_n_s32(a, n)
#else #else
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_QRSHRUN_N_H) #if !defined(SIMDE_ARM_NEON_QRSHRUN_N_H)
...@@ -55,6 +56,16 @@ SIMDE_BEGIN_DECLS_ ...@@ -55,6 +56,16 @@ SIMDE_BEGIN_DECLS_
#define vqrshrund_n_s64(a, n) simde_vqrshrund_n_s64((a), (n)) #define vqrshrund_n_s64(a, n) simde_vqrshrund_n_s64((a), (n))
#endif #endif
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
#define simde_vqrshrunh_n_s16(a, n) HEDLEY_STATIC_CAST(uint8_t, vqrshrunh_n_s16((a), (n)))
#else
#define simde_vqrshrunh_n_s16(a, n) simde_vqmovunh_s16(simde_x_vrshrh_n_s16(a, n))
#endif
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vqrshrunh_n_s16
#define vqrshrunh_n_s16(a, n) simde_vqrshrunh_n_s16((a), (n))
#endif
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_vqrshrun_n_s16(a, n) vqrshrun_n_s16((a), (n)) #define simde_vqrshrun_n_s16(a, n) vqrshrun_n_s16((a), (n))
#else #else
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RECPE_H) #if !defined(SIMDE_ARM_NEON_RECPE_H)
...@@ -34,6 +35,23 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,23 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vrecpeh_f16(simde_float16_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrecpeh_f16(a);
#else
simde_float32_t r_;
simde_float32_t a_ = simde_float16_to_float32(a);
r_ = 1.0f / a_;
return simde_float16_from_float32(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrecpeh_f16
#define vrecpeh_f16(a) simde_vrecpeh_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vrecpes_f32(simde_float32_t a) { simde_vrecpes_f32(simde_float32_t a) {
...@@ -62,6 +80,29 @@ simde_vrecped_f64(simde_float64_t a) { ...@@ -62,6 +80,29 @@ simde_vrecped_f64(simde_float64_t a) {
#define vrecped_f64(a) simde_vrecped_f64((a)) #define vrecped_f64(a) simde_vrecped_f64((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vrecpe_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrecpe_f16(a);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrecpeh_f16(a_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrecpe_f16
#define vrecpe_f16(a) simde_vrecpe_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vrecpe_f32(simde_float32x2_t a) { simde_vrecpe_f32(simde_float32x2_t a) {
...@@ -198,6 +239,29 @@ simde_vrecpeq_f32(simde_float32x4_t a) { ...@@ -198,6 +239,29 @@ simde_vrecpeq_f32(simde_float32x4_t a) {
#define vrecpeq_f32(a) simde_vrecpeq_f32((a)) #define vrecpeq_f32(a) simde_vrecpeq_f32((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vrecpeq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrecpeq_f16(a);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrecpeh_f16(a_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrecpeq_f16
#define vrecpeq_f16(a) simde_vrecpeq_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_uint32x2_t simde_uint32x2_t
simde_vrecpe_u32(simde_uint32x2_t a){ simde_vrecpe_u32(simde_uint32x2_t a){
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RECPS_H) #if !defined(SIMDE_ARM_NEON_RECPS_H)
...@@ -77,6 +78,23 @@ simde_vrecps_f64(simde_float64x1_t a, simde_float64x1_t b) { ...@@ -77,6 +78,23 @@ simde_vrecps_f64(simde_float64x1_t a, simde_float64x1_t b) {
#define vrecps_f64(a, b) simde_vrecps_f64((a), (b)) #define vrecps_f64(a, b) simde_vrecps_f64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vrecps_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrecps_f16(a, b);
#else
return
simde_vsub_f16(
simde_vdup_n_f16(SIMDE_FLOAT16_VALUE(2.0)),
simde_vmul_f16(a, b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrecps_f16
#define vrecps_f16(a, b) simde_vrecps_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vrecps_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vrecps_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -119,6 +137,23 @@ simde_vrecpsq_f32(simde_float32x4_t a, simde_float32x4_t b) { ...@@ -119,6 +137,23 @@ simde_vrecpsq_f32(simde_float32x4_t a, simde_float32x4_t b) {
#define vrecpsq_f32(a, b) simde_vrecpsq_f32((a), (b)) #define vrecpsq_f32(a, b) simde_vrecpsq_f32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vrecpsq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrecpsq_f16(a, b);
#else
return
simde_vsubq_f16(
simde_vdupq_n_f16(SIMDE_FLOAT16_VALUE(2.0)),
simde_vmulq_f16(a, b));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrecpsq_f16
#define vrecpsq_f16(a, b) simde_vrecpsq_f16((a), (b))
#endif
SIMDE_END_DECLS_ SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP HEDLEY_DIAGNOSTIC_POP
#endif /* !defined(SIMDE_ARM_NEON_RECPS_H) */ #endif /* !defined(SIMDE_ARM_NEON_RECPS_H) */
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
...@@ -3163,6 +3164,278 @@ simde_vreinterpretq_f64_f32(simde_float32x4_t a) { ...@@ -3163,6 +3164,278 @@ simde_vreinterpretq_f64_f32(simde_float32x4_t a) {
#define vreinterpretq_f64_f32(a) simde_vreinterpretq_f64_f32(a) #define vreinterpretq_f64_f32(a) simde_vreinterpretq_f64_f32(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_f32(simde_float32x2_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_f32(a);
#else
simde_float16x4_private r_;
simde_float32x2_private a_ = simde_float32x2_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_f32
#define vreinterpret_f16_f32 simde_vreinterpret_f16_f32
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_s16(simde_int16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_s16(a);
#else
simde_float16x4_private r_;
simde_int16x4_private a_ = simde_int16x4_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_s16
#define vreinterpret_f16_s16 simde_vreinterpret_f16_s16
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_s32(simde_int32x2_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_s32(a);
#else
simde_float16x4_private r_;
simde_int32x2_private a_ = simde_int32x2_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_s32
#define vreinterpret_f16_s32 simde_vreinterpret_f16_s32
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_s64(simde_int64x1_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_s64(a);
#else
simde_float16x4_private r_;
simde_int64x1_private a_ = simde_int64x1_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_s64
#define vreinterpret_f16_s64 simde_vreinterpret_f16_s64
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_s8(simde_int8x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_s8(a);
#else
simde_float16x4_private r_;
simde_int8x8_private a_ = simde_int8x8_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_s8
#define vreinterpret_f16_s8 simde_vreinterpret_f16_s8
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_u32(simde_uint32x2_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_u32(a);
#else
simde_float16x4_private r_;
simde_uint32x2_private a_ = simde_uint32x2_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_u32
#define vreinterpret_f16_u32 simde_vreinterpret_f16_u32
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_u64(simde_uint64x1_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_u64(a);
#else
simde_float16x4_private r_;
simde_uint64x1_private a_ = simde_uint64x1_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_u64
#define vreinterpret_f16_u64 simde_vreinterpret_f16_u64
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vreinterpret_f16_u8(simde_uint8x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpret_f16_u8(a);
#else
simde_float16x4_private r_;
simde_uint8x8_private a_ = simde_uint8x8_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpret_f16_u8
#define vreinterpret_f16_u8 simde_vreinterpret_f16_u8
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_f32(simde_float32x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_f32(a);
#else
simde_float16x8_private r_;
simde_float32x4_private a_ = simde_float32x4_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_f32
#define vreinterpretq_f16_f32(a) simde_vreinterpretq_f16_f32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_s16(simde_int16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_s16(a);
#else
simde_float16x8_private r_;
simde_int16x8_private a_ = simde_int16x8_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_s16
#define vreinterpretq_f16_s16(a) simde_vreinterpretq_f16_s16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_s32(simde_int32x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_s32(a);
#else
simde_float16x8_private r_;
simde_int32x4_private a_ = simde_int32x4_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_s32
#define vreinterpretq_f16_s32(a) simde_vreinterpretq_f16_s32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_s64(simde_int64x2_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_s64(a);
#else
simde_float16x8_private r_;
simde_int64x2_private a_ = simde_int64x2_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_s64
#define vreinterpretq_f16_s64(a) simde_vreinterpretq_f16_s64(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_s8(simde_int8x16_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_s8(a);
#else
simde_float16x8_private r_;
simde_int8x16_private a_ = simde_int8x16_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_s8
#define vreinterpretq_f16_s8(a) simde_vreinterpretq_f16_s8(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_u32(simde_uint32x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_u32(a);
#else
simde_float16x8_private r_;
simde_uint32x4_private a_ = simde_uint32x4_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_u32
#define vreinterpretq_f16_u32(a) simde_vreinterpretq_f16_u32(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_u64(simde_uint64x2_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_u64(a);
#else
simde_float16x8_private r_;
simde_uint64x2_private a_ = simde_uint64x2_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_u64
#define vreinterpretq_f16_u64(a) simde_vreinterpretq_f16_u64(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vreinterpretq_f16_u8(simde_uint8x16_t a) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vreinterpretq_f16_u8(a);
#else
simde_float16x8_private r_;
simde_uint8x16_private a_ = simde_uint8x16_to_private(a);
simde_memcpy(&r_, &a_, sizeof(r_));
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vreinterpretq_f16_u8
#define vreinterpretq_f16_u8(a) simde_vreinterpretq_f16_u8(a)
#endif
SIMDE_END_DECLS_ SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP HEDLEY_DIAGNOSTIC_POP
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020-2021 Evan Nemerson <evan@nemerson.com> * 2020-2021 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RNDN_H) #if !defined(SIMDE_ARM_NEON_RNDN_H)
...@@ -33,6 +34,24 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -33,6 +34,24 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vrndnh_f16(simde_float16_t a) {
#if \
defined(SIMDE_ARM_NEON_A32V8_NATIVE) && \
(!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0)) && \
(!defined(HEDLEY_GCC_VERSION) || (defined(SIMDE_ARM_NEON_A64V8_NATIVE) && HEDLEY_GCC_VERSION_CHECK(8,0,0))) && defined(SIMDE_ARM_NEON_FP16)
return vrndnh_f16(a);
#else
simde_float32_t a_ = simde_float16_to_float32(a);
return simde_float16_from_float32(simde_math_roundevenf(a_));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrndnh_f16
#define vrndnh_f16(a) simde_vrndnh_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vrndns_f32(simde_float32_t a) { simde_vrndns_f32(simde_float32_t a) {
...@@ -50,6 +69,29 @@ simde_vrndns_f32(simde_float32_t a) { ...@@ -50,6 +69,29 @@ simde_vrndns_f32(simde_float32_t a) {
#define vrndns_f32(a) simde_vrndns_f32(a) #define vrndns_f32(a) simde_vrndns_f32(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vrndn_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrndn_f16(a);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrndnh_f16(a_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrndn_f16
#define vrndn_f16(a) simde_vrndn_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vrndn_f32(simde_float32x2_t a) { simde_vrndn_f32(simde_float32x2_t a) {
...@@ -97,6 +139,29 @@ simde_vrndn_f64(simde_float64x1_t a) { ...@@ -97,6 +139,29 @@ simde_vrndn_f64(simde_float64x1_t a) {
#define vrndn_f64(a) simde_vrndn_f64(a) #define vrndn_f64(a) simde_vrndn_f64(a)
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vrndnq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrndnq_f16(a);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrndnh_f16(a_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrndnq_f16
#define vrndnq_f16(a) simde_vrndnq_f16(a)
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vrndnq_f32(simde_float32x4_t a) { simde_vrndnq_f32(simde_float32x4_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Christopher Moore <moore@free.fr> * 2020 Christopher Moore <moore@free.fr>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RSHR_N_H) #if !defined(SIMDE_ARM_NEON_RSHR_N_H)
...@@ -41,6 +42,20 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -41,6 +42,20 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
int16_t
simde_x_vrshrh_n_s16(int16_t a, const int n)
SIMDE_REQUIRE_CONSTANT_RANGE(n, 1, 16) {
return (a >> ((n == 16) ? 15 : n)) + ((a & HEDLEY_STATIC_CAST(int16_t, UINT16_C(1) << (n - 1))) != 0);
}
SIMDE_FUNCTION_ATTRIBUTES
uint16_t
simde_x_vrshrh_n_u16(uint16_t a, const int n)
SIMDE_REQUIRE_CONSTANT_RANGE(n, 1, 16) {
return ((n == 16) ? 0 : (a >> n)) + ((a & (UINT32_C(1) << (n - 1))) != 0);
}
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
int32_t int32_t
simde_x_vrshrs_n_s32(int32_t a, const int n) simde_x_vrshrs_n_s32(int32_t a, const int n)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RSQRTE_H) #if !defined(SIMDE_ARM_NEON_RSQRTE_H)
...@@ -34,6 +35,27 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,27 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vrsqrteh_f16(simde_float16_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrteh_f16(a);
#else
#if defined(simde_math_sqrtf)
simde_float32_t r_;
simde_float32_t a_ = simde_float16_to_float32(a);
r_ = 1.0f / simde_math_sqrtf(a_);
return simde_float16_from_float32(r_);
#else
HEDLEY_UNREACHABLE();
#endif
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrteh_f16
#define vrsqrteh_f16(a) simde_vrsqrteh_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vrsqrtes_f32(simde_float32_t a) { simde_vrsqrtes_f32(simde_float32_t a) {
...@@ -144,6 +166,33 @@ simde_vrsqrte_u32(simde_uint32x2_t a) { ...@@ -144,6 +166,33 @@ simde_vrsqrte_u32(simde_uint32x2_t a) {
#define vrsqrte_u32(a) simde_vrsqrte_u32((a)) #define vrsqrte_u32(a) simde_vrsqrte_u32((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vrsqrte_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrte_f16(a);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a);
#if defined(simde_math_sqrtf)
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrsqrteh_f16(a_.values[i]);
}
#else
HEDLEY_UNREACHABLE();
#endif
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrte_f16
#define vrsqrte_f16(a) simde_vrsqrte_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vrsqrte_f32(simde_float32x2_t a) { simde_vrsqrte_f32(simde_float32x2_t a) {
...@@ -279,6 +328,33 @@ simde_vrsqrteq_u32(simde_uint32x4_t a) { ...@@ -279,6 +328,33 @@ simde_vrsqrteq_u32(simde_uint32x4_t a) {
#define vrsqrteq_u32(a) simde_vrsqrteq_u32((a)) #define vrsqrteq_u32(a) simde_vrsqrteq_u32((a))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vrsqrteq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrteq_f16(a);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
#if defined(simde_math_sqrtf)
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vrsqrteh_f16(a_.values[i]);
}
#else
HEDLEY_UNREACHABLE();
#endif
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrteq_f16
#define vrsqrteq_f16(a) simde_vrsqrteq_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vrsqrteq_f32(simde_float32x4_t a) { simde_vrsqrteq_f32(simde_float32x4_t a) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2021 Evan Nemerson <evan@nemerson.com> * 2021 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_RSQRTS_H) #if !defined(SIMDE_ARM_NEON_RSQRTS_H)
...@@ -37,6 +38,26 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -37,6 +38,26 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16_t
simde_vrsqrtsh_f16(simde_float16_t a, simde_float16_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrtsh_f16(a, b);
#else
return
simde_vmulh_f16(
simde_vsubh_f16(
SIMDE_FLOAT16_VALUE(3.0),
simde_vmulh_f16(a, b)),
SIMDE_FLOAT16_VALUE(0.5)
);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrtsh_f16
#define vrsqrtsh_f16(a, b) simde_vrsqrtsh_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32_t simde_float32_t
simde_vrsqrtss_f32(simde_float32_t a, simde_float32_t b) { simde_vrsqrtss_f32(simde_float32_t a, simde_float32_t b) {
...@@ -65,6 +86,26 @@ simde_vrsqrtsd_f64(simde_float64_t a, simde_float64_t b) { ...@@ -65,6 +86,26 @@ simde_vrsqrtsd_f64(simde_float64_t a, simde_float64_t b) {
#define vrsqrtsd_f64(a, b) simde_vrsqrtsd_f64((a), (b)) #define vrsqrtsd_f64(a, b) simde_vrsqrtsd_f64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vrsqrts_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrts_f16(a, b);
#else
return
simde_vmul_n_f16(
simde_vsub_f16(
simde_vdup_n_f16(SIMDE_FLOAT16_VALUE(3.0)),
simde_vmul_f16(a, b)),
SIMDE_FLOAT16_VALUE(0.5)
);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrts_f16
#define vrsqrts_f16(a, b) simde_vrsqrts_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vrsqrts_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vrsqrts_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -107,6 +148,26 @@ simde_vrsqrts_f64(simde_float64x1_t a, simde_float64x1_t b) { ...@@ -107,6 +148,26 @@ simde_vrsqrts_f64(simde_float64x1_t a, simde_float64x1_t b) {
#define vrsqrts_f64(a, b) simde_vrsqrts_f64((a), (b)) #define vrsqrts_f64(a, b) simde_vrsqrts_f64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vrsqrtsq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vrsqrtsq_f16(a, b);
#else
return
simde_vmulq_n_f16(
simde_vsubq_f16(
simde_vdupq_n_f16(SIMDE_FLOAT16_VALUE(3.0)),
simde_vmulq_f16(a, b)),
SIMDE_FLOAT16_VALUE(0.5)
);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vrsqrtsq_f16
#define vrsqrtsq_f16(a, b) simde_vrsqrtsq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vrsqrtsq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vrsqrtsq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_SET_LANE_H) #if !defined(SIMDE_ARM_NEON_SET_LANE_H)
...@@ -33,6 +34,25 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -33,6 +34,25 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vset_lane_f16(simde_float16_t a, simde_float16x4_t v, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
simde_float16x4_t r;
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
SIMDE_CONSTIFY_4_(vset_lane_f16, r, (HEDLEY_UNREACHABLE(), v), lane, a, v);
#else
simde_float16x4_private v_ = simde_float16x4_to_private(v);
v_.values[lane] = a;
r = simde_float16x4_from_private(v_);
#endif
return r;
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vset_lane_f16
#define vset_lane_f16(a, b, c) simde_vset_lane_f16((a), (b), (c))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vset_lane_f32(simde_float32_t a, simde_float32x2_t v, const int lane) simde_vset_lane_f32(simde_float32_t a, simde_float32x2_t v, const int lane)
...@@ -226,6 +246,25 @@ simde_vset_lane_u64(uint64_t a, simde_uint64x1_t v, const int lane) ...@@ -226,6 +246,25 @@ simde_vset_lane_u64(uint64_t a, simde_uint64x1_t v, const int lane)
#define vset_lane_u64(a, b, c) simde_vset_lane_u64((a), (b), (c)) #define vset_lane_u64(a, b, c) simde_vset_lane_u64((a), (b), (c))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vsetq_lane_f16(simde_float16_t a, simde_float16x8_t v, const int lane)
SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
simde_float16x8_t r;
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
SIMDE_CONSTIFY_8_(vsetq_lane_f16, r, (HEDLEY_UNREACHABLE(), v), lane, a, v);
#else
simde_float16x8_private v_ = simde_float16x8_to_private(v);
v_.values[lane] = a;
r = simde_float16x8_from_private(v_);
#endif
return r;
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vsetq_lane_f16
#define vsetq_lane_f16(a, b, c) simde_vsetq_lane_f16((a), (b), (c))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vsetq_lane_f32(simde_float32_t a, simde_float32x4_t v, const int lane) simde_vsetq_lane_f32(simde_float32_t a, simde_float32x4_t v, const int lane)
......
/* 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 <eric681@andestech.com> (Copyright owned by Andes Technology)
*/
#if !defined(SIMDE_ARM_NEON_SQRT_H)
#define SIMDE_ARM_NEON_SQRT_H
#include "types.h"
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16
simde_vsqrth_f16(simde_float16 a) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsqrth_f16(a, b);
#elif defined(simde_math_sqrtf)
simde_float32 af = simde_float16_to_float32(a);
return simde_float16_from_float32(simde_math_sqrtf(af));
#else
HEDLEY_UNREACHABLE();
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vsqrth_f16
#define vsqrth_f16(a) simde_vsqrth_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vsqrt_f16(simde_float16x4_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsqrt_f16(a);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vsqrth_f16(a_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrt_f16
#define vsqrt_f16(a) simde_vsqrt_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t
simde_vsqrt_f32(simde_float32x2_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vsqrt_f32(a);
#elif defined(simde_math_sqrtf)
simde_float32x2_private
r_,
a_ = simde_float32x2_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_math_sqrtf(a_.values[i]);
}
return simde_float32x2_from_private(r_);
#else
HEDLEY_UNREACHABLE();
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrt_f32
#define vsqrt_f32(a) simde_vsqrt_f32((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x1_t
simde_vsqrt_f64(simde_float64x1_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vsqrt_f64(a);
#elif defined(simde_math_sqrt)
simde_float64x1_private
r_,
a_ = simde_float64x1_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_math_sqrt(a_.values[i]);
}
return simde_float64x1_from_private(r_);
#else
HEDLEY_UNREACHABLE();
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrt_f64
#define vsqrt_f64(a) simde_vsqrt_f64((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vsqrtq_f16(simde_float16x8_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsqrtq_f16(a);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vsqrth_f16(a_.values[i]);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrtq_f16
#define vsqrtq_f16(a) simde_vsqrtq_f16((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t
simde_vsqrtq_f32(simde_float32x4_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vsqrtq_f32(a);
#elif defined(simde_math_sqrtf)
simde_float32x4_private
r_,
a_ = simde_float32x4_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_math_sqrtf(a_.values[i]);
}
return simde_float32x4_from_private(r_);
#else
HEDLEY_UNREACHABLE();
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrtq_f32
#define vsqrtq_f32(a) simde_vsqrtq_f32((a))
#endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x2_t
simde_vsqrtq_f64(simde_float64x2_t a) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
return vsqrtq_f64(a);
#elif defined(simde_math_sqrt)
simde_float64x2_private
r_,
a_ = simde_float64x2_to_private(a);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_math_sqrt(a_.values[i]);
}
return simde_float64x2_from_private(r_);
#else
HEDLEY_UNREACHABLE();
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vsqrtq_f64
#define vsqrtq_f64(a) simde_vsqrtq_f64((a))
#endif
SIMDE_END_DECLS_
HEDLEY_DIAGNOSTIC_POP
#endif /* !defined(SIMDE_ARM_NEON_SQRT_H) */
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC) * 2021 Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_ST2_H) #if !defined(SIMDE_ARM_NEON_ST2_H)
...@@ -37,6 +38,26 @@ SIMDE_BEGIN_DECLS_ ...@@ -37,6 +38,26 @@ SIMDE_BEGIN_DECLS_
#if !defined(SIMDE_BUG_INTEL_857088) #if !defined(SIMDE_BUG_INTEL_857088)
SIMDE_FUNCTION_ATTRIBUTES
void
simde_vst2_f16(simde_float16_t *ptr, simde_float16x4x2_t val) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
vst2_f16(ptr, val);
#else
simde_float16_t buf[8];
simde_float16x4_private a_[2] = {simde_float16x4_to_private(val.val[0]),
simde_float16x4_to_private(val.val[1])};
for (size_t i = 0; i < (sizeof(val.val[0]) / sizeof(*ptr)) * 2 ; i++) {
buf[i] = a_[i % 2].values[i / 2];
}
simde_memcpy(ptr, buf, sizeof(buf));
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vst2_f16
#define vst2_f16(a, b) simde_vst2_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
void void
simde_vst2_f32(simde_float32_t *ptr, simde_float32x2x2_t val) { simde_vst2_f32(simde_float32_t *ptr, simde_float32x2x2_t val) {
...@@ -237,6 +258,22 @@ simde_vst2_u64(uint64_t *ptr, simde_uint64x1x2_t val) { ...@@ -237,6 +258,22 @@ simde_vst2_u64(uint64_t *ptr, simde_uint64x1x2_t val) {
#define vst2_u64(a, b) simde_vst2_u64((a), (b)) #define vst2_u64(a, b) simde_vst2_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
void
simde_vst2q_f16(simde_float16_t *ptr, simde_float16x8x2_t val) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
vst2q_f16(ptr, val);
#else
simde_float16x8x2_t r = simde_vzipq_f16(val.val[0], val.val[1]);
simde_vst1q_f16(ptr, r.val[0]);
simde_vst1q_f16(ptr+8, r.val[1]);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vst2q_f16
#define vst2q_f16(a, b) simde_vst2q_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
void void
simde_vst2q_f32(simde_float32_t *ptr, simde_float32x4x2_t val) { simde_vst2q_f32(simde_float32_t *ptr, simde_float32x4x2_t val) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_SUB_H) #if !defined(SIMDE_ARM_NEON_SUB_H)
...@@ -33,6 +34,22 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -33,6 +34,22 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16
simde_vsubh_f16(simde_float16 a, simde_float16 b) {
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsubh_f16(a, b);
#else
simde_float32 af = simde_float16_to_float32(a);
simde_float32 bf = simde_float16_to_float32(b);
return simde_float16_from_float32(af - bf);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vsubh_f16
#define vsubh_f16(a, b) simde_vsubh_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
int64_t int64_t
simde_vsubd_s64(int64_t a, int64_t b) { simde_vsubd_s64(int64_t a, int64_t b) {
...@@ -61,6 +78,30 @@ simde_vsubd_u64(uint64_t a, uint64_t b) { ...@@ -61,6 +78,30 @@ simde_vsubd_u64(uint64_t a, uint64_t b) {
#define vsubd_u64(a, b) simde_vsubd_u64((a), (b)) #define vsubd_u64(a, b) simde_vsubd_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vsub_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsub_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
r_.values[i] = simde_vsubh_f16(a_.values[i], b_.values[i]);
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vsub_f16
#define vsub_f16(a, b) simde_vsub_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vsub_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vsub_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -353,6 +394,32 @@ simde_vsub_u64(simde_uint64x1_t a, simde_uint64x1_t b) { ...@@ -353,6 +394,32 @@ simde_vsub_u64(simde_uint64x1_t a, simde_uint64x1_t b) {
#define vsub_u64(a, b) simde_vsub_u64((a), (b)) #define vsub_u64(a, b) simde_vsub_u64((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vsubq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vsubq_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
SIMDE_VECTORIZE
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
simde_float32_t tmp_a_ = simde_float16_to_float32(a_.values[i]);
simde_float32_t tmp_b_ = simde_float16_to_float32(b_.values[i]);
r_.values[i] = simde_float16_from_float32(tmp_a_ - tmp_b_);
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES)
#undef vsubq_f16
#define vsubq_f16(a, b) simde_vsubq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vsubq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vsubq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_TYPES_H) #if !defined(SIMDE_ARM_NEON_TYPES_H)
...@@ -399,6 +400,16 @@ typedef union { ...@@ -399,6 +400,16 @@ typedef union {
typedef uint64x2x4_t simde_uint64x2x4_t; typedef uint64x2x4_t simde_uint64x2x4_t;
typedef float32x4x4_t simde_float32x4x4_t; typedef float32x4x4_t simde_float32x4x4_t;
#if defined(SIMDE_ARM_NEON_FP16)
typedef float16_t simde_float16_t;
typedef float16x4_t simde_float16x4_t;
typedef float16x8_t simde_float16x8_t;
typedef float16x4x2_t simde_float16x4x2_t;
typedef float16x8x2_t simde_float16x8x2_t;
#else
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#endif
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
typedef float64_t simde_float64_t; typedef float64_t simde_float64_t;
typedef float64x1_t simde_float64x1_t; typedef float64x1_t simde_float64x1_t;
...@@ -417,14 +428,8 @@ typedef union { ...@@ -417,14 +428,8 @@ typedef union {
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2XN #define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2XN
#endif #endif
#if SIMDE_FLOAT16_API == SIMDE_FLOAT16_API_FP16
typedef float16_t simde_float16_t;
typedef float16x4_t simde_float16x4_t;
typedef float16x8_t simde_float16x8_t;
#else
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#endif
#elif (defined(SIMDE_X86_MMX_NATIVE) || defined(SIMDE_X86_SSE_NATIVE)) && defined(SIMDE_ARM_NEON_FORCE_NATIVE_TYPES) #elif (defined(SIMDE_X86_MMX_NATIVE) || defined(SIMDE_X86_SSE_NATIVE)) && defined(SIMDE_ARM_NEON_FORCE_NATIVE_TYPES)
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#define SIMDE_ARM_NEON_NEED_PORTABLE_F32 #define SIMDE_ARM_NEON_NEED_PORTABLE_F32
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64 #define SIMDE_ARM_NEON_NEED_PORTABLE_F64
...@@ -483,8 +488,6 @@ typedef union { ...@@ -483,8 +488,6 @@ typedef union {
#define SIMDE_ARM_NEON_NEED_PORTABLE_U64X2 #define SIMDE_ARM_NEON_NEED_PORTABLE_U64X2
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2 #define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2
#endif #endif
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#elif defined(SIMDE_WASM_SIMD128_NATIVE) && defined(SIMDE_ARM_NEON_FORCE_NATIVE_TYPES) #elif defined(SIMDE_WASM_SIMD128_NATIVE) && defined(SIMDE_ARM_NEON_FORCE_NATIVE_TYPES)
#define SIMDE_ARM_NEON_NEED_PORTABLE_F32 #define SIMDE_ARM_NEON_NEED_PORTABLE_F32
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64 #define SIMDE_ARM_NEON_NEED_PORTABLE_F64
...@@ -507,6 +510,7 @@ typedef union { ...@@ -507,6 +510,7 @@ typedef union {
typedef v128_t simde_float32x4_t; typedef v128_t simde_float32x4_t;
typedef v128_t simde_float64x2_t; typedef v128_t simde_float64x2_t;
#elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE)
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#define SIMDE_ARM_NEON_NEED_PORTABLE_F32 #define SIMDE_ARM_NEON_NEED_PORTABLE_F32
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64 #define SIMDE_ARM_NEON_NEED_PORTABLE_F64
...@@ -531,9 +535,7 @@ typedef union { ...@@ -531,9 +535,7 @@ typedef union {
#define SIMDE_ARM_NEON_NEED_PORTABLE_I64X2 #define SIMDE_ARM_NEON_NEED_PORTABLE_I64X2
#define SIMDE_ARM_NEON_NEED_PORTABLE_U64X2 #define SIMDE_ARM_NEON_NEED_PORTABLE_U64X2
#define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2 #define SIMDE_ARM_NEON_NEED_PORTABLE_F64X2
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#endif #endif
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#elif defined(SIMDE_VECTOR) #elif defined(SIMDE_VECTOR)
typedef simde_float32 simde_float32_t; typedef simde_float32 simde_float32_t;
typedef simde_float64 simde_float64_t; typedef simde_float64 simde_float64_t;
...@@ -562,6 +564,12 @@ typedef union { ...@@ -562,6 +564,12 @@ typedef union {
typedef simde_float16 simde_float16_t; typedef simde_float16 simde_float16_t;
typedef simde_float16_t simde_float16x4_t SIMDE_VECTOR(8); typedef simde_float16_t simde_float16x4_t SIMDE_VECTOR(8);
typedef simde_float16_t simde_float16x8_t SIMDE_VECTOR(16); typedef simde_float16_t simde_float16x8_t SIMDE_VECTOR(16);
typedef struct simde_float16x4x2_t {
simde_float16x4_t val[2];
} simde_float16x4x2_t;
typedef struct simde_float16x8x2_t {
simde_float16x8_t val[2];
} simde_float16x8x2_t;
#else #else
#define SIMDE_ARM_NEON_NEED_PORTABLE_F16 #define SIMDE_ARM_NEON_NEED_PORTABLE_F16
#endif #endif
...@@ -647,6 +655,13 @@ typedef union { ...@@ -647,6 +655,13 @@ typedef union {
typedef simde_float16 simde_float16_t; typedef simde_float16 simde_float16_t;
typedef simde_float16x4_private simde_float16x4_t; typedef simde_float16x4_private simde_float16x4_t;
typedef simde_float16x8_private simde_float16x8_t; typedef simde_float16x8_private simde_float16x8_t;
typedef struct simde_float16x4x2_t {
simde_float16x4_t val[2];
} simde_float16x4x2_t;
typedef struct simde_float16x8x2_t {
simde_float16x8_t val[2];
} simde_float16x8x2_t;
#endif #endif
#if defined(SIMDE_ARM_NEON_NEED_PORTABLE_F32) #if defined(SIMDE_ARM_NEON_NEED_PORTABLE_F32)
typedef simde_float32 simde_float32_t; typedef simde_float32 simde_float32_t;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_UZP1_H) #if !defined(SIMDE_ARM_NEON_UZP1_H)
...@@ -34,6 +35,33 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,33 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vuzp1_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vuzp1_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
const size_t idx = i << 1;
r_.values[ i ] = a_.values[idx];
r_.values[i + halfway_point] = b_.values[idx];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vuzp1_f16
#define vuzp1_f16(a, b) simde_vuzp1_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vuzp1_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vuzp1_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_UZP2_H) #if !defined(SIMDE_ARM_NEON_UZP2_H)
...@@ -34,6 +35,33 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,33 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vuzp2_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vuzp2_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
const size_t idx = i << 1;
r_.values[ i ] = a_.values[idx | 1];
r_.values[i + halfway_point] = b_.values[idx | 1];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vuzp2_f16
#define vuzp2_f16(a, b) simde_vuzp2_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vuzp2_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vuzp2_f32(simde_float32x2_t a, simde_float32x2_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_ZIP_H) && !defined(SIMDE_BUG_INTEL_857088) #if !defined(SIMDE_ARM_NEON_ZIP_H) && !defined(SIMDE_BUG_INTEL_857088)
...@@ -36,6 +37,21 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -36,6 +37,21 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4x2_t
simde_vzip_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzip_f16(a, b);
#else
simde_float16x4x2_t r = { { simde_vzip1_f16(a, b), simde_vzip2_f16(a, b) } };
return r;
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vzip_f16
#define vzip_f16(a, b) simde_vzip_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2x2_t simde_float32x2x2_t
simde_vzip_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vzip_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -141,6 +157,21 @@ simde_vzip_u32(simde_uint32x2_t a, simde_uint32x2_t b) { ...@@ -141,6 +157,21 @@ simde_vzip_u32(simde_uint32x2_t a, simde_uint32x2_t b) {
#define vzip_u32(a, b) simde_vzip_u32((a), (b)) #define vzip_u32(a, b) simde_vzip_u32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8x2_t
simde_vzipq_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzipq_f16(a, b);
#else
simde_float16x8x2_t r = { { simde_vzip1q_f16(a, b), simde_vzip2q_f16(a, b) } };
return r;
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
#undef vzipq_f16
#define vzipq_f16(a, b) simde_vzipq_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4x2_t simde_float32x4x2_t
simde_vzipq_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vzipq_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_ZIP1_H) #if !defined(SIMDE_ARM_NEON_ZIP1_H)
...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vzip1_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzip1_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
r_.values[2 * i ] = a_.values[i];
r_.values[2 * i + 1] = b_.values[i];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vzip1_f16
#define vzip1_f16(a, b) simde_vzip1_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vzip1_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vzip1_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -279,6 +306,32 @@ simde_vzip1_u32(simde_uint32x2_t a, simde_uint32x2_t b) { ...@@ -279,6 +306,32 @@ simde_vzip1_u32(simde_uint32x2_t a, simde_uint32x2_t b) {
#define vzip1_u32(a, b) simde_vzip1_u32((a), (b)) #define vzip1_u32(a, b) simde_vzip1_u32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vzip1q_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzip1q_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
r_.values[2 * i ] = a_.values[i];
r_.values[2 * i + 1] = b_.values[i];
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vzip1q_f16
#define vzip1q_f16(a, b) simde_vzip1q_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vzip1q_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vzip1q_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Copyright: * Copyright:
* 2020 Evan Nemerson <evan@nemerson.com> * 2020 Evan Nemerson <evan@nemerson.com>
* 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC) * 2020 Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
#if !defined(SIMDE_ARM_NEON_ZIP2_H) #if !defined(SIMDE_ARM_NEON_ZIP2_H)
...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH ...@@ -34,6 +35,32 @@ HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x4_t
simde_vzip2_f16(simde_float16x4_t a, simde_float16x4_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzip2_f16(a, b);
#else
simde_float16x4_private
r_,
a_ = simde_float16x4_to_private(a),
b_ = simde_float16x4_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
r_.values[(2 * i) ] = a_.values[halfway_point + i];
r_.values[(2 * i) + 1] = b_.values[halfway_point + i];
}
return simde_float16x4_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vzip2_f16
#define vzip2_f16(a, b) simde_vzip2_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t simde_float32x2_t
simde_vzip2_f32(simde_float32x2_t a, simde_float32x2_t b) { simde_vzip2_f32(simde_float32x2_t a, simde_float32x2_t b) {
...@@ -258,6 +285,32 @@ simde_vzip2_u32(simde_uint32x2_t a, simde_uint32x2_t b) { ...@@ -258,6 +285,32 @@ simde_vzip2_u32(simde_uint32x2_t a, simde_uint32x2_t b) {
#define vzip2_u32(a, b) simde_vzip2_u32((a), (b)) #define vzip2_u32(a, b) simde_vzip2_u32((a), (b))
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES
simde_float16x8_t
simde_vzip2q_f16(simde_float16x8_t a, simde_float16x8_t b) {
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(SIMDE_ARM_NEON_FP16)
return vzip2q_f16(a, b);
#else
simde_float16x8_private
r_,
a_ = simde_float16x8_to_private(a),
b_ = simde_float16x8_to_private(b);
const size_t halfway_point = sizeof(r_.values) / sizeof(r_.values[0]) / 2;
SIMDE_VECTORIZE
for (size_t i = 0 ; i < halfway_point ; i++) {
r_.values[(2 * i) ] = a_.values[halfway_point + i];
r_.values[(2 * i) + 1] = b_.values[halfway_point + i];
}
return simde_float16x8_from_private(r_);
#endif
}
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
#undef vzip2q_f16
#define vzip2q_f16(a, b) simde_vzip2q_f16((a), (b))
#endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t simde_float32x4_t
simde_vzip2q_f32(simde_float32x4_t a, simde_float32x4_t b) { simde_vzip2q_f32(simde_float32x4_t a, simde_float32x4_t b) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
* Copyright: * Copyright:
* 2017-2020 Evan Nemerson <evan@nemerson.com> * 2017-2020 Evan Nemerson <evan@nemerson.com>
* 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/ */
/* Attempt to find math functions. Functions may be in <cmath>, /* Attempt to find math functions. Functions may be in <cmath>,
...@@ -1363,6 +1364,16 @@ simde_math_fpclass(double v, const int imm8) { ...@@ -1363,6 +1364,16 @@ simde_math_fpclass(double v, const int imm8) {
#endif #endif
#endif #endif
#if !defined(simde_math_sqrtl)
#if SIMDE_MATH_BUILTIN_LIBM(sqrtl)
#define simde_math_sqrtl(v) __builtin_sqrtl(v)
#elif defined(SIMDE_MATH_HAVE_CMATH)
#define simde_math_sqrtl(v) std::sqrt(v)
#elif defined(SIMDE_MATH_HAVE_MATH_H)
#define simde_math_sqrtl(v) sqrtl(v)
#endif
#endif
#if !defined(simde_math_tan) #if !defined(simde_math_tan)
#if SIMDE_MATH_BUILTIN_LIBM(tan) #if SIMDE_MATH_BUILTIN_LIBM(tan)
#define simde_math_tan(v) __builtin_tan(v) #define simde_math_tan(v) __builtin_tan(v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment