Quick Links
Floating point operation on ARM9
#1
Posted 08 June 2012 - 05:22 AM
I am using ARM9 processor. I want to do some floating point operation like calculating division,square root,angle between two point( atan2 function in c ).
The sqrt or atan2 function ( in c language) are slower. What i know arm is an integer processor and i have to do floating point operation on integer processor.
Can any one help me to calcutale square root angle between two point in arm ?
Regards
#2
Posted 08 June 2012 - 07:55 AM
Otherwise your stuck with the software implementation in the library. There is nothing to stop you from writing your own - question is how confident are you that you will do a better job than whoever wrote the C library?
#3
Posted 11 June 2012 - 05:14 AM
I am using two microprocessor ie. s3c2440 32 bit and s3c2416 32bit (samsung).
s3c2440 is developed using ARM920T core. s3c2440 dose not have any external coprocessor or any on chip coprocessor.(page -108,coprocessor instructions,s3c2440 datasheet)
So what i think i can not use the advantage of coprocessor on s3c2440.
s3c2416 is developed using ARM926EJ.From s3c2416 datasheet i did not get anything related to coprocessor.So i do not know about the coprocessor of s3c2416 (s3c2416 datasheet).
If both does not have any coprocessor then please help me about the floating point operation.
regards.
#4
Posted 11 June 2012 - 06:06 AM
http://www.micromegacorp.com/
If that is not feasible, let us know what your required performance is, and why that leads you to believe the C implementation is to slow.
This post has been edited by cfbsoftware: 11 June 2012 - 06:09 AM
#5
Posted 12 June 2012 - 05:34 AM
int i,j,m,n;
for(i = 0, m =75; i < 75; i++,m--)
{
for(j = 0, n = 75; j < 75; j++,n--)
{
sqrt( pow(i - m, 2) + pow(j - n, 2));
}
}
Is it faster ?
For fingerprint matching I have to do 500 to 1000 matches in around 1 sec. So for calculating distance if it will take 46ms then how i will achive my target.
Please give me any solution which will help me to achive my target.
#6
Posted 12 June 2012 - 11:21 AM
- You are using "pow" to square two integer values - why? The pow function takes double values, but just doing it by hand "(i-m)*(i-m)" will stay in integer, and not be any less precise (unless integer values are so large that they overflow).
- There are plenty of well known integer-based square root methods provided you know the bounds of the value you are square rooting does not exceed certain max values. Alternatively you may use a more approximate value which is "precise enough" for your use case.
- Lastly it look like you are calculating a distance for each "pixel" in a 75 by 75 grid. Assuming the scan always uses the same 75 by 75 dimensions, just do it offline and compile a lookup table into your program that will be _much_ faster =)
This post has been edited by isogen74: 12 June 2012 - 11:23 AM















