Lint cleanup Change-Id: I4a1929c38c6a901281428bdc015cf1fb03a201a7
diff --git a/cmake/riscv_baremetal.cmake b/cmake/riscv_baremetal.cmake index fe9375f..24de4c3 100644 --- a/cmake/riscv_baremetal.cmake +++ b/cmake/riscv_baremetal.cmake
@@ -59,6 +59,7 @@ # Use Nano header and libraries. include_directories(BEFORE SYSTEM "${RISCV_TOOLCHAIN_ROOT}/../riscv32-unknown-elf/include/newlib-nano/") link_directories(BEFORE "${RISCV_TOOLCHAIN_ROOT}/../riscv32-unknown-elf/lib/newlib-nano") + set(VEC_DEFAULT_LINKOPTS "${VEC_DEFAULT_LINKOPTS}" "-Wl,--no-warn-rwx-segments") else() set(CMAKE_SYSTEM_PROCESSOR rv32imv)
diff --git a/cmake/vec_cc_binary.cmake b/cmake/vec_cc_binary.cmake index 1bb000a..6092d61 100644 --- a/cmake/vec_cc_binary.cmake +++ b/cmake/vec_cc_binary.cmake
@@ -27,7 +27,7 @@ set(_ELF_NAME "${_RULE_NAME}.elf") add_executable(${_ELF_NAME}) -target_include_directories(${_ELF_NAME} PUBLIC include) +target_include_directories(${_ELF_NAME} PUBLIC ${CMAKE_SOURCE_DIR}) set_target_properties(${_ELF_NAME} PROPERTIES LINK_DEPENDS "${LINKER_SCRIPT}") target_sources(${_ELF_NAME}
diff --git a/faults/layout.h b/faults/layout.h index b3da0be..84ca0b4 100644 --- a/faults/layout.h +++ b/faults/layout.h
@@ -14,11 +14,11 @@ * limitations under the License. */ -#ifndef LAYOUT_H_ -#define LAYOUT_H_ +#ifndef FAULTS_LAYOUT_H_ +#define FAULTS_LAYOUT_H_ #define MMU_NUM_WINDOWS 6 #define MMU_WINDOW_SIZE 0x1000000 #define MMU_RANGE_START 0x34000000 -#endif +#endif // FAULTS_LAYOUT_H_
diff --git a/hello_vec/main.cpp b/hello_vec/main.cpp index 42984c4..37f70e8 100644 --- a/hello_vec/main.cpp +++ b/hello_vec/main.cpp
@@ -18,7 +18,7 @@ #include <springbok.h> class ExampleStatic { -public: + public: ExampleStatic() { springbok_simprint_error("Hello pre-main C++ world.", 0); value = 1279;
diff --git a/pw_unit_test_demo/pw_unit_test_demo.cpp b/pw_unit_test_demo/pw_unit_test_demo.cpp index af02a37..fa5211e 100644 --- a/pw_unit_test_demo/pw_unit_test_demo.cpp +++ b/pw_unit_test_demo/pw_unit_test_demo.cpp
@@ -25,8 +25,8 @@ TEST(SpringbokTest, ExceptBool) { size_t vl = __riscv_vsetvl_e8m1(32); - EXPECT_TRUE(vl == 32); + EXPECT_EQ(vl, 32); } -} // namespace -} // namespace pw_unit_test_demo +} // namespace +} // namespace pw_unit_test_demo
diff --git a/scripts/generate_vector_tests.py b/scripts/generate_vector_tests.py index 55f470e..1d59bc8 100644 --- a/scripts/generate_vector_tests.py +++ b/scripts/generate_vector_tests.py
@@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" +""" Generate tests for softrvv + Generate tests for softrvv TODO(henryherman) Look into combining the different template workflows """ import os import logging import argparse -from collections import namedtuple from pathlib import Path from mako.lookup import TemplateLookup @@ -51,13 +51,13 @@ try: template = mylookup.get_template(args.template_name) except mako.exceptions.TopLevelLookupException: - parser.error("Template does not exist %s" % args.template_name) + parser.error(f"Template does not exist {args.template_name}") logging.debug("Template %s found", args.template_name) Path(args.out_path).mkdir(parents=True, exist_ok=True) outfile_name = args.template_name.replace(".tpl", "") full_outfile_path = os.path.join(args.out_path, outfile_name) logging.debug("Generating file %s", full_outfile_path) - with open(full_outfile_path, "w+") as outfile: + with open(full_outfile_path, "w+", encoding="UTF-8") as outfile: outfile.write(template.render(op=args.op)) if __name__ == "__main__":
diff --git a/scripts/vec_test_helpers/__init__.py b/scripts/vec_test_helpers/__init__.py index 06e3658..adbc695 100644 --- a/scripts/vec_test_helpers/__init__.py +++ b/scripts/vec_test_helpers/__init__.py
@@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - """ vec_test_helpers This module is for reusable helper functions used by the templates. @@ -21,8 +20,10 @@ import re import numpy as np + class VecTemplateHelper: """Given op and sew provide template with necessary parameters.""" + class OperandType(enum.Enum): """RISC-V V operand type options.""" VECTOR = enum.auto() @@ -37,43 +38,36 @@ NARROWING = enum.auto() mnemonic_suffix = { - OperandType.VECTOR : { + OperandType.VECTOR: { OperandWidth.STANDARD: "vv", OperandWidth.WIDENING: "vv", OperandWidth.NARROWING: "wv", }, - OperandType.SCALAR : { + OperandType.SCALAR: { OperandWidth.STANDARD: "vx", OperandWidth.WIDENING: "vx", OperandWidth.NARROWING: "wx", }, - OperandType.IMMEDIATE : { + OperandType.IMMEDIATE: { OperandWidth.STANDARD: "vi", OperandWidth.WIDENING: "vi", OperandWidth.NARROWING: "wi", }, - OperandType.FLOATSCALAR : { + OperandType.FLOATSCALAR: { OperandWidth.STANDARD: "vf", OperandWidth.WIDENING: "vf", OperandWidth.NARROWING: "wf", }, } - """Helper class for providing params for use in templates""" + def __init__(self, op_code, sew=None): self._op_code = op_code self._sew = sew self.force_unsigned = False - self.signed_np_types = { - 8:np.int8, - 16:np.int16, - 32:np.int32} - self.unsigned_np_types = { - 8:np.uint8, - 16:np.uint16, - 32:np.uint32} - self.float_np_types = { - 32:np.float32} + self.signed_np_types = {8: np.int8, 16: np.int16, 32: np.int32} + self.unsigned_np_types = {8: np.uint8, 16: np.uint16, 32: np.uint32} + self.float_np_types = {32: np.float32} @property def op_code(self): @@ -104,7 +98,7 @@ def sew(self, value): """Set the selected element width.""" if self.is_floating(): - if not (value == 32): + if not value == 32: raise ValueError("Invalid SEW") if not value in (8, 16, 32): raise ValueError("Invalid SEW") @@ -113,21 +107,27 @@ def is_widening(self): """Check if a particular op_code is a widening type.""" if self.is_floating(): - raise ValueError("Widening is not supported with this template for floating point values") + raise ValueError( + "Widening is not supported with this template for floating " + "point values") return self.op_code[1] == 'w' def is_narrowing(self): """Check if a particular op_code is a narrowing type.""" if self.is_floating(): - raise ValueError("Narrowing is not supported with this template for floating point values") + raise ValueError( + "Narrowing is not supported with this template for floating " + "point values") return self.op_code[1] == 'n' def is_destination_mask_register(self): """Check if a particular op_code has a mask output.""" if self.is_floating(): - comparison_ops = ('vmfeq', 'vmfle', 'vmflt', 'vmfne', 'vmfgt', 'vmfge') + comparison_ops = ('vmfeq', 'vmfle', 'vmflt', 'vmfne', 'vmfgt', + 'vmfge') else: - comparison_ops = ('vmseq', 'vmsne', 'vmsltu', 'vmsleu', 'vmsle', 'vmsgtu', 'vmsgt') + comparison_ops = ('vmseq', 'vmsne', 'vmsltu', 'vmsleu', 'vmsle', + 'vmsgtu', 'vmsgt') return self.op_code in comparison_ops def is_unsigned(self): @@ -164,20 +164,20 @@ imm_type won't be used for floating point values. """ VarTypes = collections.namedtuple( - "VarTypes", - ('dest_type', 'src2_type', 'src1_type', 'imm_type')) + "VarTypes", ('dest_type', 'src2_type', 'src1_type', 'imm_type')) if self.is_floating(): - """dest_type is defined as int32_t instead of float - to use "set_bit_in_dest_mask" (in softrvv/include/softrvv_internal.h) - , which has bitwise operations in it. - """ + # dest_type is defined as int32_t instead of float + # to use "set_bit_in_dest_mask" + # (in softrvv/include/softrvv_internal.h), which has bitwise + # operations in it. if self.is_destination_mask_register(): var_types = VarTypes("int32_t", "float", "float", "float") else: var_types = VarTypes("float", "float", "float", "float") else: type_fmt = "%sint%d_t" - sign_type = "u" if self.is_unsigned() or self.force_unsigned else "" + sign_type = "u" if self.is_unsigned( + ) or self.force_unsigned else "" dest_sew, src2_sew, src1_sew, imm_sew = self.get_sew_sizes() dest_type = type_fmt % (sign_type, dest_sew) src1_type = type_fmt % (sign_type, src1_sew) @@ -188,17 +188,21 @@ def get_mnemonic(self, operand_type): """Generate the correct mnemonic given a opcode and operand type.""" - operand_width = self.OperandWidth.STANDARD - if self.is_floating(): - if operand_type == self.OperandType.SCALAR: - operand_type = self.OperandType.FLOATSCALAR - else: + if self.is_floating() and operand_type == self.OperandType.SCALAR: + operand_width = self.OperandWidth.STANDARD + operand_type = self.OperandType.FLOATSCALAR + elif not self.is_floating(): if self.is_narrowing(): operand_width = self.OperandWidth.NARROWING elif self.is_widening(): operand_width = self.OperandWidth.WIDENING + else: + operand_width = self.OperandWidth.STANDARD + else: # default operand_width + operand_width = self.OperandWidth.STANDARD + op_suffix = self.mnemonic_suffix[operand_type][operand_width] - return "%s.%s" % (self.op_code, op_suffix) + return f"{self.op_code}.{op_suffix}" def get_lmuls(self): """Given an op_code return an iterable of valid lmuls.""" @@ -218,7 +222,7 @@ var_types = self.get_var_types() if not self.is_floating(): if self.is_narrowing() or self.is_widening(): - return "%s, %s" % (var_types.dest_type, var_types.src2_type) + return f"{var_types.dest_type}, {var_types.src2_type}" return var_types.src1_type def get_ref_opcode(self): @@ -271,7 +275,7 @@ return types[self.sew * 2] return types[self.sew] - def get_test_inputs(self, n=5, allow_zero=True): # pylint: disable=invalid-name + def get_test_inputs(self, n=5, allow_zero=True): # pylint: disable=invalid-name """Return test inputs.""" src1_np_type = self.get_np_src1_type() src2_np_type = self.get_np_src2_type() @@ -292,16 +296,17 @@ return src2_data, src1_data, rs1 # Return test inputs for integers. + # pylint: disable=redefined-variable-type type_info = np.iinfo(src1_np_type) - src1_data = np.random.randint( - type_info.min, type_info.max, n).astype(src1_np_type) + src1_data = np.random.randint(type_info.min, type_info.max, + n).astype(src1_np_type) rs1 = self.get_np_src1_type()(np.random.randint( type_info.min, type_info.max)) type_info = np.iinfo(src2_np_type) - src2_data = np.random.randint( - type_info.min, type_info.max, n).astype(src2_np_type) + src2_data = np.random.randint(type_info.min, type_info.max, + n).astype(src2_np_type) if not allow_zero: - src2_data[src2_data==0] = 1 + src2_data[src2_data == 0] = 1 rs1 = 1 if rs1 == 0 else rs1 return src2_data, src1_data, rs1 @@ -310,18 +315,22 @@ dest_type = self.get_np_dest_type() return np.packbits(dest_type(values), bitorder='little') + def cast_to_unsigned(arr): """Cast a signed array to an unsigned array. This should not be called with floating point values. """ - udtypes = {np.int8:np.uint8, - np.int16:np.uint16, - np.int32:np.uint32, - np.int64:np.uint64} - if not arr.dtype.type in udtypes.keys(): + udtypes = { + np.int8: np.uint8, + np.int16: np.uint16, + np.int32: np.uint32, + np.int64: np.uint64 + } + if not arr.dtype.type in udtypes: raise TypeError return arr.astype(udtypes[arr.dtype.type]) + def to_carr_str(arr): """Simple function for turn array into comma separated list.""" - return ", ".join(("%s" % x for x in arr)) + return ", ".join((f"{x}" for x in arr))
diff --git a/softrvv/CMakeLists.txt b/softrvv/CMakeLists.txt index 26b62f3..bf3803e 100644 --- a/softrvv/CMakeLists.txt +++ b/softrvv/CMakeLists.txt
@@ -13,6 +13,6 @@ # limitations under the License. add_library(softrvv INTERFACE) -target_include_directories(softrvv INTERFACE include) +target_include_directories(softrvv INTERFACE ${CMAKE_SOURCE_DIR}) add_subdirectory(tests)
diff --git a/softrvv/include/encoding.h b/softrvv/include/encoding.h index 5e99cbd..bb682b4 100644 --- a/softrvv/include/encoding.h +++ b/softrvv/include/encoding.h
@@ -14,8 +14,10 @@ * limitations under the License. */ -#ifndef ENCODING_H -#define ENCODING_H +#ifndef SOFTRVV_INCLUDE_ENCODING_H_ +#define SOFTRVV_INCLUDE_ENCODING_H_ + +#include <stdint.h> #define MSTATUS_UIE 0x00000001 #define MSTATUS_SIE 0x00000002 @@ -65,7 +67,7 @@ #define SSTATUS_VS_MASK \ (SSTATUS_SIE | SSTATUS_SPIE | SSTATUS_SPP | SSTATUS_FS | SSTATUS_SUM | \ - SSTATUS_MXR | SSTATUS_UXL) + SSTATUS_MXR | SSTATUS_UXL) // NOLINT(whitespace/indent) #define HSTATUS_VSXL 0x300000000 #define HSTATUS_VTSR 0x00400000 @@ -261,7 +263,7 @@ #define read_csr(reg) \ ({ \ - unsigned long __tmp; \ + uint32_t __tmp; \ asm volatile("csrr %0, " #reg : "=r"(__tmp)); \ __tmp; \ }) @@ -270,21 +272,21 @@ #define swap_csr(reg, val) \ ({ \ - unsigned long __tmp; \ + uint32_t __tmp; \ asm volatile("csrrw %0, " #reg ", %1" : "=r"(__tmp) : "rK"(val)); \ __tmp; \ }) #define set_csr(reg, bit) \ ({ \ - unsigned long __tmp; \ + uint32_t __tmp; \ asm volatile("csrrs %0, " #reg ", %1" : "=r"(__tmp) : "rK"(bit)); \ __tmp; \ }) #define clear_csr(reg, bit) \ ({ \ - unsigned long __tmp; \ + uint32_t __tmp; \ asm volatile("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "rK"(bit)); \ __tmp; \ }) @@ -293,10 +295,10 @@ #define rdcycle() read_csr(cycle) #define rdinstret() read_csr(instret) -#endif // __GNUC__ +#endif // __GNUC__ -#endif // __ASSEMBLER__ +#endif // __ASSEMBLER__ -#endif // __riscv +#endif // __riscv -#endif // ENCODING_H +#endif // SOFTRVV_INCLUDE_ENCODING_H_
diff --git a/softrvv/include/softrvv.h b/softrvv/include/softrvv.h index dcd4dee..b5c5bcf 100644 --- a/softrvv/include/softrvv.h +++ b/softrvv/include/softrvv.h
@@ -14,54 +14,54 @@ * limitations under the License. */ -#ifndef SOFTRVV_H -#define SOFTRVV_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_H_ #include <stddef.h> #include <stdint.h> -#include "encoding.h" -#include "softrvv_internal.h" -#include "softrvv_vadd.h" -#include "softrvv_vand.h" -#include "softrvv_vdiv.h" -#include "softrvv_vfadd.h" -#include "softrvv_vfdiv.h" -#include "softrvv_vfmax.h" -#include "softrvv_vfmin.h" -#include "softrvv_vfmul.h" -#include "softrvv_vfsub.h" -#include "softrvv_vmadd_vnmsub.h" -#include "softrvv_vmacc.h" -#include "softrvv_vmax.h" -#include "softrvv_vmfeq.h" -#include "softrvv_vmfge.h" -#include "softrvv_vmfgt.h" -#include "softrvv_vmfle.h" -#include "softrvv_vmflt.h" -#include "softrvv_vmfne.h" -#include "softrvv_vmin.h" -#include "softrvv_vmseq.h" -#include "softrvv_vmsge.h" -#include "softrvv_vmsgt.h" -#include "softrvv_vmsle.h" -#include "softrvv_vmslt.h" -#include "softrvv_vmsne.h" -#include "softrvv_vmul_vmulh.h" -#include "softrvv_vmv_s_x.h" -#include "softrvv_vnsra.h" -#include "softrvv_vnsrl.h" -#include "softrvv_vor.h" -#include "softrvv_vredsum.h" -#include "softrvv_vrem.h" -#include "softrvv_vsext_vzext.h" -#include "softrvv_vsll.h" -#include "softrvv_vsra.h" -#include "softrvv_vsrl.h" -#include "softrvv_vsub.h" -#include "softrvv_vwadd.h" -#include "softrvv_vwsub.h" -#include "softrvv_vxor.h" +#include "softrvv/include/encoding.h" +#include "softrvv/include/softrvv_internal.h" +#include "softrvv/include/softrvv_vadd.h" +#include "softrvv/include/softrvv_vand.h" +#include "softrvv/include/softrvv_vdiv.h" +#include "softrvv/include/softrvv_vfadd.h" +#include "softrvv/include/softrvv_vfdiv.h" +#include "softrvv/include/softrvv_vfmax.h" +#include "softrvv/include/softrvv_vfmin.h" +#include "softrvv/include/softrvv_vfmul.h" +#include "softrvv/include/softrvv_vfsub.h" +#include "softrvv/include/softrvv_vmacc.h" +#include "softrvv/include/softrvv_vmadd_vnmsub.h" +#include "softrvv/include/softrvv_vmax.h" +#include "softrvv/include/softrvv_vmfeq.h" +#include "softrvv/include/softrvv_vmfge.h" +#include "softrvv/include/softrvv_vmfgt.h" +#include "softrvv/include/softrvv_vmfle.h" +#include "softrvv/include/softrvv_vmflt.h" +#include "softrvv/include/softrvv_vmfne.h" +#include "softrvv/include/softrvv_vmin.h" +#include "softrvv/include/softrvv_vmseq.h" +#include "softrvv/include/softrvv_vmsge.h" +#include "softrvv/include/softrvv_vmsgt.h" +#include "softrvv/include/softrvv_vmsle.h" +#include "softrvv/include/softrvv_vmslt.h" +#include "softrvv/include/softrvv_vmsne.h" +#include "softrvv/include/softrvv_vmul_vmulh.h" +#include "softrvv/include/softrvv_vmv_s_x.h" +#include "softrvv/include/softrvv_vnsra.h" +#include "softrvv/include/softrvv_vnsrl.h" +#include "softrvv/include/softrvv_vor.h" +#include "softrvv/include/softrvv_vredsum.h" +#include "softrvv/include/softrvv_vrem.h" +#include "softrvv/include/softrvv_vsext_vzext.h" +#include "softrvv/include/softrvv_vsll.h" +#include "softrvv/include/softrvv_vsra.h" +#include "softrvv/include/softrvv_vsrl.h" +#include "softrvv/include/softrvv_vsub.h" +#include "softrvv/include/softrvv_vwadd.h" +#include "softrvv/include/softrvv_vwsub.h" +#include "softrvv/include/softrvv_vxor.h" namespace softrvv { @@ -82,4 +82,4 @@ } // namespace softrvv -#endif // SOFTRVV_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_H_
diff --git a/softrvv/include/softrvv_internal.h b/softrvv/include/softrvv_internal.h index 3df396a..bf52d72 100644 --- a/softrvv/include/softrvv_internal.h +++ b/softrvv/include/softrvv_internal.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_INTERNAL_H -#define SOFTRVV_INTERNAL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_INTERNAL_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_INTERNAL_H_ #include <bit> #include <tuple> @@ -29,7 +29,8 @@ const unsigned int shift = bw_required - 1; // shift is the number of bits required to store the value minus 1 // Example for T is int32_t: - // 32 requires 6 bits to store, the shift required to divide by 32 is 5 (6 - 1) + // 32 requires 6 bits to store, the shift required to divide by 32 is 5 + // (6 - 1) // Shift of the index is equivalent to a divide unsigned int element_idx = index >> shift; // Masked lowers bits are equivalent to remainder @@ -53,4 +54,4 @@ } } // namespace softrvv -#endif // SOFTRVV_INTERNAL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_INTERNAL_H_
diff --git a/softrvv/include/softrvv_vadd.h b/softrvv/include/softrvv_vadd.h index c52169d..b7148f3 100644 --- a/softrvv/include/softrvv_vadd.h +++ b/softrvv/include/softrvv_vadd.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VADD_H -#define SOFTRVV_VADD_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VADD_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VADD_H_ #include <stddef.h> @@ -44,4 +44,4 @@ } // namespace softrvv -#endif // SOFTRVV_VADD_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VADD_H_
diff --git a/softrvv/include/softrvv_vand.h b/softrvv/include/softrvv_vand.h index 30db058..eb2dda6 100644 --- a/softrvv/include/softrvv_vand.h +++ b/softrvv/include/softrvv_vand.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VAND_H -#define SOFTRVV_VAND_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VAND_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VAND_H_ #include <stddef.h> #include <stdint.h> @@ -38,4 +38,4 @@ } // namespace softrvv -#endif // SOFTRVV_VAND_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VAND_H_
diff --git a/softrvv/include/softrvv_vdiv.h b/softrvv/include/softrvv_vdiv.h index 326c998..46d52c3 100644 --- a/softrvv/include/softrvv_vdiv.h +++ b/softrvv/include/softrvv_vdiv.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VDIV_H -#define SOFTRVV_VDIV_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VDIV_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VDIV_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VDIV_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VDIV_H_
diff --git a/softrvv/include/softrvv_vfadd.h b/softrvv/include/softrvv_vfadd.h index 4f91ff7..77bd66b 100644 --- a/softrvv/include/softrvv_vfadd.h +++ b/softrvv/include/softrvv_vfadd.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFADD_H -#define SOFTRVV_VFADD_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFADD_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFADD_H_ #include <stddef.h> @@ -35,4 +35,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFADD_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFADD_H_
diff --git a/softrvv/include/softrvv_vfdiv.h b/softrvv/include/softrvv_vfdiv.h index adf8b78..f92fd24 100644 --- a/softrvv/include/softrvv_vfdiv.h +++ b/softrvv/include/softrvv_vfdiv.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFDIV_H -#define SOFTRVV_VFDIV_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFDIV_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFDIV_H_ #include <stddef.h> @@ -41,4 +41,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFDIV_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFDIV_H_
diff --git a/softrvv/include/softrvv_vfmax.h b/softrvv/include/softrvv_vfmax.h index 1480b03..0d4b2ae 100644 --- a/softrvv/include/softrvv_vfmax.h +++ b/softrvv/include/softrvv_vfmax.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFMAX_H -#define SOFTRVV_VFMAX_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFMAX_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFMAX_H_ #include <stddef.h> @@ -35,4 +35,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFMAX_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFMAX_H_
diff --git a/softrvv/include/softrvv_vfmin.h b/softrvv/include/softrvv_vfmin.h index 52fb601..e0f6049 100644 --- a/softrvv/include/softrvv_vfmin.h +++ b/softrvv/include/softrvv_vfmin.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFMIN_H -#define SOFTRVV_VFMIN_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFMIN_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFMIN_H_ #include <stddef.h> @@ -35,4 +35,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFMIN_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFMIN_H_
diff --git a/softrvv/include/softrvv_vfmul.h b/softrvv/include/softrvv_vfmul.h index fae1bf7..706f0fb 100644 --- a/softrvv/include/softrvv_vfmul.h +++ b/softrvv/include/softrvv_vfmul.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFMUL_H -#define SOFTRVV_VFMUL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFMUL_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFMUL_H_ #include <stddef.h> @@ -35,4 +35,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFMUL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFMUL_H_
diff --git a/softrvv/include/softrvv_vfsub.h b/softrvv/include/softrvv_vfsub.h index 705bbac..038e21e 100644 --- a/softrvv/include/softrvv_vfsub.h +++ b/softrvv/include/softrvv_vfsub.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VFSUB_H -#define SOFTRVV_VFSUB_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VFSUB_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VFSUB_H_ #include <stddef.h> @@ -41,4 +41,4 @@ } // namespace softrvv -#endif // SOFTRVV_VFSUB_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VFSUB_H_
diff --git a/softrvv/include/softrvv_vmacc.h b/softrvv/include/softrvv_vmacc.h index 088a270..c5fd1cb 100644 --- a/softrvv/include/softrvv_vmacc.h +++ b/softrvv/include/softrvv_vmacc.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMACC_H -#define SOFTRVV_VMACC_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMACC_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMACC_H_ #include <stddef.h> #include <stdint.h> @@ -53,4 +53,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMACC_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMACC_H_
diff --git a/softrvv/include/softrvv_vmadd_vnmsub.h b/softrvv/include/softrvv_vmadd_vnmsub.h index e415543..ea1e7c7 100644 --- a/softrvv/include/softrvv_vmadd_vnmsub.h +++ b/softrvv/include/softrvv_vmadd_vnmsub.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMADD_VNMSUB_H -#define SOFTRVV_VMADD_VNMSUB_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMADD_VNMSUB_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMADD_VNMSUB_H_ #include <stddef.h> #include <stdint.h> @@ -52,4 +52,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMADD_VNMSUB_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMADD_VNMSUB_H_
diff --git a/softrvv/include/softrvv_vmax.h b/softrvv/include/softrvv_vmax.h index 0b5b26e..e6137a6 100644 --- a/softrvv/include/softrvv_vmax.h +++ b/softrvv/include/softrvv_vmax.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMAX_H -#define SOFTRVV_VMAX_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMAX_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMAX_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMAX_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMAX_H_
diff --git a/softrvv/include/softrvv_vmfeq.h b/softrvv/include/softrvv_vmfeq.h index dc11d4f..7cd170e 100644 --- a/softrvv/include/softrvv_vmfeq.h +++ b/softrvv/include/softrvv_vmfeq.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFEQ_H -#define SOFTRVV_VMFEQ_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFEQ_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFEQ_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFEQ_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFEQ_H_
diff --git a/softrvv/include/softrvv_vmfge.h b/softrvv/include/softrvv_vmfge.h index b0d1411..4a22c48 100644 --- a/softrvv/include/softrvv_vmfge.h +++ b/softrvv/include/softrvv_vmfge.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFGE_H -#define SOFTRVV_VMFGE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFGE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFGE_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFGE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFGE_H_
diff --git a/softrvv/include/softrvv_vmfgt.h b/softrvv/include/softrvv_vmfgt.h index 103e250..5b882af 100644 --- a/softrvv/include/softrvv_vmfgt.h +++ b/softrvv/include/softrvv_vmfgt.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFGT_H -#define SOFTRVV_VMFGT_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFGT_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFGT_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFGT_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFGT_H_
diff --git a/softrvv/include/softrvv_vmfle.h b/softrvv/include/softrvv_vmfle.h index e9cd794..7c0d8f6 100644 --- a/softrvv/include/softrvv_vmfle.h +++ b/softrvv/include/softrvv_vmfle.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFLE_H -#define SOFTRVV_VMFLE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFLE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFLE_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFLE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFLE_H_
diff --git a/softrvv/include/softrvv_vmflt.h b/softrvv/include/softrvv_vmflt.h index f5a234c..92cd844 100644 --- a/softrvv/include/softrvv_vmflt.h +++ b/softrvv/include/softrvv_vmflt.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFLT_H -#define SOFTRVV_VMFLT_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFLT_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFLT_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFLT_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFLT_H_
diff --git a/softrvv/include/softrvv_vmfne.h b/softrvv/include/softrvv_vmfne.h index 07b5fdd..9cce094 100644 --- a/softrvv/include/softrvv_vmfne.h +++ b/softrvv/include/softrvv_vmfne.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMFNE_H -#define SOFTRVV_VMFNE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMFNE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMFNE_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMFNE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMFNE_H_
diff --git a/softrvv/include/softrvv_vmin.h b/softrvv/include/softrvv_vmin.h index e7ce743..46d9758 100644 --- a/softrvv/include/softrvv_vmin.h +++ b/softrvv/include/softrvv_vmin.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMIN_H -#define SOFTRVV_VMIN_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMIN_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMIN_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMIN_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMIN_H_
diff --git a/softrvv/include/softrvv_vmseq.h b/softrvv/include/softrvv_vmseq.h index 0f891b3..398bf0c 100644 --- a/softrvv/include/softrvv_vmseq.h +++ b/softrvv/include/softrvv_vmseq.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSEQ_H -#define SOFTRVV_VMSEQ_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSEQ_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSEQ_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSEQ_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSEQ_H_
diff --git a/softrvv/include/softrvv_vmsge.h b/softrvv/include/softrvv_vmsge.h index a6fd29d..610125d 100644 --- a/softrvv/include/softrvv_vmsge.h +++ b/softrvv/include/softrvv_vmsge.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSGE_H -#define SOFTRVV_VMSGE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSGE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSGE_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSGE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSGE_H_
diff --git a/softrvv/include/softrvv_vmsgt.h b/softrvv/include/softrvv_vmsgt.h index c05cea6..7e0af78 100644 --- a/softrvv/include/softrvv_vmsgt.h +++ b/softrvv/include/softrvv_vmsgt.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSGT_H -#define SOFTRVV_VMSGT_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSGT_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSGT_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSGT_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSGT_H_
diff --git a/softrvv/include/softrvv_vmsle.h b/softrvv/include/softrvv_vmsle.h index fc66fc5..8e6bb50 100644 --- a/softrvv/include/softrvv_vmsle.h +++ b/softrvv/include/softrvv_vmsle.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSLE_H -#define SOFTRVV_VMSLE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSLE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSLE_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSLE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSLE_H_
diff --git a/softrvv/include/softrvv_vmslt.h b/softrvv/include/softrvv_vmslt.h index 13e0946..11c9e06 100644 --- a/softrvv/include/softrvv_vmslt.h +++ b/softrvv/include/softrvv_vmslt.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSLT_H -#define SOFTRVV_VMSLT_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSLT_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSLT_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSLT_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSLT_H_
diff --git a/softrvv/include/softrvv_vmsne.h b/softrvv/include/softrvv_vmsne.h index 0d03a8d..d97cb61 100644 --- a/softrvv/include/softrvv_vmsne.h +++ b/softrvv/include/softrvv_vmsne.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMSNE_H -#define SOFTRVV_VMSNE_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMSNE_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMSNE_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMSNE_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMSNE_H_
diff --git a/softrvv/include/softrvv_vmul_vmulh.h b/softrvv/include/softrvv_vmul_vmulh.h index 3b80e5b..1e94432 100644 --- a/softrvv/include/softrvv_vmul_vmulh.h +++ b/softrvv/include/softrvv_vmul_vmulh.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMUL_H -#define SOFTRVV_VMUL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMUL_VMULH_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMUL_VMULH_H_ #include <stddef.h> @@ -57,4 +57,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMUL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMUL_VMULH_H_
diff --git a/softrvv/include/softrvv_vmv_s_x.h b/softrvv/include/softrvv_vmv_s_x.h index ce012a7..0d322ea 100644 --- a/softrvv/include/softrvv_vmv_s_x.h +++ b/softrvv/include/softrvv_vmv_s_x.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VMV_S_X_H -#define SOFTRVV_VMV_S_X_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VMV_S_X_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VMV_S_X_H_ #include <stddef.h> @@ -28,4 +28,4 @@ } // namespace softrvv -#endif // SOFTRVV_VMV_S_X_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VMV_S_X_H_
diff --git a/softrvv/include/softrvv_vnsra.h b/softrvv/include/softrvv_vnsra.h index 4022a36..4ee1644 100644 --- a/softrvv/include/softrvv_vnsra.h +++ b/softrvv/include/softrvv_vnsra.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VNSRA_H -#define SOFTRVV_VNSRA_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VNSRA_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VNSRA_H_ #include <stddef.h> @@ -44,4 +44,4 @@ } // namespace softrvv -#endif // SOFTRVV_VNSRA_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VNSRA_H_
diff --git a/softrvv/include/softrvv_vnsrl.h b/softrvv/include/softrvv_vnsrl.h index 4da5f67..8f769fb 100644 --- a/softrvv/include/softrvv_vnsrl.h +++ b/softrvv/include/softrvv_vnsrl.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VNSRL_H -#define SOFTRVV_VNSRL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VNSRL_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VNSRL_H_ #include <stddef.h> @@ -49,4 +49,4 @@ } // namespace softrvv -#endif // SOFTRVV_VNSRL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VNSRL_H_
diff --git a/softrvv/include/softrvv_vor.h b/softrvv/include/softrvv_vor.h index 335684d..fa93191 100644 --- a/softrvv/include/softrvv_vor.h +++ b/softrvv/include/softrvv_vor.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VOR_H -#define SOFTRVV_VOR_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VOR_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VOR_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VOR_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VOR_H_
diff --git a/softrvv/include/softrvv_vredsum.h b/softrvv/include/softrvv_vredsum.h index c814404..0be1423 100644 --- a/softrvv/include/softrvv_vredsum.h +++ b/softrvv/include/softrvv_vredsum.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VREDSUM_H -#define SOFTRVV_VREDSUM_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VREDSUM_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VREDSUM_H_ #include <stddef.h> @@ -31,4 +31,4 @@ } // namespace softrvv -#endif // SOFTRVV_VREDSUM_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VREDSUM_H_
diff --git a/softrvv/include/softrvv_vrem.h b/softrvv/include/softrvv_vrem.h index e3e7e67..3f1acc4 100644 --- a/softrvv/include/softrvv_vrem.h +++ b/softrvv/include/softrvv_vrem.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VREM_H -#define SOFTRVV_VREM_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VREM_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VREM_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VREM_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VREM_H_
diff --git a/softrvv/include/softrvv_vsext_vzext.h b/softrvv/include/softrvv_vsext_vzext.h index d351468..4b9604a 100644 --- a/softrvv/include/softrvv_vsext_vzext.h +++ b/softrvv/include/softrvv_vsext_vzext.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VSEXT_VZEXT_H -#define SOFTRVV_VSEXT_VZEXT_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VSEXT_VZEXT_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VSEXT_VZEXT_H_ #include <stddef.h> @@ -41,4 +41,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSEXT_VZEXT_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VSEXT_VZEXT_H_
diff --git a/softrvv/include/softrvv_vsll.h b/softrvv/include/softrvv_vsll.h index e13005f..fa0ba6d 100644 --- a/softrvv/include/softrvv_vsll.h +++ b/softrvv/include/softrvv_vsll.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VSLL_H -#define SOFTRVV_VSLL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VSLL_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VSLL_H_ #include <stddef.h> @@ -47,4 +47,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSLL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VSLL_H_
diff --git a/softrvv/include/softrvv_vsra.h b/softrvv/include/softrvv_vsra.h index 23ec156..0f1d59f 100644 --- a/softrvv/include/softrvv_vsra.h +++ b/softrvv/include/softrvv_vsra.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VSRA_H -#define SOFTRVV_VSRA_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VSRA_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VSRA_H_ #include <stddef.h> @@ -42,4 +42,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSRA_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VSRA_H_
diff --git a/softrvv/include/softrvv_vsrl.h b/softrvv/include/softrvv_vsrl.h index 6da4d7c..e83e215 100644 --- a/softrvv/include/softrvv_vsrl.h +++ b/softrvv/include/softrvv_vsrl.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VSRL_H -#define SOFTRVV_VSRL_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VSRL_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VSRL_H_ #include <stddef.h> @@ -47,4 +47,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSRL_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VSRL_H_
diff --git a/softrvv/include/softrvv_vsub.h b/softrvv/include/softrvv_vsub.h index 3b89f94..7f873e3 100644 --- a/softrvv/include/softrvv_vsub.h +++ b/softrvv/include/softrvv_vsub.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VSUB_H -#define SOFTRVV_VSUB_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VSUB_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VSUB_H_ #include <stddef.h> @@ -44,4 +44,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSUB_H \ No newline at end of file +#endif // SOFTRVV_INCLUDE_SOFTRVV_VSUB_H_
diff --git a/softrvv/include/softrvv_vwadd.h b/softrvv/include/softrvv_vwadd.h index 39d2ed6..a34a91b 100644 --- a/softrvv/include/softrvv_vwadd.h +++ b/softrvv/include/softrvv_vwadd.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VWADD_H -#define SOFTRVV_VWADD_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VWADD_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VWADD_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VADD_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VWADD_H_
diff --git a/softrvv/include/softrvv_vwsub.h b/softrvv/include/softrvv_vwsub.h index 3df7763..3533b6b 100644 --- a/softrvv/include/softrvv_vwsub.h +++ b/softrvv/include/softrvv_vwsub.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VWSUB_H -#define SOFTRVV_VWSUB_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VWSUB_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VWSUB_H_ #include <stddef.h> @@ -39,4 +39,4 @@ } // namespace softrvv -#endif // SOFTRVV_VSUB_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VWSUB_H_
diff --git a/softrvv/include/softrvv_vxor.h b/softrvv/include/softrvv_vxor.h index c6e5b2e..bf1c931 100644 --- a/softrvv/include/softrvv_vxor.h +++ b/softrvv/include/softrvv_vxor.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef SOFTRVV_VXOR_H -#define SOFTRVV_VXOR_H +#ifndef SOFTRVV_INCLUDE_SOFTRVV_VXOR_H_ +#define SOFTRVV_INCLUDE_SOFTRVV_VXOR_H_ #include <stddef.h> @@ -37,4 +37,4 @@ } // namespace softrvv -#endif // SOFTRVV_VXOR_H +#endif // SOFTRVV_INCLUDE_SOFTRVV_VXOR_H_
diff --git a/softrvv/tests/softrvv_vand_test.cpp b/softrvv/tests/softrvv_vand_test.cpp index d7b77d8..88c91aa 100644 --- a/softrvv/tests/softrvv_vand_test.cpp +++ b/softrvv/tests/softrvv_vand_test.cpp
@@ -17,7 +17,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vand_test { namespace {
diff --git a/softrvv/tests/softrvv_vmacc_test.cpp b/softrvv/tests/softrvv_vmacc_test.cpp index 4f19c40..201f5de 100644 --- a/softrvv/tests/softrvv_vmacc_test.cpp +++ b/softrvv/tests/softrvv_vmacc_test.cpp
@@ -17,28 +17,28 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vmacc_test { namespace { class SoftRvvVmaccTest : public ::testing::Test { protected: - void SetUp() override { } + void SetUp() override {} }; class SoftRvvVnmsacTest : public ::testing::Test { protected: - void SetUp() override { } + void SetUp() override {} }; // Integer multiply-add, overwrite addend // vmacc.vv vd, vs1, vs2, vm # vd[i] = +(vs1[i] * vs2[i]) + vd[i] -uint32_t vmacvv_vs1[] = {1, 1, 128, 64, 0}; -uint32_t vmacvv_vs2[] = {0, 1, 1, 2, 32}; +uint32_t vmacvv_vs1[] = {1, 1, 128, 64, 0}; +uint32_t vmacvv_vs2[] = {0, 1, 1, 2, 32}; const uint32_t vmacvv_kAVL = sizeof(vmacvv_vs2) / sizeof(vmacvv_vs2[0]); -uint32_t vmacvv_vd[] = {0, 1, 2, 4, 8}; -int32_t vmacvv_ref[] = {0, 2, 130, 132, 8}; +uint32_t vmacvv_vd[] = {0, 1, 2, 4, 8}; +int32_t vmacvv_ref[] = {0, 2, 130, 132, 8}; TEST_F(SoftRvvVmaccTest, VV) { softrvv::vmacc_vv<uint32_t>(vmacvv_vd, vmacvv_vs1, vmacvv_vs2, vmacvv_kAVL); ASSERT_EQ(memcmp(vmacvv_vd, vmacvv_ref, sizeof(vmacvv_vd)), 0); @@ -47,37 +47,40 @@ // Integer multiply-add, overwrite addend // vmacc.vx vd, rs1, vs2, vm # vd[i] = +(x[rs1] * src2[i]) + vd[i] uint32_t vmaccvx_rs1[] = {170}; -uint32_t vmaccvx_vs2[] = {0, 1, 1, 2, 32}; +uint32_t vmaccvx_vs2[] = {0, 1, 1, 2, 32}; const uint32_t vmaccvx_kAVL = sizeof(vmaccvx_vs2) / sizeof(vmaccvx_vs2[0]); -uint32_t vmaccvx_vd[] = {0, 1, 2, 4, 8}; -int32_t vmaccvx_ref[] = {0, 171, 172, 344, 5448}; +uint32_t vmaccvx_vd[] = {0, 1, 2, 4, 8}; +int32_t vmaccvx_ref[] = {0, 171, 172, 344, 5448}; TEST_F(SoftRvvVmaccTest, VX) { - softrvv::vmacc_vx<uint32_t>(vmaccvx_vd, vmaccvx_rs1, vmaccvx_vs2, vmaccvx_kAVL); - ASSERT_EQ(memcmp(vmaccvx_vd, vmaccvx_ref, sizeof(vmaccvx_vd)), 0); + softrvv::vmacc_vx<uint32_t>(vmaccvx_vd, vmaccvx_rs1, vmaccvx_vs2, + vmaccvx_kAVL); + ASSERT_EQ(memcmp(vmaccvx_vd, vmaccvx_ref, sizeof(vmaccvx_vd)), 0); } // Integer multiply-sub, overwrite minuend // vnmsac.vv vd, vs1, vs2, vm # vd[i] = -(vs1[i] * vs2[i]) + vd[i] -uint32_t vnmsacvv_vs1[] = {220, 24, 1234, 150, 1386}; -uint32_t vnmsacvv_vs2[] = { 1, 2, 2, 10, 1000}; +uint32_t vnmsacvv_vs1[] = {220, 24, 1234, 150, 1386}; +uint32_t vnmsacvv_vs2[] = {1, 2, 2, 10, 1000}; const uint32_t vnmsacvv_kAVL = sizeof(vnmsacvv_vs2) / sizeof(vnmsacvv_vs2[0]); -uint32_t vnmsacvv_vd[] = { 0, 10, 10, 1000, 1}; -int32_t vnmsacvv_ref[] = {-220, -38, -2458, -500, -1385999}; +uint32_t vnmsacvv_vd[] = {0, 10, 10, 1000, 1}; +int32_t vnmsacvv_ref[] = {-220, -38, -2458, -500, -1385999}; TEST_F(SoftRvvVnmsacTest, VV) { - softrvv::vnmsac_vv<uint32_t>(vnmsacvv_vd, vnmsacvv_vs1, vnmsacvv_vs2, vnmsacvv_kAVL); + softrvv::vnmsac_vv<uint32_t>(vnmsacvv_vd, vnmsacvv_vs1, vnmsacvv_vs2, + vnmsacvv_kAVL); ASSERT_EQ(memcmp(vnmsacvv_vd, vnmsacvv_ref, sizeof(vnmsacvv_ref)), 0); } // Integer multiply-sub, overwrite minuend // vnmsac.vx vd, rs1, vs2, vm # vd[i] = -(x[rs1] * vs2[i]) + vd[i] uint32_t vnmsacvx_rs1[] = {170}; -uint32_t vnmsacvx_vs2[] = { 1, 2, 2, 10, 1000}; +uint32_t vnmsacvx_vs2[] = {1, 2, 2, 10, 1000}; const uint32_t vnmsacvx_kAVL = sizeof(vnmsacvx_vs2) / sizeof(vnmsacvx_vs2[0]); uint32_t vnmsacvx_vd[] = {170, 350, 10, 0, 0}; int32_t vnmsacvx_ref[] = {0, 10, -330, -1700, -170000}; TEST_F(SoftRvvVnmsacTest, VX) { - softrvv::vnmsac_vx<uint32_t>(vnmsacvx_vd, vnmsacvx_rs1, vnmsacvx_vs2, vnmsacvx_kAVL); - ASSERT_EQ(memcmp(vnmsacvx_vd, vnmsacvx_ref, sizeof(vnmsacvx_ref)), 0); + softrvv::vnmsac_vx<uint32_t>(vnmsacvx_vd, vnmsacvx_rs1, vnmsacvx_vs2, + vnmsacvx_kAVL); + ASSERT_EQ(memcmp(vnmsacvx_vd, vnmsacvx_ref, sizeof(vnmsacvx_ref)), 0); } } // namespace
diff --git a/softrvv/tests/softrvv_vmadd_vnmsub_test.cpp b/softrvv/tests/softrvv_vmadd_vnmsub_test.cpp index b823051..3c94872 100644 --- a/softrvv/tests/softrvv_vmadd_vnmsub_test.cpp +++ b/softrvv/tests/softrvv_vmadd_vnmsub_test.cpp
@@ -17,69 +17,72 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vmadd_vnmsub_test { namespace { class SoftRvvVmaddTest : public ::testing::Test { protected: - void SetUp() override { } + void SetUp() override {} }; class SoftRvvVnmsubTest : public ::testing::Test { protected: - void SetUp() override { } + void SetUp() override {} }; - // Integer multiply-add, overwrite multiplicand // vmadd.vv vd, vs1, vs2, vm # vd[i] = (vs1[i] * vd[i]) + vs2[i] -uint32_t vmaddvv_vs1[] = {1, 1, 128, 64, 0}; -uint32_t vmaddvv_vs2[] = {0, 1, 1, 2, 32}; +uint32_t vmaddvv_vs1[] = {1, 1, 128, 64, 0}; +uint32_t vmaddvv_vs2[] = {0, 1, 1, 2, 32}; const uint32_t vmaddvv_kAVL = sizeof(vmaddvv_vs2) / sizeof(vmaddvv_vs2[0]); -uint32_t vmaddvv_vd[] = {0, 1, 2, 4, 8}; -int32_t vmaddvv_ref[] = {0, 2, 257, 258, 32}; +uint32_t vmaddvv_vd[] = {0, 1, 2, 4, 8}; +int32_t vmaddvv_ref[] = {0, 2, 257, 258, 32}; TEST_F(SoftRvvVmaddTest, VV) { - softrvv::vmadd_vv<uint32_t>(vmaddvv_vd, vmaddvv_vs1, vmaddvv_vs2, vmaddvv_kAVL); + softrvv::vmadd_vv<uint32_t>(vmaddvv_vd, vmaddvv_vs1, vmaddvv_vs2, + vmaddvv_kAVL); ASSERT_EQ(memcmp(vmaddvv_vd, vmaddvv_ref, sizeof(vmaddvv_vd)), 0); } // Integer multiply-add, overwrite multiplicand // vmadd.vx vd, rs1, vs2, vm # vd[i] = (x[rs1] * vd[i]) + vs2[i] uint32_t vmaddvx_rs1[] = {170}; -uint32_t vmaddvx_vs2[] = {0, 1, 1, 2, 32}; +uint32_t vmaddvx_vs2[] = {0, 1, 1, 2, 32}; const uint32_t vmaddvx_kAVL = sizeof(vmaddvx_vs2) / sizeof(vmaddvx_vs2[0]); -uint32_t vmaddvx_vd[] = {0, 1, 2, 4, 8}; -int32_t vmaddvx_ref[] = {0, 171, 341, 682, 1392}; +uint32_t vmaddvx_vd[] = {0, 1, 2, 4, 8}; +int32_t vmaddvx_ref[] = {0, 171, 341, 682, 1392}; TEST_F(SoftRvvVmaddTest, VX) { - softrvv::vmadd_vx<uint32_t>(vmaddvx_vd, vmaddvx_rs1, vmaddvx_vs2, vmaddvx_kAVL); - ASSERT_EQ(memcmp(vmaddvx_vd, vmaddvx_ref, sizeof(vmaddvx_vd)), 0); + softrvv::vmadd_vx<uint32_t>(vmaddvx_vd, vmaddvx_rs1, vmaddvx_vs2, + vmaddvx_kAVL); + ASSERT_EQ(memcmp(vmaddvx_vd, vmaddvx_ref, sizeof(vmaddvx_vd)), 0); } // Integer multiply-sub, overwrite multiplicand // vnmsub.vv vd, vs1, vs2, vm # vd[i] = -(vs1[i] * vd[i]) + vs2[i] -uint32_t vnmsubvv_vs1[] = {220, 24, 1234, 150, 1386}; -uint32_t vnmsubvv_vs2[] = { 1, 2, 2, 10, 1000}; +uint32_t vnmsubvv_vs1[] = {220, 24, 1234, 150, 1386}; +uint32_t vnmsubvv_vs2[] = {1, 2, 2, 10, 1000}; const uint32_t vnmsubvv_kAVL = sizeof(vnmsubvv_vs2) / sizeof(vnmsubvv_vs2[0]); -uint32_t vnmsubvv_vd[] = { 0, 10, 10, 1000, 1}; -int32_t vnmsubvv_ref[] = {1, -238, -12338, -149990, -386}; +uint32_t vnmsubvv_vd[] = {0, 10, 10, 1000, 1}; +int32_t vnmsubvv_ref[] = {1, -238, -12338, -149990, -386}; TEST_F(SoftRvvVnmsubTest, VV) { - softrvv::vnmsub_vv<uint32_t>(vnmsubvv_vd, vnmsubvv_vs1, vnmsubvv_vs2, vnmsubvv_kAVL); + softrvv::vnmsub_vv<uint32_t>(vnmsubvv_vd, vnmsubvv_vs1, vnmsubvv_vs2, + vnmsubvv_kAVL); ASSERT_EQ(memcmp(vnmsubvv_vd, vnmsubvv_ref, sizeof(vnmsubvv_ref)), 0); } // Integer multiply-sub, overwrite minuend // vnmsub.vx vd, rs1, vs2, vm # vd[i] = -(x[rs1] * vd[i]) + vs2[i] uint32_t vnmsubvx_rs1[] = {170}; -uint32_t vnmsubvx_vs2[] = { 1, 2, 2, 10, 1000}; +uint32_t vnmsubvx_vs2[] = {1, 2, 2, 10, 1000}; const uint32_t vnmsubvx_kAVL = sizeof(vnmsubvx_vs2) / sizeof(vnmsubvx_vs2[0]); uint32_t vnmsubvx_vd[] = {170, 350, 10, 0, 0}; int32_t vnmsubvx_ref[] = {-28899, -59498, -1698, 10, 1000}; TEST_F(SoftRvvVnmsubTest, VX) { - softrvv::vnmsub_vx<uint32_t>(vnmsubvx_vd, vnmsubvx_rs1, vnmsubvx_vs2, vnmsubvx_kAVL); - ASSERT_EQ(memcmp(vnmsubvx_vd, vnmsubvx_ref, sizeof(vnmsubvx_ref)), 0); + softrvv::vnmsub_vx<uint32_t>(vnmsubvx_vd, vnmsubvx_rs1, vnmsubvx_vs2, + vnmsubvx_kAVL); + ASSERT_EQ(memcmp(vnmsubvx_vd, vnmsubvx_ref, sizeof(vnmsubvx_ref)), 0); } } // namespace -} // namespace softrvv_vmacc_vnmsub_test +} // namespace softrvv_vmadd_vnmsub_test
diff --git a/softrvv/tests/softrvv_vmax_test.cpp b/softrvv/tests/softrvv_vmax_test.cpp index 1fbba46..3ed8087 100644 --- a/softrvv/tests/softrvv_vmax_test.cpp +++ b/softrvv/tests/softrvv_vmax_test.cpp
@@ -18,7 +18,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vmax_test { namespace {
diff --git a/softrvv/tests/softrvv_vmaxu_test.cpp b/softrvv/tests/softrvv_vmaxu_test.cpp index ce3dd99..e009a06 100644 --- a/softrvv/tests/softrvv_vmaxu_test.cpp +++ b/softrvv/tests/softrvv_vmaxu_test.cpp
@@ -18,7 +18,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vmaxu_test { namespace {
diff --git a/softrvv/tests/softrvv_vmin_test.cpp b/softrvv/tests/softrvv_vmin_test.cpp index 0b7e7ba..03882d6 100644 --- a/softrvv/tests/softrvv_vmin_test.cpp +++ b/softrvv/tests/softrvv_vmin_test.cpp
@@ -18,7 +18,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vmin_test { namespace { @@ -38,7 +38,8 @@ int32_t ref_vv[] = {-1, 2, 3, 2, 1}; -int32_t ref_vx[3][kAVL] = {{-1, 1, 1, 1, 1}, {-1, 2, 3, 3, 3}, {-1, 2, 3, 4, 5}}; +int32_t ref_vx[3][kAVL] = { + {-1, 1, 1, 1, 1}, {-1, 2, 3, 3, 3}, {-1, 2, 3, 4, 5}}; class SoftRvvVminTest : public ::testing::Test { protected:
diff --git a/softrvv/tests/softrvv_vmv_s_x_test.cpp b/softrvv/tests/softrvv_vmv_s_x_test.cpp index 08cb7c8..8a3a81c 100644 --- a/softrvv/tests/softrvv_vmv_s_x_test.cpp +++ b/softrvv/tests/softrvv_vmv_s_x_test.cpp
@@ -17,9 +17,9 @@ #include <stdio.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" -namespace softrvv_vand_test { +namespace softrvv_vmv_s_x_test { namespace { int8_t dest_e8[] = {-5, 3, 0}; @@ -65,4 +65,4 @@ } } // namespace -} // namespace softrvv_vand_test +} // namespace softrvv_vmv_s_x_test
diff --git a/softrvv/tests/softrvv_vor_test.cpp b/softrvv/tests/softrvv_vor_test.cpp index 9758992..76b0bd7 100644 --- a/softrvv/tests/softrvv_vor_test.cpp +++ b/softrvv/tests/softrvv_vor_test.cpp
@@ -17,7 +17,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vor_test { namespace {
diff --git a/softrvv/tests/softrvv_vsext_test.cpp b/softrvv/tests/softrvv_vsext_test.cpp index a380466..5187f0b 100644 --- a/softrvv/tests/softrvv_vsext_test.cpp +++ b/softrvv/tests/softrvv_vsext_test.cpp
@@ -17,13 +17,13 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vsext_test { namespace { int16_t src1[] = {-1, -2, 3, -4, 5}; -const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); +const uint32_t AVL_CONST = sizeof(src1) / sizeof(src1[0]); int32_t dest[AVL_CONST]; int32_t ref_dest[] = {-1, -2, 3, -4, 5};
diff --git a/softrvv/tests/softrvv_vwadd_test.cpp b/softrvv/tests/softrvv_vwadd_test.cpp index 4a2c95f..ff13403 100644 --- a/softrvv/tests/softrvv_vwadd_test.cpp +++ b/softrvv/tests/softrvv_vwadd_test.cpp
@@ -17,15 +17,15 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" -namespace softrvv_vadd_test { +namespace softrvv_vwadd_test { namespace { int16_t src1[] = {1, 2, 3, -4, 5}; int16_t src2[] = {1, 2, 3, 4, -6}; int16_t rs1 = 3; -const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); +const uint32_t AVL_CONST = sizeof(src1) / sizeof(src1[0]); int32_t dest[AVL_CONST]; int32_t ref_vv[] = {2, 4, 6, 0, -1};
diff --git a/softrvv/tests/softrvv_vwaddu_test.cpp b/softrvv/tests/softrvv_vwaddu_test.cpp index 632b7ca..9823242 100644 --- a/softrvv/tests/softrvv_vwaddu_test.cpp +++ b/softrvv/tests/softrvv_vwaddu_test.cpp
@@ -17,15 +17,15 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" -namespace softrvv_vaddu_test { +namespace softrvv_vwaddu_test { namespace { uint16_t src1[] = {1, 2, 3, 4, 5}; uint16_t src2[] = {1, 2, 3, 4, 5}; uint16_t rs1 = 3; -const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); +const uint32_t AVL_CONST = sizeof(src1) / sizeof(src1[0]); uint32_t dest[AVL_CONST]; uint32_t ref_vv[] = {2, 4, 6, 8, 10};
diff --git a/softrvv/tests/softrvv_vwsub_test.cpp b/softrvv/tests/softrvv_vwsub_test.cpp index c7a01ed..c5c6e05 100644 --- a/softrvv/tests/softrvv_vwsub_test.cpp +++ b/softrvv/tests/softrvv_vwsub_test.cpp
@@ -17,7 +17,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vwsub_test { namespace { @@ -25,7 +25,7 @@ int16_t src1[] = {2, 4, -6, 8, 10}; int16_t src2[] = {1, 2, 3, -4, 5}; int16_t rs1 = 3; -const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); +const uint32_t AVL_CONST = sizeof(src1) / sizeof(src1[0]); int32_t dest[AVL_CONST]; int32_t ref_vv[] = {1, 2, -9, 12, 5};
diff --git a/softrvv/tests/softrvv_vwsubu_test.cpp b/softrvv/tests/softrvv_vwsubu_test.cpp index dda88e3..52ca5c1 100644 --- a/softrvv/tests/softrvv_vwsubu_test.cpp +++ b/softrvv/tests/softrvv_vwsubu_test.cpp
@@ -17,7 +17,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vwsubu_test { namespace {
diff --git a/softrvv/tests/softrvv_vzext_test.cpp b/softrvv/tests/softrvv_vzext_test.cpp index f468095..7406f19 100644 --- a/softrvv/tests/softrvv_vzext_test.cpp +++ b/softrvv/tests/softrvv_vzext_test.cpp
@@ -17,13 +17,13 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" +#include "softrvv/include/softrvv.h" namespace softrvv_vzext_test { namespace { uint16_t src1[] = {1, 2, 3, 4, 5}; -const uint32_t AVL_CONST = sizeof(src1)/sizeof(src1[0]); +const uint32_t AVL_CONST = sizeof(src1) / sizeof(src1[0]); uint32_t dest[AVL_CONST]; uint32_t ref_dest[] = {1, 2, 3, 4, 5};
diff --git a/softrvv/tests/templates/CPPLINT.cfg b/softrvv/tests/templates/CPPLINT.cfg new file mode 100644 index 0000000..54956f5 --- /dev/null +++ b/softrvv/tests/templates/CPPLINT.cfg
@@ -0,0 +1 @@ +exclude_files=.*\.tpl\.cpp
diff --git a/softrvv/tests/templates/base.tpl.cpp b/softrvv/tests/templates/base.tpl.cpp index 8520f17..13a39b7 100644 --- a/softrvv/tests/templates/base.tpl.cpp +++ b/softrvv/tests/templates/base.tpl.cpp
@@ -31,8 +31,8 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "softrvv.h" -#include "test_v_helpers.h" +#include "softrvv/include/softrvv.h" +#include "test_v_helpers/include/test_v_helpers.h" using namespace test_v_helpers;
diff --git a/softrvv/tests/vec_disable_test.cpp b/softrvv/tests/vec_disable_test.cpp index aaaa764..f96e2a8 100644 --- a/softrvv/tests/vec_disable_test.cpp +++ b/softrvv/tests/vec_disable_test.cpp
@@ -13,12 +13,12 @@ // limitations under the License. #include <riscv_vector.h> -#include <softrvv.h> #include <springbok.h> #include <stdio.h> #include <stdlib.h> #include "pw_unit_test/framework.h" +#include "softrvv/include/softrvv.h" namespace vec_disable_test { namespace {
diff --git a/test_v_helpers/CMakeLists.txt b/test_v_helpers/CMakeLists.txt index 920132e..8f8318c 100644 --- a/test_v_helpers/CMakeLists.txt +++ b/test_v_helpers/CMakeLists.txt
@@ -18,7 +18,7 @@ add_library(test_v_helpers test_v_helpers.cpp) -target_include_directories(test_v_helpers PUBLIC include) +target_include_directories(test_v_helpers PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(test_v_helpers PUBLIC pw_unit_test) target_compile_options(test_v_helpers PUBLIC
diff --git a/test_v_helpers/include/test_v_helpers.h b/test_v_helpers/include/test_v_helpers.h index ae3dd6d..2362910 100644 --- a/test_v_helpers/include/test_v_helpers.h +++ b/test_v_helpers/include/test_v_helpers.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef TEST_V_HELPERS_H -#define TEST_V_HELPERS_H +#ifndef TEST_V_HELPERS_INCLUDE_TEST_V_HELPERS_H_ +#define TEST_V_HELPERS_INCLUDE_TEST_V_HELPERS_H_ #include <stdint.h> @@ -94,13 +94,15 @@ template <typename T> void assert_vec_mask_eq(int avl, void *test_vector_1, void *test_vector_2) { - const unsigned int bw_required = std::__bit_width(sizeof(T)* 8); + const unsigned int bw_required = std::__bit_width(sizeof(T) * 8); const unsigned int shift = bw_required - 1; T *ptr_vec_1 = reinterpret_cast<T *>(test_vector_1); T *ptr_vec_2 = reinterpret_cast<T *>(test_vector_2); for (int idx = 0; idx < avl; idx++) { - unsigned int element_idx = idx >> shift; // Eqivalent to idx / (sizeof(T) * 8) - unsigned int element_pos = idx & ~(element_idx << shift); // Equivalent to idx % (sizeof(T) * 8) + unsigned int element_idx = + idx >> shift; // Eqivalent to idx / (sizeof(T) * 8) + unsigned int element_pos = + idx & ~(element_idx << shift); // Equivalent to idx % (sizeof(T) * 8) T *e1 = ptr_vec_1 + element_idx; T *e2 = ptr_vec_2 + element_idx; ASSERT_EQ(*e1 & (1 << element_pos), *e2 & (1 << element_pos)); @@ -132,7 +134,7 @@ template <typename T> void fill_random_vector(T *vec, int32_t avl) { for (int32_t i = 0; i < avl; i++) { - vec[i] = static_cast<T>(rand()); + vec[i] = static_cast<T>(rand()); // NOLINT(runtime/threadsafe_fn) } } @@ -145,4 +147,4 @@ } // namespace test_v_helpers -#endif +#endif // TEST_V_HELPERS_INCLUDE_TEST_V_HELPERS_H_
diff --git a/test_v_helpers/test_v_helpers.cpp b/test_v_helpers/test_v_helpers.cpp index 55fa9ba..3f9b8e6 100644 --- a/test_v_helpers/test_v_helpers.cpp +++ b/test_v_helpers/test_v_helpers.cpp
@@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" + #ifndef LIBSPRINGBOK_NO_VECTOR_SUPPORT #include <riscv_vector.h>
diff --git a/tests/CPPLINT.cfg b/tests/CPPLINT.cfg new file mode 100644 index 0000000..03c80b6 --- /dev/null +++ b/tests/CPPLINT.cfg
@@ -0,0 +1 @@ +filter=-build/namespaces
diff --git a/tests/templates/CPPLINT.cfg b/tests/templates/CPPLINT.cfg new file mode 100644 index 0000000..54956f5 --- /dev/null +++ b/tests/templates/CPPLINT.cfg
@@ -0,0 +1 @@ +exclude_files=.*\.tpl\.cpp
diff --git a/tests/templates/base.tpl.cpp b/tests/templates/base.tpl.cpp index 0b9d608..4987abd 100644 --- a/tests/templates/base.tpl.cpp +++ b/tests/templates/base.tpl.cpp
@@ -15,7 +15,6 @@ /* Automatically generated file */ #include <limits.h> #include <riscv_vector.h> -#include <softrvv.h> #include <springbok.h> #include <stdio.h> #include <stdlib.h> @@ -24,5 +23,6 @@ #include <tuple> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "softrvv/include/softrvv.h" +#include "test_v_helpers/include/test_v_helpers.h" ${self.body()}
diff --git a/tests/vle_vse_test.cpp b/tests/vle_vse_test.cpp index 9ed2a0e..7db7c07 100644 --- a/tests/vle_vse_test.cpp +++ b/tests/vle_vse_test.cpp
@@ -17,7 +17,7 @@ #include <stddef.h> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" namespace vle_vse_test { namespace {
diff --git a/tests/vlnr_vsnr_test.cpp b/tests/vlnr_vsnr_test.cpp index 1d04efc..dc6be39 100644 --- a/tests/vlnr_vsnr_test.cpp +++ b/tests/vlnr_vsnr_test.cpp
@@ -15,7 +15,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" // Test for vl{1,2,8}re{8,16,32}.v and vs{1,2,8}r{8,16,32}.v instructions. namespace vlnr_vsnr_test {
diff --git a/tests/vmerge_test.cpp b/tests/vmerge_test.cpp index 9fa4958..0df5d20 100644 --- a/tests/vmerge_test.cpp +++ b/tests/vmerge_test.cpp
@@ -15,7 +15,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" // Test for vmerge.vim and vmerge.vvm instructions. namespace vmerge_test {
diff --git a/tests/vmv_s_x_test.cpp b/tests/vmv_s_x_test.cpp index 67f8f86..68fc982 100644 --- a/tests/vmv_s_x_test.cpp +++ b/tests/vmv_s_x_test.cpp
@@ -23,12 +23,12 @@ #include <type_traits> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" namespace vmv_s_x_test { namespace { -using namespace test_v_helpers; +using namespace test_v_helpers; // NOLINT(build/namespaces) uint8_t test_vector_1[MAXVL_BYTES]; uint8_t reference_vector_1[MAXVL_BYTES]; @@ -134,4 +134,3 @@ } // namespace } // namespace vmv_s_x_test -
diff --git a/tests/vmv_test.cpp b/tests/vmv_test.cpp index c4b36b5..b830071 100644 --- a/tests/vmv_test.cpp +++ b/tests/vmv_test.cpp
@@ -21,7 +21,7 @@ #include <tuple> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" namespace vmv_test { namespace {
diff --git a/tests/vsetvl_test.cpp b/tests/vsetvl_test.cpp index a5d90b7..8ebb7bd 100644 --- a/tests/vsetvl_test.cpp +++ b/tests/vsetvl_test.cpp
@@ -18,7 +18,7 @@ #include <stdlib.h> #include "pw_unit_test/framework.h" -#include "test_v_helpers.h" +#include "test_v_helpers/include/test_v_helpers.h" namespace vsetvl_test { namespace {
diff --git a/vector_load_store_tests/include/vector_load_store_tests.h b/vector_load_store_tests/include/vector_load_store_tests.h index eb8e8e8..36e58dc 100644 --- a/vector_load_store_tests/include/vector_load_store_tests.h +++ b/vector_load_store_tests/include/vector_load_store_tests.h
@@ -14,17 +14,18 @@ * limitations under the License. */ -#ifndef VECTOR_TESTS_VECTOR_LOAD_STORE_TESTS_H_ -#define VECTOR_TESTS_VECTOR_LOAD_STORE_TESTS_H_ +#ifndef VECTOR_LOAD_STORE_TESTS_INCLUDE_VECTOR_LOAD_STORE_TESTS_H_ +#define VECTOR_LOAD_STORE_TESTS_INCLUDE_VECTOR_LOAD_STORE_TESTS_H_ -#include "test_vector.h" -#include <string.h> -#include <springbok.h> #include <assert.h> +#include <springbok.h> +#include <string.h> + +#include "vector_tests/include/test_vector.h" void test_vector_load_store_sanity_e8(void); void test_vector_load_store_sanity_e16(void); void test_vector_load_store_sanity_e32(void); void test_vector_load_store_sanity_e64(void); -#endif \ No newline at end of file +#endif // VECTOR_LOAD_STORE_TESTS_INCLUDE_VECTOR_LOAD_STORE_TESTS_H_
diff --git a/vector_load_store_tests/vector_load_store_tests.c b/vector_load_store_tests/vector_load_store_tests.c index c4841d1..20766f4 100644 --- a/vector_load_store_tests/vector_load_store_tests.c +++ b/vector_load_store_tests/vector_load_store_tests.c
@@ -14,7 +14,7 @@ * limitations under the License. */ -#include "vector_load_store_tests.h" +#include "vector_load_store_tests/include/vector_load_store_tests.h" // TODO(b/194689843): Re-enable e64 and mf[2|4|8] tests. @@ -38,9 +38,9 @@ volatile uint8_t INP1[] = {0xff, 0x00, 0x0f, 0xf0}; volatile uint8_t OUT1[4]; - __asm__ volatile ("vle8.v v1, (%0)"::"r" (INP1)); - __asm__ volatile ("vse8.v v1, (%0)"::"r" (OUT1)); - assert(memcmp((void*)INP1,(void*)OUT1, 4 * sizeof(uint8_t)) == 0); + __asm__ volatile("vle8.v v1, (%0)" ::"r"(INP1)); + __asm__ volatile("vse8.v v1, (%0)" ::"r"(OUT1)); + assert(memcmp((void*)INP1, (void*)OUT1, 4 * sizeof(uint8_t)) == 0); } void test_vector_load_store_sanity_e16(void) { @@ -54,9 +54,9 @@ volatile uint16_t INP1[] = {0xff00, 0x00ff, 0x0ff0, 0xf00f}; volatile uint16_t OUT1[4]; - __asm__ volatile ("vle16.v v1, (%0)"::"r" (INP1)); - __asm__ volatile ("vse16.v v1, (%0)"::"r" (OUT1)); - assert(memcmp((void*)INP1,(void*)OUT1, 4 * sizeof(uint16_t)) == 0); + __asm__ volatile("vle16.v v1, (%0)" ::"r"(INP1)); + __asm__ volatile("vse16.v v1, (%0)" ::"r"(OUT1)); + assert(memcmp((void*)INP1, (void*)OUT1, 4 * sizeof(uint16_t)) == 0); } void test_vector_load_store_sanity_e32(void) { @@ -70,9 +70,9 @@ volatile uint32_t INP1[] = {0xff0000ff, 0x00ffff00, 0x0ff00ff0, 0xf00ff00f}; volatile uint32_t OUT1[4]; - __asm__ volatile ("vle32.v v1, (%0)"::"r" (INP1)); - __asm__ volatile ("vse32.v v1, (%0)"::"r" (OUT1)); - assert(memcmp((void*)INP1,(void*)OUT1, 4 * sizeof(uint32_t)) == 0); + __asm__ volatile("vle32.v v1, (%0)" ::"r"(INP1)); + __asm__ volatile("vse32.v v1, (%0)" ::"r"(OUT1)); + assert(memcmp((void*)INP1, (void*)OUT1, 4 * sizeof(uint32_t)) == 0); } void test_vector_load_store_sanity_e64(void) { @@ -84,11 +84,12 @@ LOG_INFO("vl: %u", vl); assert(vl == 4); - volatile uint64_t INP1[] = {0xff0000ffff0000ff, 0x00ffff0000ffff00, 0x0ff00ff00ff00ff0, 0xf00ff00ff00ff00f}; + volatile uint64_t INP1[] = {0xff0000ffff0000ff, 0x00ffff0000ffff00, + 0x0ff00ff00ff00ff0, 0xf00ff00ff00ff00f}; volatile uint64_t OUT1[4]; - __asm__ volatile ("vle64.v v1, (%0)"::"r" (INP1)); - __asm__ volatile ("vse64.v v1, (%0)"::"r" (OUT1)); - assert(memcmp((void*)INP1,(void*)OUT1, 4 * sizeof(uint64_t)) == 0); + __asm__ volatile("vle64.v v1, (%0)" ::"r"(INP1)); + __asm__ volatile("vse64.v v1, (%0)" ::"r"(OUT1)); + assert(memcmp((void*)INP1, (void*)OUT1, 4 * sizeof(uint64_t)) == 0); } // TODO(julianmb): test mask load and mask store. vlm.v vsm.v
diff --git a/vector_matmul4_asm_test/main.cpp b/vector_matmul4_asm_test/main.cpp index 0fe4972..38f1f15 100644 --- a/vector_matmul4_asm_test/main.cpp +++ b/vector_matmul4_asm_test/main.cpp
@@ -19,19 +19,20 @@ #include <cstdlib> #include <random> -//#define PRINT_INPUTS_AND_OUTPUTS (1) +// #define PRINT_INPUTS_AND_OUTPUTS (1) #ifndef PRINT_INPUTS_AND_OUTPUTS #define PRINT_INPUTS_AND_OUTPUTS (0) #endif -extern "C" void vector_matmul4_asm(int32_t *out, const int8_t *lhs, const int8_t *rhs_t, std::size_t count); +extern "C" void vector_matmul4_asm(int32_t *out, const int8_t *lhs, + const int8_t *rhs_t, std::size_t count); extern "C" int main(void) { - int8_t lhs[16*37]; - int8_t rhs_t[16*37]; - int32_t result[sizeof(lhs)+16]; - int32_t golden[sizeof(lhs)+16]; + int8_t lhs[16 * 37]; + int8_t rhs_t[16 * 37]; + int32_t result[sizeof(lhs) + 16]; + int32_t golden[sizeof(lhs) + 16]; std::default_random_engine generator; std::uniform_int_distribution<int8_t> distribution(INT8_MIN, INT8_MAX); @@ -41,42 +42,43 @@ } // One extra guard matrix to ensure the assembly doesn't go past the end - for (std::size_t i = sizeof(lhs); i < sizeof(lhs)+16; i++) { + for (std::size_t i = sizeof(lhs); i < sizeof(lhs) + 16; i++) { result[i] = 1337; golden[i] = 1337; } - vector_matmul4_asm(result, lhs, rhs_t, sizeof(lhs)/16); + vector_matmul4_asm(result, lhs, rhs_t, sizeof(lhs) / 16); - for (std::size_t b = 0; b < sizeof(lhs)/16; b++) { + for (std::size_t b = 0; b < sizeof(lhs) / 16; b++) { for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { int32_t acc = 0; for (int k = 0; k < 4; k++) { - acc += lhs[k+j*4+b*16] * rhs_t[k+i*4+b*16]; + acc += lhs[k + j * 4 + b * 16] * rhs_t[k + i * 4 + b * 16]; } - golden[i+j*4+b*16] = acc; + golden[i + j * 4 + b * 16] = acc; } } } std::size_t errors = 0; - for (std::size_t b = 0; b < sizeof(result)/sizeof(int32_t)/16; b++) { + for (std::size_t b = 0; b < sizeof(result) / sizeof(int32_t) / 16; b++) { for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { - errors += result[i+4*j+b*16] == golden[i+4*j+b*16]? 0 : 1; + errors += + result[i + 4 * j + b * 16] == golden[i + 4 * j + b * 16] ? 0 : 1; } } } if (PRINT_INPUTS_AND_OUTPUTS) { printf("lhs:\n"); - for (std::size_t b = 0; b < sizeof(lhs)/sizeof(int8_t)/16; b++) { - printf("b = %d:\n",b); + for (std::size_t b = 0; b < sizeof(lhs) / sizeof(int8_t) / 16; b++) { + printf("b = %d:\n", b); for (int j = 0; j < 4; j++) { printf(" "); for (int i = 0; i < 4; i++) { - printf("%5d,", (int)lhs[i+4*j+b*16]); + printf("%5d,", static_cast<int>(lhs[i + 4 * j + b * 16])); } printf("\n"); } @@ -84,12 +86,12 @@ } printf("rhs_t:\n"); - for (std::size_t b = 0; b < sizeof(rhs_t)/sizeof(int8_t)/16; b++) { - printf("b = %d:\n",b); + for (std::size_t b = 0; b < sizeof(rhs_t) / sizeof(int8_t) / 16; b++) { + printf("b = %d:\n", b); for (int j = 0; j < 4; j++) { printf(" "); for (int i = 0; i < 4; i++) { - printf("%5d,", (int)rhs_t[i+4*j+b*16]); + printf("%5d,", static_cast<int>(rhs_t[i + 4 * j + b * 16])); } printf("\n"); } @@ -97,12 +99,12 @@ } printf("golden:\n"); - for (std::size_t b = 0; b < sizeof(golden)/sizeof(int32_t)/16; b++) { - printf("b = %d:\n",b); + for (std::size_t b = 0; b < sizeof(golden) / sizeof(int32_t) / 16; b++) { + printf("b = %d:\n", b); for (int j = 0; j < 4; j++) { printf(" "); for (int i = 0; i < 4; i++) { - printf("%7d,", (int)golden[i+4*j+b*16]); + printf("%7d,", static_cast<int>(golden[i + 4 * j + b * 16])); } printf("\n"); } @@ -110,13 +112,14 @@ } printf("\nresults:\n"); - for (std::size_t b = 0; b < sizeof(result)/sizeof(int32_t)/16; b++) { - printf("b = %d:\n",b); + for (std::size_t b = 0; b < sizeof(result) / sizeof(int32_t) / 16; b++) { + printf("b = %d:\n", b); for (int j = 0; j < 4; j++) { printf(" "); for (int i = 0; i < 4; i++) { - bool same = result[i+4*j+b*16] == golden[i+4*j+b*16]; - printf("%7d%c", (int)result[i+4*j+b*16], same? ',' : '/'); + bool same = result[i + 4 * j + b * 16] == golden[i + 4 * j + b * 16]; + printf("%7d%c", static_cast<int>(result[i + 4 * j + b * 16]), + same ? ',' : '/'); } printf("\n"); } @@ -126,5 +129,5 @@ printf("\n%d errors\n", errors); } - return (errors > INT_MAX)? INT_MAX : (int)errors; + return (errors > INT_MAX) ? INT_MAX : static_cast<int>(errors); }
diff --git a/vector_tests/CMakeLists.txt b/vector_tests/CMakeLists.txt index 34c708a..b365e6f 100644 --- a/vector_tests/CMakeLists.txt +++ b/vector_tests/CMakeLists.txt
@@ -21,7 +21,7 @@ test_vector.c common_vector_test.c) -target_include_directories(vector_tests PUBLIC include) +target_include_directories(vector_tests PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(vector_tests springbok)
diff --git a/vector_tests/common_vector_test.c b/vector_tests/common_vector_test.c index 47be5a3..e1545f0 100644 --- a/vector_tests/common_vector_test.c +++ b/vector_tests/common_vector_test.c
@@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common_vector_test.h" +#include "vector_tests/include/common_vector_test.h" size_t strlength(const char *str) { size_t index = 0;
diff --git a/vector_tests/include/common_vector_test.h b/vector_tests/include/common_vector_test.h index 5af7f5d..037a69b 100644 --- a/vector_tests/include/common_vector_test.h +++ b/vector_tests/include/common_vector_test.h
@@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef VECTOR_TESTS_COMMON_COMMON_VECTOR_TEST_H_ -#define VECTOR_TESTS_COMMON_COMMON_VECTOR_TEST_H_ -#include <stddef.h> +#ifndef VECTOR_TESTS_INCLUDE_COMMON_VECTOR_TEST_H_ +#define VECTOR_TESTS_INCLUDE_COMMON_VECTOR_TEST_H_ #include <stdbool.h> +#include <stddef.h> #include <stdint.h> size_t strlength(const char *); bool strequal(const char *, const char *); uint64_t random64(void); -#endif \ No newline at end of file +#endif // VECTOR_TESTS_INCLUDE_COMMON_VECTOR_TEST_H_
diff --git a/vector_tests/include/test_vector.h b/vector_tests/include/test_vector.h index 5c53685..df680e4 100644 --- a/vector_tests/include/test_vector.h +++ b/vector_tests/include/test_vector.h
@@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef VECTOR_TESTS_TEST_VECTOR_H_ -#define VECTOR_TESTS_TEST_VECTOR_H_ +#ifndef VECTOR_TESTS_INCLUDE_TEST_VECTOR_H_ +#define VECTOR_TESTS_INCLUDE_TEST_VECTOR_H_ #include <stdbool.h> #include <stdint.h> @@ -43,4 +43,4 @@ uint32_t get_vtype_e32(uint8_t, bool, bool); uint32_t get_vtype_e64(uint8_t, bool, bool); -#endif +#endif // VECTOR_TESTS_INCLUDE_TEST_VECTOR_H_
diff --git a/vector_tests/test_vector.c b/vector_tests/test_vector.c index 3a45618..2085e13 100644 --- a/vector_tests/test_vector.c +++ b/vector_tests/test_vector.c
@@ -14,7 +14,8 @@ * limitations under the License. */ -#include "test_vector.h" +#include "vector_tests/include/test_vector.h" + #include <springbok.h> #define MSTATUS_VS 0x00000600 @@ -51,7 +52,6 @@ } int main(void) { - LOG_INFO("Hello test_vector.c"); LOG_INFO("Built at: " __DATE__ ", " __TIME__);
diff --git a/vector_vadd_vsub_tests/include/vector_vadd_vsub_tests.h b/vector_vadd_vsub_tests/include/vector_vadd_vsub_tests.h index dae488c..300df8c 100644 --- a/vector_vadd_vsub_tests/include/vector_vadd_vsub_tests.h +++ b/vector_vadd_vsub_tests/include/vector_vadd_vsub_tests.h
@@ -14,11 +14,11 @@ * limitations under the License. */ -#ifndef SHODAN_SW_VECTOR_TESTS_VECTOR_VADD_VSUB_TESTS_H_ -#define SHODAN_SW_VECTOR_TESTS_VECTOR_VADD_VSUB_TESTS_H_ +#ifndef VECTOR_VADD_VSUB_TESTS_INCLUDE_VECTOR_VADD_VSUB_TESTS_H_ +#define VECTOR_VADD_VSUB_TESTS_INCLUDE_VECTOR_VADD_VSUB_TESTS_H_ -#include "test_vector.h" -#include "common_vector_test.h" +#include "vector_tests/include/common_vector_test.h" +#include "vector_tests/include/test_vector.h" void test_vector_vadd_vv(void); void test_vector_vsub_vv(void); @@ -28,4 +28,4 @@ void test_vector_vrsub_vx(void); void test_vector_vrsub_vi(void); -#endif +#endif // VECTOR_VADD_VSUB_TESTS_INCLUDE_VECTOR_VADD_VSUB_TESTS_H_
diff --git a/vector_vadd_vsub_tests/vector_vadd_vsub_tests.c b/vector_vadd_vsub_tests/vector_vadd_vsub_tests.c index 4f4b830..cfe3d37 100644 --- a/vector_vadd_vsub_tests/vector_vadd_vsub_tests.c +++ b/vector_vadd_vsub_tests/vector_vadd_vsub_tests.c
@@ -14,11 +14,11 @@ * limitations under the License. */ -#include <assert.h> -#include <string.h> +#include "vector_vadd_vsub_tests/include/vector_vadd_vsub_tests.h" -#include "vector_vadd_vsub_tests.h" +#include <assert.h> #include <springbok.h> +#include <string.h> // TODO(b/194689843): Re-enable e64 and mf[2|4|8] tests.
diff --git a/vector_vset_tests/include/vector_vset_tests.h b/vector_vset_tests/include/vector_vset_tests.h index 418ade2..fa01d68 100644 --- a/vector_vset_tests/include/vector_vset_tests.h +++ b/vector_vset_tests/include/vector_vset_tests.h
@@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef VECTOR_TESTS_VECTOR_VSET_TESTS_H_ -#define VECTOR_TESTS_VECTOR_VSET_TESTS_H_ +#ifndef VECTOR_VSET_TESTS_INCLUDE_VECTOR_VSET_TESTS_H_ +#define VECTOR_VSET_TESTS_INCLUDE_VECTOR_VSET_TESTS_H_ -#include "test_vector.h" -#include "common_vector_test.h" +#include "vector_tests/include/common_vector_test.h" +#include "vector_tests/include/test_vector.h" void test_vector_vsetvl(void); void test_vector_vsetvli(void); void test_vector_vsetivli(void); -#endif \ No newline at end of file +#endif // VECTOR_VSET_TESTS_INCLUDE_VECTOR_VSET_TESTS_H_
diff --git a/vector_vset_tests/vector_vset_tests.c b/vector_vset_tests/vector_vset_tests.c index 3076874..b3f6db0 100644 --- a/vector_vset_tests/vector_vset_tests.c +++ b/vector_vset_tests/vector_vset_tests.c
@@ -14,9 +14,10 @@ * limitations under the License. */ +#include "vector_vset_tests/include/vector_vset_tests.h" + #include <springbok.h> #include <string.h> -#include "vector_vset_tests.h" // TODO(b/194689843): Re-enable e64 and mf[2|4|8] tests. @@ -84,8 +85,8 @@ volatile uint32_t avl_vol = avl; // vsetvl rd, rs1, rs2 # rd = new vl, rs1 = AVL, rs2 = new vtype value - __asm__ volatile("vsetvl t0, %[AVL], %[VTYPE]" ::[AVL] "r"(avl_vol), - [ VTYPE ] "r"(vtype)); + __asm__ volatile( + "vsetvl t0, %[AVL], %[VTYPE]" ::[AVL] "r"(avl_vol), [VTYPE] "r"(vtype)); COPY_SCALAR_REG(observed_vl); if (observed_vl != expected_vl) { @@ -508,10 +509,10 @@ // vsetvli rd, rs1, vtypei # rd = new vl, rs1 = AVL, vtypei = new vtype // setting -#define VSETVLI_TEST_HELPER(VTYPEI_VAR, VTYPEI_SYMBOL, AVL_VAR) \ - if (strequal(VTYPEI_VAR, VTYPEI_SYMBOL)) { \ - __asm__ volatile( \ - "vsetvli t0, %[AVL], " VTYPEI_SYMBOL::[AVL] "r"(AVL_VAR)); \ +#define VSETVLI_TEST_HELPER(VTYPEI_VAR, VTYPEI_SYMBOL, AVL_VAR) \ + if (strequal(VTYPEI_VAR, VTYPEI_SYMBOL)) { \ + __asm__ volatile( \ + "vsetvli t0, %[AVL], " VTYPEI_SYMBOL::[AVL] "r"(AVL_VAR)); \ } void subtest_vsetvli(const char *vtypei, uint32_t avl, uint32_t expected_vl) {