Efficient-C-for-ARM | Efficient C for ARM '' training course | Machine Learning library
kandi X-RAY | Efficient-C-for-ARM Summary
kandi X-RAY | Efficient-C-for-ARM Summary
Examples from my Efficient C for ARM training course.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Efficient-C-for-ARM
Efficient-C-for-ARM Key Features
Efficient-C-for-ARM Examples and Code Snippets
Community Discussions
Trending Discussions on Efficient-C-for-ARM
QUESTION
Apparently it's true that on ARM cpus, division is 10-100x slower than bit shifts. On this site it is stated that this can be solved in a number of ways. One of them being look-up tables for small problems, which is fine and standard. But listed was also replacing division with multiplication by a fixed-point reciprocal followed by a bit shift (so that x/3
becomes (x*6) << 1
etc) Another was replacing (x % y) > z
with x > (z * y)
.
I'm far from an expert, but this sounds really odd to me. I mean, if you're using a modern compiler, wouldn't this be exactly the kind of thing that is optimized for you?
...ANSWER
Answered 2017-Mar-01 at 09:28unsigned int fun1 ( unsigned int a, unsigned int b )
{
return(a/b);
}
unsigned int fun2 ( unsigned int a )
{
return(a/2);
}
unsigned int fun3 ( unsigned int a )
{
return(a/3);
}
unsigned int fun10 ( unsigned int a )
{
return(a/10);
}
unsigned int fun13 ( void )
{
return(10/13);
}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Efficient-C-for-ARM
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page