Hi Andy, On Wed, Oct 3, 2012 at 5:07 PM, andy pugh <bodge...@gmail.com> wrote: > On 3 October 2012 19:26, Sebastian Kuzminsky <s...@highlab.com> wrote: > >> That looks great! > > Glad you think so. > I have a supplementary question. > > I can support an arbitrary precision and width by using a lot of > floating-point, i.e. a floating-point / or * 10 for every digit in the > floats. > The example display takes 17uS (max) per thread to generate in that > case. That is the cost when generating 9 digits into the buffer. (more > digits, more cost). > I have re-coded to first copy the offset value into a uint (so, for > example, 4 digits of pi becomes 31415). This saves a lot of time, the > max execution time for the same sample display drops to 4.8uS. > The drawback is that this only allows 9 digits of decimal precision. > (999,999,999 is the biggest that fits in a uint). > Using a U64 would allow me to support 19 digits, but there is no > 64-bit division or modulus in the kernel which makes it more tricky.
There is do_div (for all architectures) and div_u64_rem (for x86) in <asm/div64.h> -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers