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.

[参考译文] TMS320F280049:#3195-D (性能) EABI 双精度为64位、而 COFF 为32位。 考虑将双精度型更改为浮点型、以提高 FPU32模式下的性能。

Guru**** 2466550 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1489523/tms320f280049-3195-d-performance-eabi-double-precision-is-64-bits-as-opposed-to-32-bits-for-coff-consider-changing-doubles-to-floats-for-improved-performance-in-fpu32-mode

器件型号:TMS320F280049

工具与软件:

我收到以下警告:

 #3195-D (性能) EABI 双精度为64位、而 COFF 为32位。 考虑将双精度型更改为浮点型、以提高 FPU32模式下的性能。

下面是我的代码:

b += sprintf( b,"回读:%f\r\n", getTarget ());

这里是被调用函数

float32_t getTarget (void);

该警告仅在此处写入常量链接时消失

b += sprintf( b,"回读:%f\r\n", 3.5f );

我正在使用中

Code Composer Studio

版本:12.8.1.00005

和默认设置(fpu32)

我该怎么办?

提前感谢您

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

    您能告诉我 typedef 是什么 float32_t 吗?

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

    typedef 浮点      float32_t;

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

    这是 声明 typedef 的文件"hw_types.h"的摘录。 . .

    #ifndef C2000_IEEE754_TYPES
    #define C2000_IEEE754_TYPES
    #ifdef _TI_EABI__
    typedef float float32_t;
    typedef double float64_t;
    #else // TI COFF
    typedef float float32_t;
    typedef long double float64_t;
    #endif //__TI_EABI__
    #endif // C2000_IEEE754_types

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

    我可以复制...

    [报价用户 id="534062" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1489523/tms320f280049-3195-d-performance-eabi-double-precision-is-64-bits-as-opposed-to-32-bits-for-coff-consider-changing-doubles-to-floats-for-improved-performance-in-fpu32-mode "]

     #3195-D (性能) EABI 双精度为64位、而 COFF 为32位。 考虑将双精度型更改为浮点型、以提高 FPU32模式下的性能。

    下面是我的代码:

    b += sprintf( b,"回读:%f\r\n", getTarget ());

    这里是被调用函数

    float32_t getTarget (void);

    [报价]

    我无法再现...

    [报价用户 id="534062" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1489523/tms320f280049-3195-d-performance-eabi-double-precision-is-64-bits-as-opposed-to-32-bits-for-coff-consider-changing-doubles-to-floats-for-improved-performance-in-fpu32-mode "]

    该警告仅在此处写入常量链接时消失

    b += sprintf( b,"回读:%f\r\n", 3.5f );

    [报价]

    但我仍然获得警告诊断。

    在此特定示例中、通过 A 悬空 目标 冲刺 、没有什么可以避免该类型的操作 双精度 .  即使是常数也是如此 3.5f 、类型的值 双精度 传递到 冲刺 .

    最好的办法是抑制诊断。  请搜索 C28x 编译器手册 、查找  标题为"了解诊断消息"的子章节和标题为 "诊断消息 pragma "的子章节。  您将了解到在本例中的诊断 ID 为3195、可以通过命令行选项将其抑制 -- diag_suppress=3195 或...

    #pragma diag_suppress 3195

    谢谢。此致、

    -George.