Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
Why is my Cortex-M4 taking too much cycles?
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
7 replies
Subscribers
127 subscribers
Views
4317 views
Users
0 members are here
Related
Why is my Cortex-M4 taking too much cycles?
Offline
Florian Augustin
over 7 years ago
Note: This was originally posted on 10th September 2012 at http://forums.arm.com
Dear Arm-experts,
i wanted to use the FPU of my STM32F4 (Cortex-M4). To see if it's working properly i compared with this page:
http://www.micromouseonline.com/2011/10/26/stm32f4-the-first-taste-of-speed/?doing_wp_cron=1347294891.0981290340423583984375
He is using exactly the same processor and toolchain (With GCC Compiler).
Here is how long it takes with my settings:
REFERENCE / [font=Verdana, sans-serif][size=2]Reference // Mycontroller running from Flash // My controller running from Sram[/size][/font]
long lX, lY, lZ;
lX = 123L; // 2 cycle // 2 cycle // 5 cycles
lY = 456L; // 2 cycle // 3 cycles // 3 cycles
lZ = lX*lY; // 5 cycles // 7 cycles // 9 cycles
fX = 123.456; // 3 cycles // 5 cycles // 4 cycles
fY = 9.99; // 3 cycles // 5 cycles // 4 cycles
fZ = fX * fY; // 6 cycles // 10 cycles // 10 cycles
fZ = sqrt(fY); // 20 cycles // 2742 cycles // 3405 cycles
fZ = sin(1.23); // 124 cycles // 1918 cycles // 2552
The settings are Arm architecture: v7EM
Arm core type: Cortex-M4
Arm FP Abi Type: Soft-FP (Or Hard, doens't make a huge difference)
Arm FPU Type: FPv4-SP-D16
GCC target: arm-unknown-eabi
So not only the floating point arithmetic is runing slower but also integer! And sin and sqrt are horrible!!
The offset of my cycle measurement is deducted.
In CP10 and CP11 is 0b11 so FPU should be enabled properly.
Do you have any idea what is wrong with my settings or my toolchain or whatever??
Thank you so much for you efforts!
Florian
Parents
Offline
Florian Augustin
over 7 years ago
Note: This was originally posted on 11th September 2012 at
http://forums.arm.com
Thanks for paying so much attention to this!I played around with the settings (treat doubles as floats, optimization level 0-3 etc).
the best results were for integer 12 cycles against 9 from the website and for float 18 compared to 12 from the website...
This is sooo confusing and I don't know what to do!
Have a nice evening!
Cancel
Up
0
Down
Reply
Cancel
Reply
Offline
Florian Augustin
over 7 years ago
Note: This was originally posted on 11th September 2012 at
http://forums.arm.com
Thanks for paying so much attention to this!I played around with the settings (treat doubles as floats, optimization level 0-3 etc).
the best results were for integer 12 cycles against 9 from the website and for float 18 compared to 12 from the website...
This is sooo confusing and I don't know what to do!
Have a nice evening!
Cancel
Up
0
Down
Reply
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Not Answered
Getting errors after including arm_math.h
0
stm32 h7
Keil
Digital Signal Processor (DSP)
STM32
25409
views
9
replies
Latest
3 months ago
by
roger-liu
Not Answered
freeRTOS demo DS-5 ERROR(CMD360) when trying to debug
+1
10594
views
12
replies
Latest
3 months ago
by
tolc
Answered
ubuntu - How to uninstall Arm Development studio and all its requirements
0
Arm Development Studio
6710
views
1
reply
Latest
3 months ago
by
Jonathan Simmonds
Answered
DSTREAM Probe damage - Spare parts?
0
DSTREAM
8942
views
2
replies
Latest
3 months ago
by
SamGKN
Suggested Answer
Optimized ARM version of memcmp
0
7468
views
3
replies
Latest
3 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum