1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
require_vector_vs; P_LOOP(32, { int64_t addop = 0; int64_t mres = 0; bool sat = false; if ((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) { mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1; addop = ((mres >> 15) + 1) >> 1; } else { addop = INT32_MAX; P_SET_OV(1); } pd = (sat_add<int32_t, uint32_t>(pd, addop, sat)); P_SET_OV(sat); })