打印
[信息]

【转】关于STM32系列的浮点运算能力

[复制链接]
2827|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
人丑没人疼|  楼主 | 2017-1-12 12:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

总结,

CortexM4架构的都是单精度的

CotexM7结构的单双都有,目前是F7才有M7架构



从文档en.brstm32-STM32 32-bit MCU family - Leading supplier of ARM® Cortex®-M microcontrollers来看

STM32F7/4/3,

STM32L4

都带有DSP和浮点运算单元


系列频率特点
STM32F7216Mhz Cortex-M7 L1-Cache高性能
STM32F4180Mhz Cortex-M4高性能
STM32F372Mhz Cortex-M4
STM32L480Mhz Cortex-M4极低功耗


根据我们的经验,F767双精度跑一次用20+ms,23左右吧

单精度和整数运算好像没差别,可能是因为我们的测试用例用的都是双精度测试用例,等有空的时候研究下这个地方:为什么单精度和整数运算好像没差别


我们的目标是用200+ms以下,考虑到特殊情况复杂度是指数级增长,控制在160ms以下才是合理的


根据文档en.brstm32f7-STM32F7 series - High performance - 32-bit MCUs

F7系列里面,频率都是216


产品FPUL1-Cache
STM32F7x8/9双精度16+16K
STM32F7x7双精度16+16K
STM32F7x6单精度4+4K
STM32F765双精度16+16K
STM32F745单精度4+4K


Cortex7的文档


ARM Cortex-M7 Processor Technical Reference Manual
Revision r1p1
Home > Floating Point Unit > About the FPU

8.1. About the FPU
The Cortex-M7 processor with FPU is an implementation of thesingle-precision and double-precision variant of the ARMv7-M Architecture with Floating-Point Extension (FPv5).




根据Cortex4的文档:

Cortex-M4 Technical Reference Manual
Revision r0p0
Home > Floating Point Unit > About the FPU

7.1. About the FPU
The Cortex-M4 FPU is an implementation of thesingle precision variant of the ARMv7-M Floating-Point Extension (FPv4-SP). It provides floating-point computation functionality that is compliant with the ANSI/IEEE Std 754-2008, IEEE Standard for Binary Floating-Point Arithmetic, referred to as the IEEE 754 standard. The FPU supports all single-precision data-processing instructions and data types described in the ARM Architecture Reference Manual.

所以F4/3还有L4应该都是单精度的了


沙发
wahahaheihei| | 2017-1-12 16:18 | 只看该作者
一般设计程序的运算地方,能避免使用浮点的就不要用,这个会明显降低速度。

使用特权

评论回复
板凳
ticomi| | 2017-1-13 08:48 | 只看该作者
wahahaheihei 发表于 2017-1-12 16:18
一般设计程序的运算地方,能避免使用浮点的就不要用,这个会明显降低速度。 ...

原则是如此,但是很多很多时候是无法避免的

使用特权

评论回复
地板
wahahaheihei| | 2017-1-13 21:35 | 只看该作者
无法避免的时候尽量精简计算量。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

55

主题

97

帖子

0

粉丝