Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHmmm..... I've just been looking at the newlib sources (from the gcc 3 build).
There seem to be 2 copies of the trig functions, both seem to use the taylor series (possibly with lightly modified coeffs to reduce the error). I'm not sure how well either version will actually compile for nios2, for speed you probably want the constants loaded from the 'small data' segment - and I don't think that will happen with the given code and the altera built compiler. I'd also check that GET_FLOAT_WORD() doesn't involve a memory write-read - if so replace with an inline asm function. You might find it worth while getting those sources and compiling the functions as part of your app - that will make changing them much easier.