aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/vror_vi.h
blob: 1269c3d4777a91716450ddb04d8ff70134d3b78b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// vror.vi vd, vs2, zimm6, vm

#include "zvk_ext_macros.h"

require_zvbb;

// 'mask' selects the low log2(vsew) bits of the shift amount,
// to limit the maximum shift to "vsew - 1" bits.
const reg_t mask = P.VU.vsew - 1;

// For .vi, the shift amount comes from bits [26,19-15].
const reg_t rshift = insn.v_zimm6() & mask;
const reg_t lshift = (-rshift) & mask;

VI_V_ULOOP
({
  vd = (vs2 << lshift) | (vs2 >> rshift);
})