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.

[参考译文] TMS320F28377D:浮点和双精度之间的差异

Guru**** 2875350 points

Other Parts Discussed in Thread: TMS320F28377D

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1629953/tms320f28377d-differences-between-float-and-double

器件型号: TMS320F28377D

您好:  

我知道 float 和 double 都是 TMS320F28377d 中的 32 位数据类型。  

  1. double 和 float 之间有什么区别?

   2. 它们是否都使用 FPU 处理? 处理时间是否会有所不同?

 

感谢你的帮助。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    COFF ABI
    • float  double 都是 32 位单精度浮点类型
    • 这使该 double 类型本质上成为的别名 float、从而节省内存、并可能在仅 FPU32 的硬件上提供更快的性能、因为所有操作都是 32 位的。
    • 不带 f 后缀(例如)写入的浮点常量 42.2被视为 32 位值、与 double 此 ABI 中的定义一致。  
    EABI
    • float 是 32 位单精度类型、而 double 是 64 位双精度类型
    • 这符合业界通用 C/C++定义(IEEE 754 标准)。
    • 为 EABI 编译的代码对 double 变量使用 64 位运算。 如果目标处理器只有 32 位 FPU (FPU32)、则必须在软件中仿真这些 64 位运算、从而导致执行速度变慢。
    • 不带 f 后缀的浮点常量 double 被编译器视为 64 位、这可以隐式将慢速 64 位运算引入到用于 32 位浮点值的代码库中。