Lines Matching defs:VecElem

57  *    a type (VecElem) to which bytes are casted, and the amount of such
59 * calculated as sizeof(VecElem) * NumElems must match the size of the
62 * references to particular bytes understood as a VecElem.
66 * identified by a type (VecElem) and an index (although the view is
167 * VecElem.
168 * @tparam VecElem Type of each element of the vector.
173 template <typename VecElem, size_t NumElems, bool Const>
177 static constexpr size_t SIZE = sizeof(VecElem) * NumElems;
185 using MyClass = VecRegT<VecElem, NumElems, Const>;
207 const VecElem& operator[](size_t idx) const
209 return container.template raw_ptr<VecElem>()[idx];
214 typename std::enable_if<Condition, VecElem&>::type
217 return container.template raw_ptr<VecElem>()[idx];
261 template <typename VecElem, bool Const>
379 * @tparam VecElem Type of each element of the vector for the view.
383 template <typename VecElem, size_t NumElems = SIZE/sizeof(VecElem)>
384 VecRegT<VecElem, NumElems, true> as() const
386 static_assert(SIZE % sizeof(VecElem) == 0,
387 "VecElem does not evenly divide the register size");
388 static_assert(sizeof(VecElem) * NumElems <= SIZE,
390 return VecRegT<VecElem, NumElems, true>(*this);
393 template <typename VecElem, size_t NumElems = SIZE/sizeof(VecElem)>
394 VecRegT<VecElem, NumElems, false> as()
396 static_assert(SIZE % sizeof(VecElem) == 0,
397 "VecElem does not evenly divide the register size");
398 static_assert(sizeof(VecElem) * NumElems <= SIZE,
400 return VecRegT<VecElem, NumElems, false>(*this);
403 template <typename VecElem, int LaneIdx>
404 VecLaneT<VecElem, false> laneView();
405 template <typename VecElem, int LaneIdx>
406 VecLaneT<VecElem, true> laneView() const;
407 template <typename VecElem>
408 VecLaneT<VecElem, false> laneView(int laneIdx);
409 template <typename VecElem>
410 VecLaneT<VecElem, true> laneView(int laneIdx) const;
503 * @tparam VecElem Type of each element of the vector.
509 template <typename VecElem, bool Const>
517 friend VecLaneT<VecElem, !Const>;
530 using MyClass = VecLaneT<VecElem, Const>;
534 const VecElem,
535 VecElem>::type;
536 static_assert(!std::is_const<VecElem>::value || Const,
538 static_assert(std::is_integral<VecElem>::value,
539 "VecElem type is not integral!");
554 operator=(const VecElem& that) {
566 static_assert(sizeof(T) >= sizeof(VecElem),
568 static_assert(sizeof(T) <= sizeof(VecElem),
570 container = static_cast<VecElem>(that);
575 operator VecElem() const { return container; }
579 operator VecLaneT<typename std::enable_if<Cond, VecElem>::type, true>()
581 return VecLaneT<VecElem, true>(container);
590 /** View as the Nth lane of type VecElem. */
592 template <typename VecElem, int LaneIdx>
593 VecLaneT<VecElem, false>
596 return VecLaneT<VecElem, false>(as<VecElem>()[LaneIdx]);
599 /** View as the const Nth lane of type VecElem. */
601 template <typename VecElem, int LaneIdx>
602 VecLaneT<VecElem, true>
605 return VecLaneT<VecElem, true>(as<VecElem>()[LaneIdx]);
608 /** View as the Nth lane of type VecElem. */
610 template <typename VecElem>
611 VecLaneT<VecElem, false>
614 return VecLaneT<VecElem, false>(as<VecElem>()[laneIdx]);
617 /** View as the const Nth lane of type VecElem. */
619 template <typename VecElem>
620 VecLaneT<VecElem, true>
623 return VecLaneT<VecElem, true>(as<VecElem>()[laneIdx]);