comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier Write-only <gautier@fakeaddress.nil>
Subject: Re: Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH
Date: Wed, 02 Nov 2005 21:40:31 +0100
Date: 2005-11-02T21:40:31+01:00	[thread overview]
Message-ID: <4369243F.319524C9@fakeaddress.nil> (raw)
In-Reply-To: dka62u$8pl$1@hudsucker.umdac.umu.se

Colin Paul Gloster:

> Mnamky posted to news:comp.lang.ada :
> 
> "Hi all;
> 
> Consider the following exaple
> y = x * b'
> 
> where x is 12-bit wordlength and 11-bit fraction
> and b is 16-bit wordlength and 14-bit fraction
> 
> simulation of this code is rather easy im Matlab but how could we do a
> full analysis of this code in C with a good precision?"
> 
> I fail to see the relevance of this to Ada. In C, you could use ints and
> interpret some bits as an integer and some bits as a vulgar fraction, as
> in computer games books for 386s and 486s (before Pentiums which had
> faster floating point support than integer support) in the 1990s, such
> as "Building a 3D Engine in C++" and La Mothe; Ratcliff; et al.,
> "Tricks of the Game Programming Gurus", SAMS Publishing.

Some people were perverse enough to do it even in Ada, e.g.:

  http://homepage.sunrise.ch/mysunrise/gdm/e3d_html/svgaeffe__adb.htm#258_13

Shocking, isn't it ?

The method was also useful for a short time with Pentiums, but before the 3D graphics cards, since you can make the FPU and the CPU work simultaneously. For grabbing "manually" (i.e. withouth 3D hardware) single pixels on a texture map, you also gain time by not using the FPU for each pixel: otherwise, you would have each time one FPU division, plus a conversion to an array index, which must be slower than a single integer addition for the same index.

G.



      parent reply	other threads:[~2005-11-02 20:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-30 16:41 Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH mnamky
2005-10-30 17:00 ` Dmitry A. Kazakov
2005-10-30 21:46 ` Gautier Write-only
2005-11-01  2:50 ` Steve
2005-11-02 10:42 ` Colin Paul Gloster
2005-11-02 20:43   ` Gautier Write-only
2005-11-03  6:13   ` Simon Wright
2005-11-03 10:46     ` Colin Paul Gloster
2005-11-03 13:47     ` Robert A Duff
2005-11-03 14:33       ` Dmitry A. Kazakov
2005-11-03 18:19         ` Jeffrey R. Carter
2005-11-03 20:55         ` Simon Wright
2005-11-02 10:57 ` Colin Paul Gloster
2005-11-02 14:49   ` Martin Krischik
2005-11-02 20:40   ` Gautier Write-only [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox