dsp.cc (5570:13592d41f290) dsp.cc (6712:b95abe00dd9d)
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 449 unchanged lines hidden (view full) ---

458{
459 int nvals = SIMD_NVALS[SIMD_FMT_W];
460 int32_t result;
461 uint32_t ouflag = 0;
462 uint64_t a_values[SIMD_MAX_VALS];
463 uint64_t b_values[SIMD_MAX_VALS];
464 uint64_t c_values[SIMD_MAX_VALS];
465
1/*
2 * Copyright (c) 2007 MIPS Technologies, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 449 unchanged lines hidden (view full) ---

458{
459 int nvals = SIMD_NVALS[SIMD_FMT_W];
460 int32_t result;
461 uint32_t ouflag = 0;
462 uint64_t a_values[SIMD_MAX_VALS];
463 uint64_t b_values[SIMD_MAX_VALS];
464 uint64_t c_values[SIMD_MAX_VALS];
465
466 memset(c_values, 0, sizeof(c_values));
467
466 simdUnpack(a, a_values, SIMD_FMT_PH, SIGNED);
467 simdUnpack(b, b_values, SIMD_FMT_PH, SIGNED);
468
469 switch (mode) {
470 case MODE_L:
471 for (int i = 0; i < nvals; i++)
472 c_values[i] = dspSaturate(a_values[i + 1] * b_values[i + 1] << 1,
473 SIMD_FMT_W, SIGNED, &ouflag);

--- 264 unchanged lines hidden (view full) ---

738
739int64_t
740MipsISA::dspMulsaq(int64_t dspac, int32_t a, int32_t b, int32_t ac,
741 int32_t fmt, uint32_t *dspctl)
742{
743 int nvals = SIMD_NVALS[fmt];
744 uint64_t a_values[SIMD_MAX_VALS];
745 uint64_t b_values[SIMD_MAX_VALS];
468 simdUnpack(a, a_values, SIMD_FMT_PH, SIGNED);
469 simdUnpack(b, b_values, SIMD_FMT_PH, SIGNED);
470
471 switch (mode) {
472 case MODE_L:
473 for (int i = 0; i < nvals; i++)
474 c_values[i] = dspSaturate(a_values[i + 1] * b_values[i + 1] << 1,
475 SIMD_FMT_W, SIGNED, &ouflag);

--- 264 unchanged lines hidden (view full) ---

740
741int64_t
742MipsISA::dspMulsaq(int64_t dspac, int32_t a, int32_t b, int32_t ac,
743 int32_t fmt, uint32_t *dspctl)
744{
745 int nvals = SIMD_NVALS[fmt];
746 uint64_t a_values[SIMD_MAX_VALS];
747 uint64_t b_values[SIMD_MAX_VALS];
746 int64_t temp[2];
748 int64_t temp[2] = {0, 0};
747 uint32_t ouflag = 0;
748
749 simdUnpack(a, a_values, fmt, SIGNED);
750 simdUnpack(b, b_values, fmt, SIGNED);
751
752 for (int i = nvals - 1; i > -1; i--) {
753 temp[i] = a_values[i] * b_values[i] << 1;
754 if (a_values[i] == FIXED_SMIN[fmt] && b_values[i] == FIXED_SMIN[fmt]) {

--- 435 unchanged lines hidden ---
749 uint32_t ouflag = 0;
750
751 simdUnpack(a, a_values, fmt, SIGNED);
752 simdUnpack(b, b_values, fmt, SIGNED);
753
754 for (int i = nvals - 1; i > -1; i--) {
755 temp[i] = a_values[i] * b_values[i] << 1;
756 if (a_values[i] == FIXED_SMIN[fmt] && b_values[i] == FIXED_SMIN[fmt]) {

--- 435 unchanged lines hidden ---