This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR6043:TI 编译器的 iqmathlib 性能也较差?

Guru**** 1457880 points
Other Parts Discussed in Thread: MSP430FR6043
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1357344/msp430fr6043-poor-iqmathlib-performance-with-ti-compiler-too

器件型号:MSP430FR6043

gcc 的形式引入误差传递函数。

我们使用 TI 编译器尝试了完全相同的 IQmath 测试项目。  令人惊讶的结果是它的速度提高了5.5到5.8倍! 另一个好消息是、IQmathLib.A 链接良好(不像 GCC 那样提供任何警告)、并且该项目适用于更大的阵列测试尺寸(使用 GCC 时、它会卡在大于247的阵列大小?)。

但是、与常规浮点运算相比、令人失望的结果是 IQmath 性能:使用 TI 编译器时、情况仍然非常相似、 324 ms 与 370 天哪!

我们是否遗漏了提高速度所需的任何配置、或者说 IQmath lib 无法在 MSP430FR6043上正常运行?

谢谢!

丹尼尔

 

附加测试 TI-project (也可使用 GCC 作为参考)。

e2e.ti.com/.../test_5F00_TI.zipe2e.ti.com/.../2248.test_5F00_GCC.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    根据 David 的 发现、 浮子仍用于数学测试、这阻碍了时序测量。 校正后、使用 TI 编译器的新时序为0.16s 与0.37s

    经 David 的建议修改后的代码为:

    // IQ20: range -2048 ... +2047.999999046, resolution 0.000000954
    static _iq20 xm[TEST_SIZE];
    static void math_test(void)
    {
        _iq20 f1 = _IQ20(2.103f);
        _iq20 f2 = _IQ20(1.135f);
        xm[0] = _IQ20(1.0f);
        for (uint16_t i = 2; i <= TEST_SIZE; i++) {
            if (xm[i - 2U] > _IQ20(1.0f)) {
                xm[i - 1U] = _IQ20div((_IQ20mpy(f1, _IQ20(i + 1U)) + _IQ20mpy(f2, _IQ20(i - 1U))), xm[i - 2U]);
            } else {
                xm[i - 1U] = _IQ20mpy((_IQ20mpy(f1, _IQ20(i + 1U)) + _IQ20mpy(f2, _IQ20(i - 1U))), xm[i - 2U]);
            }
        }
    }