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
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
IP Products
Processors
Jump...
Cancel
Processors
Classic processors forum
compile time constant expressions
Blogs
Forums
Videos & Files
Help
Jump...
Cancel
New
State
Accepted Answer
+1
person also asked this
people also asked this
Replies
4 replies
Subscribers
2 subscribers
Views
3242 views
Users
0 members are here
compiler
optimization
Arm9
arm926ej-s
MPI
Related
compile time constant expressions
Offline
Mike Rieker
over 7 years ago
Note: This was originally posted on 12th March 2009 at
http://forums.arm.com
I am seeing code like this generated from the armcc v4.0 compiler (just downloaded it a couple hours ago):
MOV r0,#5
CLZ r0,r0
RSB r7,r0,#0x3f
So I would think the compiler would know that R7 has 34 in it or whatever. It isn't so bad these three instructions, it's just that in this case the code goes on to divide by the r7 value and so generates a call to __aeabi_uldivmod whereas I was expecting the compiler to generate a UMULL or something like that.
Is there some command-line optimization option I can use to fix this? I am using this command line:
armcc --cpu=ARM926EJ-S --inline -Otime -O3 -S -o test.s test.c
Thanks!
Mike
Top replies
Offline
Simon Craske
over 7 years ago
+1
verified
Note: This was originally posted on 13th March 2009 at http://forums.arm.com There isn't a count leading zero construct in the C language, so presumably it's something like: [font="Courier New"]int func...
Parents
0
Offline
unclep unclep
over 7 years ago
Note: This was originally posted on 12th March 2009 at
http://forums.arm.com
Interestingly inefficient. Curious to know: what source led to this output?
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Reply
0
Offline
unclep unclep
over 7 years ago
Note: This was originally posted on 12th March 2009 at
http://forums.arm.com
Interestingly inefficient. Curious to know: what source led to this output?
Cancel
Up
0
Down
Reply
Accept answer
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
Answered
MIPS Calculation on ARMv7
+1
Armv7-A
Armv7-M
Arm9
7664
views
5
replies
Latest
over 4 years ago
by
Yasuhiko Koumoto
Answered
Why does ARM have 64KB Large Pages?
0
Arm7
Memory Management Unit (MMU)
3120
views
1
reply
Latest
over 4 years ago
by
Yasuhiko Koumoto
Answered
What is the difference between instruction prefetch and instruction pipelining in arm7tdmi?
+1
Arm7
7594
views
6
replies
Latest
over 4 years ago
by
Yasuhiko Koumoto
Answered
can anyone tell me the difference between pipelined bus and depipelined bus?and i have uploaded two screen shot of both so what does that arrow from mclk to a[31:0] indicates?
0
Arm7
8674
views
9
replies
Latest
over 4 years ago
by
Colin Campbell
Answered
Modified harvard architecture
0
Arm7
19029
views
13
replies
Latest
over 5 years ago
by
G. Goodwin L. Pitos
<
>
View all questions in Classic processors forum