Fix formatting on vle_vse, vsetvl and test_v_helpers.
Change-Id: I25723c65b0e8d631764ecee27fa6edde6b11dac4
diff --git a/tests/include/test_v_helpers.h b/tests/include/test_v_helpers.h
index 82818f0..9debe8b 100644
--- a/tests/include/test_v_helpers.h
+++ b/tests/include/test_v_helpers.h
@@ -6,9 +6,9 @@
namespace test_v_helpers {
const int32_t AVLS[] = {1, 4, 3, 2, 16, 8, 5, 17,
- 32, 36, 64, 55, 100, 321, 256, 128,
- 512, 623, 1024, 1100, 1543, 2048, 3052, 4096,
- 5555, 8192, 10241, 16384, 24325, 32768};
+ 32, 36, 64, 55, 100, 321, 256, 128,
+ 512, 623, 1024, 1100, 1543, 2048, 3052, 4096,
+ 5555, 8192, 10241, 16384, 24325, 32768};
const int32_t AVL_COUNT = sizeof(AVLS) / sizeof(AVLS[0]);
enum VSEW {
diff --git a/tests/vle_vse_test.cpp b/tests/vle_vse_test.cpp
index 5f269da..7e5ff03 100644
--- a/tests/vle_vse_test.cpp
+++ b/tests/vle_vse_test.cpp
@@ -1,9 +1,9 @@
#include <riscv_vector.h>
-#include <stddef.h>
#include <springbok_intrinsics.h>
+#include <stddef.h>
-#include "test_v_helpers.h"
#include "pw_unit_test/framework.h"
+#include "test_v_helpers.h"
namespace vle_vse_test {
namespace {
@@ -21,7 +21,7 @@
static void vle8vse8_test(VSEW sew, VLMUL lmul, bool use_intrinsic) {
int vlmax = get_vsetvlmax_intrinsic(sew, lmul);
- for (int avl = 0; avl <= vlmax; avl+=AVL_STEP) {
+ for (int avl = 0; avl <= vlmax; avl += AVL_STEP) {
// clear arrays
memset(test_vector_1, 0, MAXVL_BYTES);
memset(test_vector_2, 0, MAXVL_BYTES);
@@ -35,15 +35,13 @@
// load c-array values into vector
// TODO(gkielian): utilize intrinsics for vle
if (use_intrinsic) {
-
} else {
- __asm__ volatile("vle8.v v0, (%0)" : : "r" (test_vector_1));
+ __asm__ volatile("vle8.v v0, (%0)" : : "r"(test_vector_1));
// 2) store the vector back into memory (into result c-array)
- __asm__ volatile("vse8.v v0, (%0)" : : "r" (test_vector_2));
- }
- for(int idx = 0; idx < MAXVL_BYTES; idx++)
- {
+ __asm__ volatile("vse8.v v0, (%0)" : : "r"(test_vector_2));
+ }
+ for (int idx = 0; idx < MAXVL_BYTES; idx++) {
ASSERT_EQ(test_vector_1[idx], test_vector_2[idx]);
}
}
@@ -66,5 +64,4 @@
}
} // namespace
-} // namespace test_vle_vse
-
+} // namespace vle_vse_test
diff --git a/tests/vsetvl_test.cpp b/tests/vsetvl_test.cpp
index b824144..8e926c3 100644
--- a/tests/vsetvl_test.cpp
+++ b/tests/vsetvl_test.cpp
@@ -3,8 +3,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include "test_v_helpers.h"
#include "pw_unit_test/framework.h"
+#include "test_v_helpers.h"
namespace vsetvl_test {
namespace {
@@ -13,7 +13,6 @@
const uint64_t VLEN = 512u;
-
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
static uint32_t calculate_vl(uint32_t sew, uint32_t avl, float lmul) {
@@ -73,7 +72,7 @@
}
TEST(VsetvlTest, vsetvl_e32m4) {
- test_vsetvl(VSEW::SEW_E32, VLMUL::LMUL_M4, 32, 4.0);
+ test_vsetvl(VSEW::SEW_E32, VLMUL::LMUL_M4, 32, 4.0);
}
TEST(VsetvlTest, vsetvl_e8m8) {
@@ -137,4 +136,4 @@
}
} // namespace
-} // namespace test_vsetvl
+} // namespace vsetvl_test