38#include <gtest/gtest.h>
49 ASSERT_EQ(1,
vec.size());
56 ASSERT_EQ(size,
vec.size());
68 constexpr size_t size = 16;
70 auto *vec_ptr =
vec.
as<uint8_t>();
73 for (
auto idx = 0; idx < size; idx++) {
81 for (
auto idx = 0; idx < size; idx++) {
82 ASSERT_EQ(vec_ptr[idx], 0);
101 for (
auto idx = 0; idx <
vec1.
size(); idx++) {
106 for (
auto idx = 0; idx <
vec2.
size(); idx++) {
119 for (
auto idx = 0; idx < vec2.size(); idx++) {
120 ASSERT_EQ(vec2_ptr[idx], 0xAA);
128 ASSERT_TRUE(vec1 == vec1);
129 ASSERT_TRUE(vec2 == vec2);
130 ASSERT_FALSE(vec1 == vec2);
137 ASSERT_FALSE(vec1 != vec1);
138 ASSERT_FALSE(vec2 != vec2);
139 ASSERT_TRUE(vec1 != vec2);
146 std::ostringstream stream;
148 ASSERT_EQ(stream.str(),
"[aaaaaaaa_aaaaaaaa_aaaaaaaa_aaaaaaaa]");
152 std::ostringstream stream;
154 ASSERT_EQ(stream.str(),
"[00000000_00000000_00000000_00000000]");
163 parser.parse(
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", vec1);
164 parser.parse(
"cccccccccccccccccccccccccccccccc", vec2);
166 for (
auto idx = 0; idx < 2; idx++) {
167 ASSERT_EQ(vec1_ptr[idx], 0xbb);
168 ASSERT_EQ(vec2_ptr[idx], 0xcc);
178 std::stringstream
ss;
180 ASSERT_EQ(
ss.str(),
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
184 std::stringstream
ss;
185 parser.show(
ss, vec2);
186 ASSERT_EQ(
ss.str(),
"00000000000000000000000000000000");
VecRegContainer< 16 > vec1
VecRegContainer< 16 > vec2
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
static constexpr size_t size()
VecElem * as()
View interposers.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
constexpr unsigned MaxVecRegLenInBytes
static void show(std::ostream &os, const T &value)
Vector Registers layout specification.
TEST_F(TwoDifferentVecRegs, Assignment)