Lines Matching refs:fmt
61 MipsISA::dspSaturate(uint64_t value, int32_t fmt, int32_t sign,
68 if (svalue > (int64_t)FIXED_SMAX[fmt]) {
70 svalue = (int64_t)FIXED_SMAX[fmt];
71 } else if (svalue < (int64_t)FIXED_SMIN[fmt]) {
73 svalue = (int64_t)FIXED_SMIN[fmt];
77 if (svalue > (int64_t)FIXED_UMAX[fmt]) {
79 svalue = FIXED_UMAX[fmt];
80 } else if (svalue < (int64_t)FIXED_UMIN[fmt]) {
82 svalue = FIXED_UMIN[fmt];
91 MipsISA::checkOverflow(uint64_t value, int32_t fmt, int32_t sign,
99 if (svalue > (int64_t)FIXED_SMAX[fmt] ||
100 svalue < (int64_t)FIXED_SMIN[fmt])
104 if (svalue > (int64_t)FIXED_UMAX[fmt] ||
105 svalue < (int64_t)FIXED_UMIN[fmt])
114 MipsISA::signExtend(uint64_t value, int32_t fmt)
116 int32_t signpos = SIMD_NBITS[fmt];
135 MipsISA::dspAbs(int32_t a, int32_t fmt, uint32_t *dspctl)
137 int nvals = SIMD_NVALS[fmt];
143 simdUnpack(a, a_values, fmt, SIGNED);
148 if (a_values[i] == FIXED_SMIN[fmt]) {
149 a_values[i] = FIXED_SMAX[fmt];
156 simdPack(a_values, &result, fmt);
166 MipsISA::dspAdd(int32_t a, int32_t b, int32_t fmt, int32_t saturate,
169 int nvals = SIMD_NVALS[fmt];
175 simdUnpack(a, a_values, fmt, sign);
176 simdUnpack(b, b_values, fmt, sign);
181 a_values[i] = dspSaturate(a_values[i] + b_values[i], fmt, sign,
184 a_values[i] = checkOverflow(a_values[i] + b_values[i], fmt, sign,
188 simdPack(a_values, &result, fmt);
198 MipsISA::dspAddh(int32_t a, int32_t b, int32_t fmt, int32_t round,
201 int nvals = SIMD_NVALS[fmt];
206 simdUnpack(a, a_values, fmt, sign);
207 simdUnpack(b, b_values, fmt, sign);
216 simdPack(a_values, &result, fmt);
222 MipsISA::dspSub(int32_t a, int32_t b, int32_t fmt, int32_t saturate,
225 int nvals = SIMD_NVALS[fmt];
231 simdUnpack(a, a_values, fmt, sign);
232 simdUnpack(b, b_values, fmt, sign);
236 a_values[i] = dspSaturate(a_values[i] - b_values[i], fmt, sign,
239 a_values[i] = checkOverflow(a_values[i] - b_values[i], fmt, sign,
243 simdPack(a_values, &result, fmt);
253 MipsISA::dspSubh(int32_t a, int32_t b, int32_t fmt, int32_t round,
256 int nvals = SIMD_NVALS[fmt];
261 simdUnpack(a, a_values, fmt, sign);
262 simdUnpack(b, b_values, fmt, sign);
272 simdPack(a_values, &result, fmt);
278 MipsISA::dspShll(int32_t a, uint32_t sa, int32_t fmt, int32_t saturate,
281 int nvals = SIMD_NVALS[fmt];
286 sa = bits(sa, SIMD_LOG2N[fmt] - 1, 0);
287 simdUnpack(a, a_values, fmt, sign);
292 a_values[i] = dspSaturate(a_values[i] << sa, fmt, sign, &ouflag);
294 a_values[i] = checkOverflow(a_values[i] << sa, fmt, sign, &ouflag);
297 simdPack(a_values, &result, fmt);
307 MipsISA::dspShrl(int32_t a, uint32_t sa, int32_t fmt, int32_t sign)
309 int nvals = SIMD_NVALS[fmt];
313 sa = bits(sa, SIMD_LOG2N[fmt] - 1, 0);
315 simdUnpack(a, a_values, fmt, UNSIGNED);
320 simdPack(a_values, &result, fmt);
326 MipsISA::dspShra(int32_t a, uint32_t sa, int32_t fmt, int32_t round,
329 int nvals = SIMD_NVALS[fmt];
333 sa = bits(sa, SIMD_LOG2N[fmt] - 1, 0);
335 simdUnpack(a, a_values, fmt, SIGNED);
344 simdPack(a_values, &result, fmt);
350 MipsISA::dspMulq(int32_t a, int32_t b, int32_t fmt, int32_t saturate,
353 int nvals = SIMD_NVALS[fmt];
354 int sa = SIMD_NBITS[fmt];
361 simdUnpack(a, a_values, fmt, SIGNED);
362 simdUnpack(b, b_values, fmt, SIGNED);
371 if (a_values[i] == FIXED_SMIN[fmt] && b_values[i] == FIXED_SMIN[fmt]) {
375 temp = FIXED_SMAX[fmt];
381 simdPack(a_values, &result, fmt);
391 MipsISA::dspMul(int32_t a, int32_t b, int32_t fmt, int32_t saturate,
394 int nvals = SIMD_NVALS[fmt];
400 simdUnpack(a, a_values, fmt, SIGNED);
401 simdUnpack(b, b_values, fmt, SIGNED);
406 a_values[i] = dspSaturate(a_values[i] * b_values[i], fmt, SIGNED,
409 a_values[i] = checkOverflow(a_values[i] * b_values[i], fmt, SIGNED,
413 simdPack(a_values, &result, fmt);
629 int32_t fmt, int32_t sign, int32_t mode)
631 int nvals = SIMD_NVALS[fmt];
635 simdUnpack(a, a_values, fmt, sign);
636 simdUnpack(b, b_values, fmt, sign);
657 int32_t fmt, int32_t sign, int32_t mode)
659 int nvals = SIMD_NVALS[fmt];
663 simdUnpack(a, a_values, fmt, sign);
664 simdUnpack(b, b_values, fmt, sign);
685 int32_t fmt, int32_t mode, int32_t saturate, uint32_t *dspctl)
687 int nvals = SIMD_NVALS[fmt - 1];
693 simdUnpack(a, a_values, fmt, SIGNED);
694 simdUnpack(b, b_values, fmt, SIGNED);
700 if (a_values[i + 1] == FIXED_SMIN[fmt] &&
701 b_values[i + 1] == FIXED_SMIN[fmt]) {
702 temp = (int64_t)FIXED_SMAX[fmt - 1];
708 if (a_values[i] == FIXED_SMIN[fmt] &&
709 b_values[i] == FIXED_SMIN[fmt]) {
710 temp = (int64_t)FIXED_SMAX[fmt - 1];
719 temp = dspSaturate(temp, fmt - 1, SIGNED, &ouflag);
728 MipsISA::dspMulsa(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt)
733 simdUnpack(a, a_values, fmt, SIGNED);
734 simdUnpack(b, b_values, fmt, SIGNED);
743 int32_t fmt, uint32_t *dspctl)
745 int nvals = SIMD_NVALS[fmt];
751 simdUnpack(a, a_values, fmt, SIGNED);
752 simdUnpack(b, b_values, fmt, SIGNED);
756 if (a_values[i] == FIXED_SMIN[fmt] && b_values[i] == FIXED_SMIN[fmt]) {
757 temp[i] = FIXED_SMAX[fmt - 1];
771 MipsISA::dspCmp(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op,
774 int nvals = SIMD_NVALS[fmt];
779 simdUnpack(a, a_values, fmt, sign);
780 simdUnpack(b, b_values, fmt, sign);
804 MipsISA::dspCmpg(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op)
806 int nvals = SIMD_NVALS[fmt];
811 simdUnpack(a, a_values, fmt, sign);
812 simdUnpack(b, b_values, fmt, sign);
836 MipsISA::dspCmpgd(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op,
839 int nvals = SIMD_NVALS[fmt];
845 simdUnpack(a, a_values, fmt, sign);
846 simdUnpack(b, b_values, fmt, sign);
944 MipsISA::dspPrecrq(int32_t a, int32_t b, int32_t fmt, uint32_t *dspctl)
952 simdUnpack(a, a_values, fmt, SIGNED);
953 simdUnpack(b, b_values, fmt, SIGNED);
956 fmt + 1, SIGNED, &ouflag);
958 fmt + 1, SIGNED, &ouflag);
960 simdPack(r_values, &result, fmt + 1);
969 MipsISA::dspPrecrSra(int32_t a, int32_t b, int32_t sa, int32_t fmt,
972 int nvals = SIMD_NVALS[fmt];
978 simdUnpack(a, a_values, fmt, SIGNED);
979 simdUnpack(b, b_values, fmt, SIGNED);
991 simdPack(c_values, &result, fmt + 1);
997 MipsISA::dspPick(int32_t a, int32_t b, int32_t fmt, uint32_t *dspctl)
999 int nvals = SIMD_NVALS[fmt];
1005 simdUnpack(a, a_values, fmt, UNSIGNED);
1006 simdUnpack(b, b_values, fmt, UNSIGNED);
1016 simdPack(c_values, &result, fmt);
1022 MipsISA::dspPack(int32_t a, int32_t b, int32_t fmt)
1029 simdUnpack(a, a_values, fmt, UNSIGNED);
1030 simdUnpack(b, b_values, fmt, UNSIGNED);
1035 simdPack(c_values, &result, fmt);
1041 MipsISA::dspExtr(int64_t dspac, int32_t fmt, int32_t sa, int32_t round,
1067 dspac = checkOverflow(dspac, fmt, SIGNED, &ouflag);
1073 result = (int32_t)dspSaturate(temp, fmt, SIGNED, &ouflag);
1128 MipsISA::simdPack(uint64_t *values_ptr, int32_t *reg, int32_t fmt)
1130 int nvals = SIMD_NVALS[fmt];
1131 int nbits = SIMD_NBITS[fmt];
1140 MipsISA::simdUnpack(int32_t reg, uint64_t *values_ptr, int32_t fmt, int32_t sign)
1142 int nvals = SIMD_NVALS[fmt];
1143 int nbits = SIMD_NBITS[fmt];
1149 values_ptr[i] = signExtend(tmp, fmt);