blob: 82818f0a4be709c7c7544ed7b132b6a7729e7526 [file] [log] [blame]
#ifndef TEST_V_HELPERS_H
#define TEST_V_HELPERS_H
#include <stdint.h>
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};
const int32_t AVL_COUNT = sizeof(AVLS) / sizeof(AVLS[0]);
enum VSEW {
SEW_E8 = 0,
SEW_E16 = 1,
SEW_E32 = 2,
/* // SEW limited to E32
SEW_E64 = 3,
SEW_E128 = 4,
SEW_E256 = 5,
SEW_E512 = 6,
SEW_E1024 = 7,
*/
};
enum VLMUL {
/* // Fractional LMUL not supported by our intrinsic compiler
LMUL_MF8 = 5,
LMUL_MF4 = 6,
LMUL_MF2 = 7,
*/
LMUL_M1 = 0,
LMUL_M2 = 1,
LMUL_M4 = 2,
LMUL_M8 = 3,
};
uint32_t get_vtype(VSEW sew, VLMUL lmul, bool tail_agnostic,
bool mask_agnostic);
// vsetvl rd, rs1, rs2 # rd = new vl, rs1 = AVL, rs2 = new vtype value
uint32_t set_vsetvl(VSEW sew, VLMUL lmul, uint32_t avl, bool tail_agnostic,
bool mask_agnostic);
int set_vsetvl_intrinsic(VSEW sew, VLMUL lmul, uint32_t avl);
int get_vsetvlmax_intrinsic(VSEW sew, VLMUL lmul);
int set_vsetvli(VSEW sew, VLMUL lmul, uint32_t avl);
} // namespace test_v_helpers
#endif