aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/smal.h
blob: 09b818d72bb2be23b64fb23176f79678c59d20b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
require_extension(EXT_ZPSFOPERAND);
sreg_t res = 0;
if (xlen == 32) {
  res = RS1_PAIR;
  res += sext_xlen(P_SH(RS2, 0) * P_SH(RS2, 1));
  WRITE_RD_PAIR(res);
} else {
  res = sext_xlen(P_SH(RS2, 0) * P_SH(RS2, 1)) +
        sext_xlen(P_SH(RS2, 2) * P_SH(RS2, 3)) + RS1;
  WRITE_RD(res);
}