blob: 0694ae2201f2879e9ec6c09bf0eb067666999716 [file] [log] [blame]
#ifndef VECTOR_TESTS_TEST_VECTOR_H_
#define VECTOR_TESTS_TEST_VECTOR_H_
#include <stdbool.h>
#include <stdint.h>
#include <assert.h>
#ifndef _TEST_VLEN
#define _TEST_VLEN 512
#endif
#define _TEST_VLENB _TEST_VLEN >> 3
#define VSET(VLEN, VTYPE, LMUL) \
do { \
__asm__ volatile("vsetvli t0, %[A]," #VTYPE "," #LMUL \
" \n" ::[A] "r"(VLEN)); \
} while (0)
#define COPY_SCALAR_REG(REG, DST) \
do { \
{ \
register uint32_t tmp_reg __asm__(REG); \
DST = tmp_reg; \
} \
} while (0)
extern bool test_vector(void);
bool test_main(void);
uint32_t get_vtype_e8(uint8_t, bool, bool);
uint32_t get_vtype_e16(uint8_t, bool, bool);
uint32_t get_vtype_e32(uint8_t, bool, bool);
uint32_t get_vtype_e64(uint8_t, bool, bool);
#endif