| #ifndef TEST_V_HELPERS_H |
| #define TEST_V_HELPERS_H |
| |
| namespace test_v_helpers { |
| |
| 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); |
| |
| } |
| #endif |