A program to test efficiency of emulated FPU

Discussion in 'C++' started by tomekwr@gmail.com, Jan 19, 2007.

  1. Guest

    Hi,

    I had to write a class which would emulate FPU using normal fixed point
    operations, and to test it in some real application. I thought about
    some encoding programs but I don't have much idea, which one would be
    suitable. I mean that 1. it would use FPU a lot - to be able to see
    some difference in time, 2. it would be relatively easy to change the
    source code to accept my class (which is written in C++). If you've got
    any idea, please help, I would really appreciate it.

    Thanks in advance
    Tomek W.

    (this was posted to comp.compression, too)
     
    , Jan 19, 2007
    #1
    1. Advertising

  2. kwikius Guest

    wrote:
    > Hi,
    >
    > I had to write a class which would emulate FPU using normal fixed point
    > operations, and to test it in some real application. I thought about
    > some encoding programs but I don't have much idea, which one would be
    > suitable. I mean that 1. it would use FPU a lot - to be able to see
    > some difference in time, 2. it would be relatively easy to change the
    > source code to accept my class (which is written in C++). If you've got
    > any idea, please help, I would really appreciate it.
    >
    > Thanks in advance
    > Tomek W.


    Hows about applying some transform matrices to sets of points templated
    on your fixed point types, versus floats, doubles etc.

    regards
    Andy Little
     
    kwikius, Jan 19, 2007
    #2
    1. Advertising

  3. On Jan 19, 3:02 pm, wrote:
    > Hi,
    >
    > I had to write a class which would emulate FPU using normal fixed point
    > operations, and to test it in some real application. I thought about
    > some encoding programs but I don't have much idea, which one would be
    > suitable. I mean that 1. it would use FPU a lot - to be able to see
    > some difference in time, 2. it would be relatively easy to change the
    > source code to accept my class (which is written in C++). If you've got
    > any idea, please help, I would really appreciate it.


    It might be of interest to compare different kinds of operations, for
    example + and - are usually quite fast (talking float/double here)
    while * and / can take some time. So perhaps you can start of by
    creating some synthetic benchmarks, use some random routine to produce
    a list of say 1000 FP numbers, for each of them create a double version
    and a yourtype version and put them in an array. Then comes the
    benchmark: first measure the time it takes to perform some operation
    (summing) the doubles then measure the time needed to do the same
    operation on your types.

    If you want more realistic benchmarks try finding an algorithm for
    solving systems of linear equations and implement it. Use a typedef for
    the type used in the calculations so you can easily switch (given that
    yourtype have similar interface as float/double) and then download a
    matrix from the next and try to solve the system (it's a O(n^3)
    operation for simple algorithms). I'd recommend a matrix of size
    somewhere between 500x500 to 5000x5000, it's better to run the test
    many times than taking a too large matrix.

    --
    Erik Wikström
     
    =?iso-8859-1?q?Erik_Wikstr=F6m?=, Jan 19, 2007
    #3
  4. Guest

    Thank you for your answers very much, but my problem is that I have to
    link it wit some real application, which does some real task, like
    encoding something, and I'm looking for one, that'd be suitable for
    that. Sorry, maybe the post was a lil offtopic.

    Thanks!
    Tomek W.
     
    , Jan 19, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    4
    Views:
    1,860
    Darryl Pierce
    Feb 12, 2005
  2. Dimitri Ognibene

    What FPU intructions JDK support

    Dimitri Ognibene, May 2, 2006, in forum: Java
    Replies:
    7
    Views:
    380
    Chris Uppal
    May 3, 2006
  3. Wolfgang Tischer

    Borland C++ direct fpu commands

    Wolfgang Tischer, Feb 10, 2005, in forum: C++
    Replies:
    6
    Views:
    1,834
    Wolfgang Tischer
    Feb 11, 2005
  4. Replies:
    0
    Views:
    452
  5. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    765
    Skybuck Flying
    Oct 4, 2009
Loading...

Share This Page