aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/fsl.h
blob: 53a21608d97ee468501f82ca2cea3de99e0ea532 (plain)
1
2
3
4
5
6
7
8
9
require_extension(EXT_XZBT);
int shamt = RS2 & (2*xlen-1);
reg_t a = RS1, b = RS3;
if (shamt >= xlen) {
	a = RS3, b = RS1;
	shamt -= xlen;
}
int rshamt = -shamt & (xlen-1);
WRITE_RD(sext_xlen(shamt ? (a << shamt) | (zext_xlen(b) >> rshamt) : a));