473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

A program to test efficiency of emulated FPU

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 '07 #1
3 1649

tome...@gmail.com 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

Jan 19 '07 #2
On Jan 19, 3:02 pm, tome...@gmail.com 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

Jan 19 '07 #3
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 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kyle | last post by:
Hello all! I'm looking into developing a biological program for modeling and sequencing DNA and other biological processes. The program's main focus would be to look for similarities and...
27
by: Mark A. Nicolosi | last post by:
I've been trying to learn C for quite a while. But I've had trouble with the lack of good quality online text (some of it's alright). But I finally bought a book on C, Practical C. I like it...
14
by: noridotjabi | last post by:
Two questions. 1)Is there any way that I can read from an executable and then execute what I have read. EXAMPLE: text text this is more text
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
4
by: mike | last post by:
I need to do a minor update to a 8051 program written in assembler in 1994 and assembled on a machine/language that no longer exists. I wrote the program, so I have some idea how it works. The...
34
by: Tom | last post by:
I'd greatly appreciate advice and code snippets on how to create a ram disk within a C/C++ program. I also need to be able to determine the free space. Thanks in advance for any help.
334
by: Antoninus Twink | last post by:
The function below is from Richard HeathField's fgetline program. For some reason, it makes three passes through the string (a strlen(), a strcpy() then another pass to change dots) when two would...
5
by: want.to.be.professer | last post by:
For OO design, I like using virtual member function.But considering efficiency, template is better. Look at this program, class Animal { public: virtual void Walk() = 0; }; class Dog
1
by: buckibooster | last post by:
I am not an experienced web developer. In fact, I am an engineer working in the envirojnmental, health and safety (EH&S) field. The web page I am developing is a tool to be used by our project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.