aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/kdmabb16.h
blob: 2ccd40b1caeee3e466164a9756bf3411ebf08149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require_vector_vs;
require_rv64;
P_LOOP(32, {
  int32_t aop = P_SH(ps1, 0);
  int32_t bop = P_SH(ps2, 0);  
  int32_t mres;
  bool sat;

  if ((INT16_MIN != aop) | (INT16_MIN != bop)) {
    mres = aop * bop;
    mres <<= 1;
  } else {
    mres = INT32_MAX;
    P_SET_OV(1);
  }
  pd = (sat_add<int32_t, uint32_t>(pd, mres, sat));
  P_SET_OV(sat);
})