473,735 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.compressio n, too)

Jan 19 '07 #1
3 1662

tome...@gmail.c om 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.c om 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
2578
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 differences between different models of experiments. I would also being using information from this website in my work also: http://www.ncbi.nlm.nih.gov/
27
3104
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 alot. I'm pretty familiar with the C basics, because I've been trying to learn it for a while. But anyone, I wrote a program to average any number of arguments given at the command line. I thought it might
14
1672
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
16566
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 I *want* at the end of this; I just have never taken on a programming task of this magnitude. I've seen that some are using python as a utility language for existing CAD environments, and I've also found some guy who's writing a 2d drafting...
4
2365
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 assembler was asm80 A Cross Assembler for the Intel 8080-8085 With CPM syntax
34
29891
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
11517
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 clearly be sufficient. This could lead to unnecessarily bad performance on very long strings. It is also written in a hard-to-read and clunky style. char *dot_to_underscore(const char *s) { char *t = malloc(strlen(s) + 1); if(t != NULL)
5
2952
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
1740
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 managers to get guidance in determining potential EH&S-related project costs. It is written using html, vbscript, css and very little javascript. I know html and vbscript fairly well but am relatively new to javascript and css. I cannot provide access...
0
8958
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8783
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9460
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9248
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8196
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6747
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4821
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.