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
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); }
59 ace argon_type
Load(
const scalar_type* ptr) {
60#ifdef ARGON_PLATFORM_MVE
63 if constexpr (simd::is_quadword_v<VectorType>) {
64 return simd::load1_lane_quad<LaneIndex>(ptr, vec_);
66 return simd::load1_lane<LaneIndex>(ptr, vec_);
71 ace argon_type
Set(
const scalar_type b) {
return simd::set_lane<LaneIndex>(b, vec_); }
73 ace scalar_type
Get()
const {
return simd::get_lane<LaneIndex>(vec_); }
77 ace VectorType
vec() {
return vec_; }
79 ace
const int lane() {
return LaneIndex; }
82 ace neon::Vec64_t<scalar_type>
vec() {
83 if constexpr (simd::is_doubleword_v<VectorType>) {
85 }
else if constexpr (simd::is_quadword_v<VectorType>) {
87 return simd::get_high(vec_);
89 return simd::get_low(vec_);
95 if constexpr (simd::is_doubleword_v<VectorType>) {
97 }
else if constexpr (simd::is_quadword_v<VectorType>) {
115template <
typename VectorType>
117 using scalar_type = simd::Scalar_t<VectorType>;
125 ace argon_type
operator=(
const scalar_type b) {
return vec_ =
Set(b); }
127 [[nodiscard]] ace argon_type
Load(
const scalar_type* ptr) {
128#ifdef ARGON_PLATFORM_MVE
131 return simd::load1_lane(vec_, lane_, ptr);
135 ace argon_type
Set(
const scalar_type b) {
return simd::set_lane(vec_, lane_, b); }
137 ace scalar_type
Get()
const {
return simd::get_lane(vec_, lane_); }
139 ace
operator scalar_type()
const {
return Get(); }
143 ace VectorType
vec() {
return vec_; }
145 ace
const int lane() {
return lane_; }
148 ace neon::Vec64_t<scalar_type>
vec() {
149 if constexpr (simd::is_doubleword_v<VectorType>) {
151 }
else if constexpr (simd::is_quadword_v<VectorType>) {
153 return simd::get_high(vec_);
155 return simd::get_low(vec_);
161 if constexpr (simd::is_doubleword_v<VectorType>) {
163 }
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:94
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:71
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:82
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:73
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane.
Definition lane.hpp:59
Represents a single lane of a SIMD vector with a runtime-determined index.
Definition lane.hpp:116
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:135
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane and return the updated vector.
Definition lane.hpp:127
ace int lane()
Definition lane.hpp:160
ace Lane(VectorType &vec, const int lane)
Construct a lane accessor bound to vec at runtime index lane.
Definition lane.hpp:123
ace neon::Vec64_t< scalar_type > vec()
Definition lane.hpp:148
ace scalar_type Get() const
Get the scalar value of this lane.
Definition lane.hpp:137
ace argon_type operator=(const scalar_type b)
Write a scalar value into this lane and return the updated vector.
Definition lane.hpp:125
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