4156ac5efdfdafd0b59536d127487412ce645385
[gem5.git] / src / arch / generic / vec_reg.hh
1 /*
2 * Copyright (c) 2015-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38 /** \file arch/generic/vec_reg.hh
39 * Vector Registers layout specification.
40 *
41 * This register type is to be used to model the SIMD registers.
42 * It takes into account the possibility that different architectural names
43 * may overlap (like for ARMv8 AArch32 for example).
44 *
45 * The design is having a basic vector register container that holds the
46 * bytes, unaware of anything else. This is implemented by VecRegContainer.
47 * As the (maximum) length of the physical vector register is a compile-time
48 * constant, it is defined as a template parameter.
49 *
50 * This file also describes two views of the container that have semantic
51 * information about the bytes. The first of this views is VecRegT.
52 * A VecRegT is a view of a VecRegContainer (by reference). The VecRegT has
53 * a type (VecElem) to which bytes are casted, and the amount of such
54 * elements that the vector contains (NumElems). The size of a view,
55 * calculated as sizeof(VecElem) * NumElems must match the size of the
56 * underlying container. As VecRegT has some degree of type information it
57 * has vector semantics, and defines the index operator ([]) to get
58 * references to particular bytes understood as a VecElem.
59 * The second view of a container implemented in this file is VecLaneT, which
60 * is a view of a subset of the container.
61 * A VecLaneT is a view of a lane of a vector register, where a lane is
62 * identified by a type (VecElem) and an index (although the view is
63 * unaware of its index). Operations on the lane are directly applied to
64 * the corresponding bytes of the underlying VecRegContainer through a
65 * reference.
66 *
67 * The intended usage is requesting views to the VecRegContainer via the
68 * member 'as' for VecRegT and the member 'laneView' for VecLaneT. Kindly
69 * find an example of usage in the following.
70 *
71 *
72 * // We declare 512 bits vectors
73 * using Vec512 = VecRegContainer<64>;
74 * ...
75 * // We implement the physical vector register file
76 * Vec512 physicalVecRegFile[NUM_VREGS];
77 * ...
78 * // Usage example, for a macro op:
79 * VecFloat8Add(ExecContext* xd) {
80 * // Request source vector register to the execution context (const as it
81 * // is read only).
82 * const Vec512& vsrc1raw = xc->readVecRegOperand(this, 0);
83 * // View it as a vector of floats (we could just specify the first
84 * // template parametre, the second has a default value that works, and the
85 * // last one is derived by the constness of vsrc1raw).
86 * VecRegT<float, 8, true>& vsrc1 = vsrc1raw->as<float, 8>();
87 *
88 * // Second source and view
89 * const Vec512& vsrc2raw = xc->readVecRegOperand(this, 1);
90 * VecRegT<float, 8, true>& vsrc2 = vsrc2raw->as<float, 8>();
91 *
92 * // Destination and view
93 * Vec512 vdstraw;
94 * VecRegT<float, 8, false>& vdst = vdstraw->as<float, 8>();
95 *
96 * for (auto i = 0; i < 8; i++) {
97 * // This asignment sets the bits in the underlying Vec512: vdstraw
98 * vdst[i] = vsrc1[i] + vsrc2[i];
99 * }
100 * xc->setWriteRegOperand(this, 0, vdstraw);
101 * }
102 *
103 * // Usage example, for a micro op that operates over lane number _lidx:
104 * VecFloatLaneAdd(ExecContext* xd) {
105 * // Request source vector register to the execution context (const as it
106 * // is read only).
107 * const Vec512& vsrc1raw = xc->readVecRegOperand(this, 0);
108 * // View it as a lane of a vector of floats (we could just specify the
109 * // first template parametre, the second is derived by the constness of
110 * // vsrc1raw).
111 * VecLaneT<float, true>& src1 = vsrc1raw->laneView<float>(this->_lidx);
112 *
113 * // Second source and view
114 * const Vec512& vsrc2raw = xc->readVecRegOperand(this, 1);
115 * VecLaneT<float, true>& src2 = vsrc2raw->laneView<float>(this->_lidx);
116 *
117 * // (Writable) destination and view
118 * // As this is a partial write, we need the exec context to support that
119 * // through, e.g., 'readVecRegOperandToWrite' returning a writable
120 * // reference to the register
121 * Vec512 vdstraw = xc->readVecRegOperandToWrite(this, 3);
122 * VecLaneT<float, false>& dst = vdstraw->laneView<float>(this->_lidx);
123 *
124 * dst = src1 + src2;
125 * // There is no need to copy the value back into the exec context, as
126 * // the assignment to dst modifies the appropriate bytes in vdstraw which
127 * // is in turn, a reference to the register in the cpu model.
128 * // For operations that do conditional writeback, we can decouple the
129 * // write by doing:
130 * // auto tmp = src1 + src2;
131 * // if (test) {
132 * // dst = tmp; // do writeback
133 * // } else {
134 * // // do not do writeback
135 * // }
136 * }
137 *
138 */
139
140 #ifndef __ARCH_GENERIC_VEC_REG_HH__
141 #define __ARCH_GENERIC_VEC_REG_HH__
142
143 #include <array>
144 #include <cassert>
145 #include <iostream>
146 #include <string>
147 #include <type_traits>
148 #include <vector>
149
150 #include "base/cprintf.hh"
151 #include "base/logging.hh"
152
153 constexpr unsigned MaxVecRegLenInBytes = 4096;
154
155 template <size_t Sz>
156 class VecRegContainer;
157
158 /** Vector Register Abstraction
159 * This generic class is a view in a particularization of MVC, to vector
160 * registers. There is a VecRegContainer that implements the model, and
161 * contains the data. To that model we can interpose different instantiations
162 * of VecRegT to view the container as a vector of NumElems elems of type
163 * VecElem.
164 * @tparam VecElem Type of each element of the vector.
165 * @tparam NumElems Amount of components of the vector.
166 * @tparam Const Indicate if the underlying container can be modified through
167 * the view.
168 */
169 template <typename VecElem, size_t NumElems, bool Const>
170 class VecRegT
171 {
172 /** Size of the register in bytes. */
173 static constexpr inline size_t
174 size()
175 {
176 return sizeof(VecElem) * NumElems;
177 }
178 public:
179 /** Container type alias. */
180 using Container = typename std::conditional<Const,
181 const VecRegContainer<size()>,
182 VecRegContainer<size()>>::type;
183 private:
184 /** My type alias. */
185 using MyClass = VecRegT<VecElem, NumElems, Const>;
186 /** Reference to container. */
187 Container& container;
188
189 public:
190 /** Constructor. */
191 VecRegT(Container& cnt) : container(cnt) {};
192
193 /** Zero the container. */
194 template<bool Condition = !Const>
195 typename std::enable_if<Condition, void>::type
196 zero() { container.zero(); }
197
198 template<bool Condition = !Const>
199 typename std::enable_if<Condition, MyClass&>::type
200 operator=(const MyClass& that)
201 {
202 container = that.container;
203 return *this;
204 }
205
206 /** Index operator. */
207 const VecElem& operator[](size_t idx) const
208 {
209 return container.template raw_ptr<VecElem>()[idx];
210 }
211
212 /** Index operator. */
213 template<bool Condition = !Const>
214 typename std::enable_if<Condition, VecElem&>::type
215 operator[](size_t idx)
216 {
217 return container.template raw_ptr<VecElem>()[idx];
218 }
219
220 /** Equality operator.
221 * Required to compare thread contexts.
222 */
223 template<typename VE2, size_t NE2, bool C2>
224 bool
225 operator==(const VecRegT<VE2, NE2, C2>& that) const
226 {
227 return container == that.container;
228 }
229 /** Inequality operator.
230 * Required to compare thread contexts.
231 */
232 template<typename VE2, size_t NE2, bool C2>
233 bool
234 operator!=(const VecRegT<VE2, NE2, C2>& that) const
235 {
236 return !operator==(that);
237 }
238
239 /** Output stream operator. */
240 friend std::ostream&
241 operator<<(std::ostream& os, const MyClass& vr)
242 {
243 /* 0-sized is not allowed */
244 os << "[" << std::hex << (uint32_t)vr[0];
245 for (uint32_t e = 1; e < vr.size(); e++)
246 os << " " << std::hex << (uint32_t)vr[e];
247 os << ']';
248 return os;
249 }
250
251 const std::string print() const { return csprintf("%s", *this); }
252 /**
253 * Cast to VecRegContainer&
254 * It is useful to get the reference to the container for ISA tricks,
255 * because casting to reference prevents unnecessary copies.
256 */
257 operator Container&() { return container; }
258 };
259
260 /* Forward declaration. */
261 template <typename VecElem, bool Const>
262 class VecLaneT;
263
264 /**
265 * Vector Register Abstraction
266 * This generic class is the model in a particularization of MVC, to vector
267 * registers. The model has functionality to create views of itself, or a
268 * portion through the method 'as
269 * @tparam Sz Size of the container in bytes.
270 */
271 template <size_t SIZE>
272 class VecRegContainer
273 {
274 static_assert(SIZE > 0,
275 "Cannot create Vector Register Container of zero size");
276 static_assert(SIZE <= MaxVecRegLenInBytes,
277 "Vector Register size limit exceeded");
278 public:
279 static constexpr inline size_t size() { return SIZE; };
280 using Container = std::array<uint8_t, SIZE>;
281 private:
282 Container container;
283 using MyClass = VecRegContainer<SIZE>;
284
285 public:
286 VecRegContainer() {}
287 VecRegContainer(const VecRegContainer &) = default;
288 /* This is required for de-serialisation. */
289 VecRegContainer(const std::vector<uint8_t>& that)
290 {
291 assert(that.size() >= SIZE);
292 std::memcpy(container.data(), &that[0], SIZE);
293 }
294
295 /** Zero the container. */
296 void zero() { memset(container.data(), 0, SIZE); }
297
298 /** Assignment operators. */
299 /** @{ */
300 /** From VecRegContainer */
301 MyClass& operator=(const MyClass& that)
302 {
303 if (&that == this)
304 return *this;
305 memcpy(container.data(), that.container.data(), SIZE);
306 return *this;
307 }
308
309 /** From appropriately sized uint8_t[]. */
310 MyClass& operator=(const Container& that)
311 {
312 std::memcpy(container.data(), that.data(), SIZE);
313 return *this;
314 }
315
316 /** From vector<uint8_t>.
317 * This is required for de-serialisation.
318 * */
319 MyClass& operator=(const std::vector<uint8_t>& that)
320 {
321 assert(that.size() >= SIZE);
322 std::memcpy(container.data(), that.data(), SIZE);
323 return *this;
324 }
325 /** @} */
326
327 /** Copy the contents into the input buffer. */
328 /** @{ */
329 /** To appropriately sized uint8_t[] */
330 void copyTo(Container& dst) const
331 {
332 std::memcpy(dst.data(), container.data(), SIZE);
333 }
334
335 /** To vector<uint8_t>
336 * This is required for serialisation.
337 * */
338 void copyTo(std::vector<uint8_t>& dst) const
339 {
340 dst.resize(SIZE);
341 std::memcpy(dst.data(), container.data(), SIZE);
342 }
343 /** @} */
344
345 /** Equality operator.
346 * Required to compare thread contexts.
347 */
348 template<size_t S2>
349 inline bool
350 operator==(const VecRegContainer<S2>& that) const
351 {
352 return SIZE == S2 &&
353 !memcmp(container.data(), that.container.data(), SIZE);
354 }
355 /** Inequality operator.
356 * Required to compare thread contexts.
357 */
358 template<size_t S2>
359 bool
360 operator!=(const VecRegContainer<S2>& that) const
361 {
362 return !operator==(that);
363 }
364
365 const std::string print() const { return csprintf("%s", *this); }
366 /** Get pointer to bytes. */
367 template <typename Ret>
368 const Ret* raw_ptr() const { return (const Ret*)container.data(); }
369
370 template <typename Ret>
371 Ret* raw_ptr() { return (Ret*)container.data(); }
372
373 /**
374 * View interposers.
375 * Create a view of this container as a vector of VecElems with an
376 * optional amount of elements. If the amount of elements is provided,
377 * the size of the container is checked, to test bounds. If it is not
378 * provided, the length is inferred from the container size and the
379 * element size.
380 * @tparam VecElem Type of each element of the vector for the view.
381 * @tparam NumElem Amount of elements in the view.
382 */
383 /** @{ */
384 template <typename VecElem, size_t NumElems=(SIZE / sizeof(VecElem))>
385 VecRegT<VecElem, NumElems, true> as() const
386 {
387 static_assert(SIZE % sizeof(VecElem) == 0,
388 "VecElem does not evenly divide the register size");
389 static_assert(sizeof(VecElem) * NumElems <= SIZE,
390 "Viewing VecReg as something bigger than it is");
391 return VecRegT<VecElem, NumElems, true>(*this);
392 }
393
394 template <typename VecElem, size_t NumElems=(SIZE / sizeof(VecElem))>
395 VecRegT<VecElem, NumElems, false> as()
396 {
397 static_assert(SIZE % sizeof(VecElem) == 0,
398 "VecElem does not evenly divide the register size");
399 static_assert(sizeof(VecElem) * NumElems <= SIZE,
400 "Viewing VecReg as something bigger than it is");
401 return VecRegT<VecElem, NumElems, false>(*this);
402 }
403
404 template <typename VecElem, int LaneIdx>
405 VecLaneT<VecElem, false> laneView();
406 template <typename VecElem, int LaneIdx>
407 VecLaneT<VecElem, true> laneView() const;
408 template <typename VecElem>
409 VecLaneT<VecElem, false> laneView(int laneIdx);
410 template <typename VecElem>
411 VecLaneT<VecElem, true> laneView(int laneIdx) const;
412 /** @} */
413 /**
414 * Output operator.
415 * Used for serialization.
416 */
417 friend std::ostream& operator<<(std::ostream& os, const MyClass& v)
418 {
419 for (auto& b: v.container) {
420 os << csprintf("%02x", b);
421 }
422 return os;
423 }
424 };
425
426 /** We define an auxiliary abstraction for LaneData. The ISA should care
427 * about the semantics of a, e.g., 32bit element, treating it as a signed or
428 * unsigned int, or a float depending on the semantics of a particular
429 * instruction. On the other hand, the cpu model should only care about it
430 * being a 32-bit value. */
431 enum class LaneSize
432 {
433 Empty = 0,
434 Byte,
435 TwoByte,
436 FourByte,
437 EightByte,
438 };
439
440 /** LaneSize is an abstraction of a LS byte value for the execution and thread
441 * contexts to handle values just depending on its width. That way, the ISA
442 * can request, for example, the second 4 byte lane of register 5 to the model.
443 * The model serves that value, agnostic of the semantics of those bits. Then,
444 * it is up to the ISA to interpret those bits as a float, or as an uint.
445 * To maximize the utility, this class implements the assignment operator and
446 * the casting to equal-size types.
447 * As opposed to a RegLaneT, LaneData is not 'backed' by a VecRegContainer.
448 * The idea is:
449 * When data is passed and is susceptible to being copied, use LaneData, as
450 * copying the primitive type is build on is cheap.
451 * When data is passed as references (const or not), use RegLaneT, as all
452 * operations happen 'in place', avoiding any copies (no copies is always
453 * cheaper than cheap copies), especially when things are inlined, and
454 * references are not explicitly passed.
455 */
456 template <LaneSize LS>
457 class LaneData
458 {
459 public:
460 /** Alias to the native type of the appropriate size. */
461 using UnderlyingType =
462 typename std::conditional<LS == LaneSize::EightByte, uint64_t,
463 typename std::conditional<LS == LaneSize::FourByte, uint32_t,
464 typename std::conditional<LS == LaneSize::TwoByte, uint16_t,
465 typename std::conditional<LS == LaneSize::Byte, uint8_t,
466 void>::type
467 >::type
468 >::type
469 >::type;
470 private:
471 static constexpr auto ByteSz = sizeof(UnderlyingType);
472 UnderlyingType _val;
473 using MyClass = LaneData<LS>;
474
475 public:
476 template <typename T> explicit
477 LaneData(typename std::enable_if<sizeof(T) == ByteSz, const T&>::type t)
478 : _val(t) {}
479
480 template <typename T>
481 typename std::enable_if<sizeof(T) == ByteSz, MyClass&>::type
482 operator=(const T& that)
483 {
484 _val = that;
485 return *this;
486 }
487 template<typename T,
488 typename std::enable_if<sizeof(T) == ByteSz, int>::type I = 0>
489 operator T() const {
490 return *static_cast<const T*>(&_val);
491 }
492 };
493
494 /** Output operator overload for LaneData<Size>. */
495 template <LaneSize LS>
496 inline std::ostream&
497 operator<<(std::ostream& os, const LaneData<LS>& d)
498 {
499 return os << static_cast<typename LaneData<LS>::UnderlyingType>(d);
500 }
501
502 /** Vector Lane abstraction
503 * Another view of a container. This time only a partial part of it is exposed.
504 * @tparam VecElem Type of each element of the vector.
505 * @tparam Const Indicate if the underlying container can be modified through
506 * the view.
507 */
508 /** @{ */
509 /* General */
510 template <typename VecElem, bool Const>
511 class VecLaneT
512 {
513 public:
514 /** VecRegContainer friendship to access private VecLaneT constructors.
515 * Only VecRegContainers can build VecLanes.
516 */
517 /** @{ */
518 friend VecLaneT<VecElem, !Const>;
519
520 /*template <size_t Sz>
521 friend class VecRegContainer;*/
522 friend class VecRegContainer<8>;
523 friend class VecRegContainer<16>;
524 friend class VecRegContainer<32>;
525 friend class VecRegContainer<64>;
526 friend class VecRegContainer<128>;
527 friend class VecRegContainer<256>;
528 friend class VecRegContainer<MaxVecRegLenInBytes>;
529
530 /** My type alias. */
531 using MyClass = VecLaneT<VecElem, Const>;
532
533 private:
534 using Cont = typename std::conditional<Const,
535 const VecElem,
536 VecElem>::type;
537 static_assert(!std::is_const<VecElem>::value || Const,
538 "Asked for non-const lane of const type!");
539 static_assert(std::is_integral<VecElem>::value,
540 "VecElem type is not integral!");
541 /** Reference to data. */
542 Cont& container;
543
544 /** Constructor */
545 VecLaneT(Cont& cont) : container(cont) { }
546
547 public:
548 /** Assignment operators.
549 * Assignment operators are only enabled if the underlying container is
550 * non-constant.
551 */
552 /** @{ */
553 template <bool Assignable = !Const>
554 typename std::enable_if<Assignable, MyClass&>::type
555 operator=(const VecElem& that) {
556 container = that;
557 return *this;
558 }
559 /**
560 * Generic.
561 * Generic bitwise assignment. Narrowing and widening assignemnts are
562 * not allowed, pre-treatment of the rhs is required to conform.
563 */
564 template <bool Assignable = !Const, typename T>
565 typename std::enable_if<Assignable, MyClass&>::type
566 operator=(const T& that) {
567 static_assert(sizeof(T) >= sizeof(VecElem),
568 "Attempt to perform widening bitwise copy.");
569 static_assert(sizeof(T) <= sizeof(VecElem),
570 "Attempt to perform narrowing bitwise copy.");
571 container = static_cast<VecElem>(that);
572 return *this;
573 }
574 /** @} */
575 /** Cast to vecElem. */
576 operator VecElem() const { return container; }
577
578 /** Constification. */
579 template <bool Cond = !Const, typename std::enable_if<Cond, int>::type = 0>
580 operator VecLaneT<typename std::enable_if<Cond, VecElem>::type, true>()
581 {
582 return VecLaneT<VecElem, true>(container);
583 }
584 };
585
586 namespace std {
587 template<typename T, bool Const>
588 struct add_const<VecLaneT<T, Const>> { typedef VecLaneT<T, true> type; };
589 }
590
591 /** View as the Nth lane of type VecElem. */
592 template <size_t Sz>
593 template <typename VecElem, int LaneIdx>
594 VecLaneT<VecElem, false>
595 VecRegContainer<Sz>::laneView()
596 {
597 return VecLaneT<VecElem, false>(as<VecElem>()[LaneIdx]);
598 }
599
600 /** View as the const Nth lane of type VecElem. */
601 template <size_t Sz>
602 template <typename VecElem, int LaneIdx>
603 VecLaneT<VecElem, true>
604 VecRegContainer<Sz>::laneView() const
605 {
606 return VecLaneT<VecElem, true>(as<VecElem>()[LaneIdx]);
607 }
608
609 /** View as the Nth lane of type VecElem. */
610 template <size_t Sz>
611 template <typename VecElem>
612 VecLaneT<VecElem, false>
613 VecRegContainer<Sz>::laneView(int laneIdx)
614 {
615 return VecLaneT<VecElem, false>(as<VecElem>()[laneIdx]);
616 }
617
618 /** View as the const Nth lane of type VecElem. */
619 template <size_t Sz>
620 template <typename VecElem>
621 VecLaneT<VecElem, true>
622 VecRegContainer<Sz>::laneView(int laneIdx) const
623 {
624 return VecLaneT<VecElem, true>(as<VecElem>()[laneIdx]);
625 }
626
627 using VecLane8 = VecLaneT<uint8_t, false>;
628 using VecLane16 = VecLaneT<uint16_t, false>;
629 using VecLane32 = VecLaneT<uint32_t, false>;
630 using VecLane64 = VecLaneT<uint64_t, false>;
631
632 using ConstVecLane8 = VecLaneT<uint8_t, true>;
633 using ConstVecLane16 = VecLaneT<uint16_t, true>;
634 using ConstVecLane32 = VecLaneT<uint32_t, true>;
635 using ConstVecLane64 = VecLaneT<uint64_t, true>;
636
637 /**
638 * Calls required for serialization/deserialization
639 */
640 /** @{ */
641 template <size_t Sz>
642 inline bool
643 to_number(const std::string& value, VecRegContainer<Sz>& v)
644 {
645 fatal_if(value.size() > 2 * VecRegContainer<Sz>::size(),
646 "Vector register value overflow at unserialize");
647
648 for (int i = 0; i < VecRegContainer<Sz>::size(); i++) {
649 uint8_t b = 0;
650 if (2 * i < value.size())
651 b = stoul(value.substr(i * 2, 2), nullptr, 16);
652 v.template raw_ptr<uint8_t>()[i] = b;
653 }
654 return true;
655 }
656 /** @} */
657
658 /**
659 * Dummy type aliases and constants for architectures that do not implement
660 * vector registers.
661 */
662 /** @{ */
663 using DummyVecElem = uint32_t;
664 constexpr unsigned DummyNumVecElemPerVecReg = 2;
665 using DummyVecReg = VecRegT<DummyVecElem, DummyNumVecElemPerVecReg, false>;
666 using DummyConstVecReg = VecRegT<DummyVecElem, DummyNumVecElemPerVecReg, true>;
667 using DummyVecRegContainer = DummyVecReg::Container;
668 constexpr size_t DummyVecRegSizeBytes = DummyNumVecElemPerVecReg *
669 sizeof(DummyVecElem);
670 /** @} */
671
672 #endif /* __ARCH_GENERIC_VEC_REG_HH__ */