blob: abddce74d233edba3e080fff6d7e0a6ad2be4cb6 [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) \
__asm__ volatile("vsetvli t0, %[A]," #VTYPE "," #LMUL \
", tu, mu\n" ::[A] "r"(VLEN));
#define COPY_SCALAR_REG(DST) \
__asm__ volatile("sw t0, 0(%[A])\n" ::[A] "r"(&DST));
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