5#include "arm_simd/helpers/scalar.hpp"
6#include "arm_simd/helpers/vec64.hpp"
8#include "helpers/argon_for.hpp"
10#ifdef __ARM_FEATURE_MVE
16#ifdef ARGON_PLATFORM_SIMDE
17#define ace [[gnu::always_inline]] inline
19#define ace [[gnu::always_inline]] constexpr
21#define ace [[gnu::always_inline]] inline
34template <
size_t LaneIndex,
typename VectorType>
36 using vector_type = std::remove_const_t<VectorType>;
37 using scalar_type = simd::Scalar_t<vector_type>;
45 ace
operator scalar_type()
const {
return Get(); }
47 ace argon_type
operator=(
const scalar_type b) {
return vec_ =
Set(b); }
50 ace argon_type
Load(
const scalar_type* ptr) {
51#ifdef ARGON_PLATFORM_MVE
52 return vec_ =
Set(*ptr);
54 if constexpr (simd::is_quadword_v<vector_type>) {
55 return vec_ = argon_type{simd::load1_lane_quad<LaneIndex>(ptr, vec_)};
57 return vec_ = argon_type{simd::load1_lane<LaneIndex>(ptr, vec_)};
62 ace argon_type
Set(
const scalar_type b) {
return argon_type{simd::set_lane<LaneIndex>(b, vec_)}; }
64 ace scalar_type
Get()
const {
return simd::get_lane<LaneIndex>(vec_); }
68 ace vector_type
vec() {
return vec_; }
70 ace
const int lane() {
return LaneIndex; }
73 ace neon::Vec64_t<scalar_type>
vec() {
74 if constexpr (simd::is_doubleword_v<vector_type>) {
76 }
else if constexpr (simd::is_quadword_v<vector_type>) {
78 return simd::get_high(vec_);
80 return simd::get_low(vec_);
86 if constexpr (simd::is_doubleword_v<vector_type>) {
88 }
else if constexpr (simd::is_quadword_v<vector_type>) {
106template <
typename VectorType>
108 using vector_type = std::remove_const_t<VectorType>;
109 using scalar_type = simd::Scalar_t<vector_type>;
117 ace argon_type
operator=(
const scalar_type b) {
return vec_ =
Set(b); }
120 ace argon_type
Load(
const scalar_type* ptr) {
121#ifdef ARGON_PLATFORM_MVE
122 return vec_ =
Set(*ptr);
124 return vec_ = argon_type{simd::load1_lane(vec_, lane_, ptr)};
128 ace argon_type
Set(
const scalar_type b) {
return argon_type{simd::set_lane(vec_, lane_, b)}; }
130 ace scalar_type
Get()
const {
return simd::get_lane(vec_, lane_); }
132 ace
operator scalar_type()
const {
return Get(); }
136 ace vector_type
vec() {
return vec_; }
138 ace
const int lane() {
return lane_; }
141 ace neon::Vec64_t<scalar_type>
vec() {
142 if constexpr (simd::is_doubleword_v<vector_type>) {
144 }
else if constexpr (simd::is_quadword_v<vector_type>) {
146 return simd::get_high(vec_);
148 return simd::get_low(vec_);
154 if constexpr (simd::is_doubleword_v<vector_type>) {
156 }
else if constexpr (simd::is_quadword_v<vector_type>) {
Definition argon_half.hpp:11
ace int lane()
On ARM32, return the local lane index within the 64-bit half-register returned by vec().
Definition lane.hpp:85
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:62
ace argon_type operator=(const scalar_type b)
Write a scalar value into this lane and return the updated vector.
Definition lane.hpp:47
ace neon::Vec64_t< scalar_type > vec()
On ARM32, return the 64-bit half-register that contains this lane.
Definition lane.hpp:73
ace ConstLane(VectorType &vec)
Construct a lane accessor bound to vec.
Definition lane.hpp:43
ace scalar_type Get() const
Get the scalar value of this lane.
Definition lane.hpp:64
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane and return the updated vector.
Definition lane.hpp:50
ace argon_type Set(const scalar_type b)
Set this lane to b and return the updated vector.
Definition lane.hpp:128
ace argon_type Load(const scalar_type *ptr)
Load a scalar from ptr into this lane and return the updated vector.
Definition lane.hpp:120
ace int lane()
Definition lane.hpp:153
ace Lane(VectorType &vec, const int lane)
Construct a lane accessor bound to vec at runtime index lane.
Definition lane.hpp:115
ace neon::Vec64_t< scalar_type > vec()
Definition lane.hpp:141
ace scalar_type Get() const
Get the scalar value of this lane.
Definition lane.hpp:130
ace argon_type operator=(const scalar_type b)
Write a scalar value into this lane and return the updated vector.
Definition lane.hpp:117
Represents a SIMD vector with various operations.
Definition vector.hpp:53
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:46
A 128-bit SIMD vector wrapping a scalar type, providing arithmetic, logical, and data-movement operat...
Definition argon.hpp:30