Forum Discussion
Altera_Forum
Honored Contributor
15 years agoMath functions (sine & cosine) latency
Can anyone provide the data about the latency for sine and cosine single precision functions from math.h lib on Cyclone III, possibly Cyclone II, with floating point hardware acceleration (hardware d...
Altera_Forum
Honored Contributor
15 years agoI seem to recall the math library uses lookup tables so I don't think the FPUCI will help much (it's been a while I could be wrong....) If you get your hands on a dedicated sine/cosine hardware block and integrate it as a custom instruction you can pass these to the compiler to target them directly:
-mcustom-fsins=<x> -mcustom-fcoss=<y> <x> and <y> are the custom instruction indexes you assigned. There are double precision equivalents but I would start off with single precision since there are other things you have to take care of to target double precision.