3#include "arm_simd/helpers/scalar.hpp"
4#include "arm_simd/helpers/vec64.hpp"
6#include "helpers/argon_for.hpp"
8#ifdef __ARM_FEATURE_MVE
14#ifdef ARGON_PLATFORM_SIMDE
15#define ace [[gnu::always_inline]] inline
17#define ace [[gnu::always_inline]] constexpr
19#define ace [[gnu::always_inline]] inline
26#ifdef ARGON_PLATFORM_MVE
31template <
size_t,
typename VectorType>
32using ConstLane = simd::Scalar_t<VectorType>;
34template <
typename VectorType>
35using Lane = simd::Scalar_t<VectorType>;
45template <
size_t LaneIndex,
typename VectorType>
47 using scalar_type = simd::Scalar_t<VectorType>;
55 ace
operator scalar_type()
const {
return Get(); }
57 ace argon_type
operator=(
const scalar_type b) {
return vec_ =
Set(b); }
60 ace argon_type
Load(
const scalar_type* ptr) {
61#ifdef ARGON_PLATFORM_MVE
62 return vec_ =
Set(*ptr);
64 if constexpr (simd::is_quadword_v<VectorType>) {
65 return vec_ = argon_type{simd::load1_lane_quad<LaneIndex>(ptr, vec_)};
67 return vec_ = argon_type{simd::load1_lane<LaneIndex>(ptr, vec_)};
72 ace argon_type
Set(
const scalar_type b) {
return argon_type{simd::set_lane<LaneIndex>(b, vec_)}; }
74 ace scalar_type
Get()
const {
return simd::get_lane<LaneIndex>(vec_); }
78 ace VectorType
vec() {
return vec_; }
80 ace
const int lane() {
return LaneIndex; }
83 ace neon::Vec64_t<scalar_type>
vec() {
84 if constexpr (simd::is_doubleword_v<VectorType>) {
86 }
else if constexpr (simd::is_quadword_v<VectorType>) {
88 return simd::get_high(vec_);
90 return simd::get_low(vec_);
96 if constexpr (simd::is_doubleword_v<VectorType>) {
98 }
else if constexpr (simd::is_quadword_v<VectorType>) {
116template <
typename VectorType>
118 using scalar_type = simd::Scalar_t<VectorType>;
126 ace argon_type
operator=(
const scalar_type b) {
return vec_ =
Set(b); }
129 ace argon_type
Load(
const scalar_type* ptr) {
130#ifdef ARGON_PLATFORM_MVE
131 return vec_ =
Set(*ptr);
133 return vec_ = argon_type{simd::load1_lane(vec_, lane_, ptr)};
137 ace argon_type
Set(
const scalar_type b) {
return argon_type{simd::set_lane(vec_, lane_, b)}; }
139 ace scalar_type
Get()
const {
return simd::get_lane(vec_, lane_); }
141 ace
operator scalar_type()
const {
return Get(); }
145 ace VectorType
vec() {
return vec_; }
147 ace
const int lane() {
return lane_; }
150 ace neon::Vec64_t<scalar_type>
vec() {
151 if constexpr (simd::is_doubleword_v<VectorType>) {
153 }
else if constexpr (simd::is_quadword_v<VectorType>) {
155 return simd::get_high(vec_);
157 return simd::get_low(vec_);
163 if constexpr (simd::is_doubleword_v<VectorType>) {
165 }
else if constexpr (simd::is_quadword_v<VectorType>) {
Definition argon_half.hpp:11
Represents a single lane of a SIMD vector with the lane index known at compile time.
Definition lane.hpp:46
ace int lane()
On ARM32, return the local lane index within the 64-bit half-register returned by vec().
Definition lane.hpp:95
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:72
ace argon_type operator=(const scalar_type b)
Write a scalar value into this lane and return the updated vector.
Definition lane.hpp:57
ace neon::Vec64_t< scalar_type > vec()
On ARM32, return the 64-bit half-register that contains this lane.
Definition lane.hpp:83
ace ConstLane(VectorType &vec)
Construct a lane accessor bound to vec.
Definition lane.hpp:53
ace scalar_type Get() const
Get the scalar value of this lane.
Definition lane.hpp:74
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane and return the updated vector.
Definition lane.hpp:60
Represents a single lane of a SIMD vector with a runtime-determined index.
Definition lane.hpp:117
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:137
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane and return the updated vector.
Definition lane.hpp:129
ace int lane()
Definition lane.hpp:162
ace Lane(VectorType &vec, const int lane)
Construct a lane accessor bound to vec at runtime index lane.
Definition lane.hpp:124
ace neon::Vec64_t< scalar_type > vec()
Definition lane.hpp:150
ace scalar_type Get() const
Get the scalar value of this lane.
Definition lane.hpp:139
ace argon_type operator=(const scalar_type b)
Write a scalar value into this lane and return the updated vector.
Definition lane.hpp:126
Represents a SIMD vector with various operations.
Definition vector.hpp:50
Header file for SIMD features and platform detection.
typename ArgonFor< std::remove_cv_t< T > >::type ArgonFor_t
Helper alias to get the Argon type for a given vector type.
Definition argon_for.hpp:45