OpenCores
no use no use 1/1 no use no use
Reporting single-precision floating point values of an array
by tanmay2592 on May 26, 2014
tanmay2592
Posts: 5
Joined: May 16, 2014
Last seen: Jun 13, 2014
I am running a C code on orpsoc under simulation.It has an array distances[8] to be processed.The statements:-
"distances[0]= sqrt(tmp);
rt_ptr=(int *)(&distances[0]);
report(*rt_ptr); "
works fine.but if I use any other element of the array instead of distance[0] it reports "0xxxxxxxxx".Why? What does this means?
Whereas
" distances[4]= sqrt(tmp);
b=distances[4];
rt_ptr=(int *)(&b);
report(*rt_ptr); "
works fine with all the elements.

One more issue.When I am using expf() or sqrt() statements inside a for loop.The make process gives me an error as "undefined reference to expf()/sqrt() respectively.I have unrolled the loop containing these functions and now no such error is being raised.Why can not these functions be associated with the loop variables?I am using Ubuntu OpenRISC Virtual Image.
no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.