Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2340

Re: 64 bit code

From BGB <cr88192@hotmail.com>
Newsgroups comp.programming
Subject Re: 64 bit code
Date 2012-10-13 09:50 -0500
Organization albasani.net
Message-ID <k5bv9u$soq$1@news.albasani.net> (permalink)
References (5 earlier) <k59snb$oqm$1@speranza.aioe.org> <k59un2$qem$1@dont-email.me> <k5beod$t0h$1@speranza.aioe.org> <k5blp3$3fj$1@dont-email.me> <slrnk7invh.3eh.willem@turtle.stack.nl>

Show all headers | View raw


On 10/13/2012 7:34 AM, Willem wrote:
> BartC wrote:
> ) If the hardware can directly deal with 64-bit floats, then there is little
> ) performance loss (compared with attempting 64-bit arithmetic on 32-bit
> ) hardware, or in software).
> )
> ) The only issue might be memory bandwidth when dealing with large numbers of
> ) floating point values, although if they are accessed mainly for calculation,
> ) then it's possible the calculation will dominate the timings.
>
> Most CPU's nowadays can do parallel computations on 4 32-bit floats at the
> same time, thus effectively quadrupling the speed.
>

yep.

though in some cases there ends up being the funkiness of multiple types 
of FPUs:
the x87 style FPU;
the SSE SIMD FPU.

though in other cases, there just ends up being a lot more FPUs 
in-general, with lots of pipelining for x87 code.


> ) Anyway, I remember using 32-bit floats in an application (originally using
> ) software emulation), and they weren't of sufficient accuracy for some types
> ) of problems (mapping for example). They only have 1 in 8 million precision
> ) after all. Switching to 64-bits solved that problem.
> )
> ) Sometimes there are ways to get around such problems, and continue using
> ) 32-bits, but sometimes also it's simpler to just use 64!
>
> The point is that sometimes, using 32-bit floats is the best option.
> Showing cases where 64-bit is the best option is irrelevant to that
> position.
>

yep.

in some cases, double is needed.

in many cases, float is plenty sufficient, and a person is hard-pressed 
the huge memory waste that using doubles would bring.

sometimes, we can't even really afford the memory used by floats, and 
have to resort to more compact representations (storing values in 8 or 
16-bit representations).


for example, my recent foray into colored-lighting for voxels, left me 
with this particular scheme:
4 bits, light intensity, following a power curve;
4 bits, light color, based on a modified 16-color palette (6 pure 
colors, 6 half-saturation colors, white, orange/'greenish'/'sky').

and to speed up calculations ended up resorting to (*cough*) 
color-blending tables.

why all this? because these voxels eat up a fair chunk of RAM.
presently, each voxel is only about 8 bytes, but uses up a good chunk of 
a 4GB address space doing so (hence, why the previous RLE hack). such is 
the cost of x^3.

now, what about all the vertex-arrays?...
well, these are big as well, can't really afford doubles there either 
(nor does the graphics hardware really support them).

the vertex arrays eat lots of RAM, but have a more limited view-distance.


like, having lots more RAM doesn't help much when one puts lots more 
into it. a lot of this stuff couldn't really be done on older hardware.


or such...

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

64 bit code bob <bob@coolfone.comze.com> - 2012-10-10 08:22 -0700
  Re: 64 bit code Jongware <jongware@no-spam.plz> - 2012-10-10 17:35 +0200
    Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-10 17:37 +0100
      Re: 64 bit code Robert Wessel <robertwessel2@yahoo.com> - 2012-10-10 12:54 -0500
      Re: 64 bit code Fritz Wuehler <fritz@spamexpire-201210.rodent.frell.theremailer.net> - 2012-10-10 21:37 +0200
        Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-10 21:46 -0500
      Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-10 20:43 +0100
        Re: 64 bit code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-10-12 08:40 +0100
          Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-12 12:36 -0500
          Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-12 20:57 +0100
            Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-12 21:30 +0100
              Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-12 16:33 -0500
                Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-13 00:44 +0100
                Re: 64 bit code Ben Pfaff <blp@cs.stanford.edu> - 2012-10-12 20:07 -0700
              Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-13 11:11 +0100
                Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-13 13:11 +0100
                Re: 64 bit code Willem <willem@turtle.stack.nl> - 2012-10-13 12:34 +0000
                Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-13 09:50 -0500
                Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-13 17:25 +0100
                Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-13 17:53 +0100
                Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-13 17:05 +0100
          Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-13 10:37 +0200
            Re: 64 bit code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-10-27 12:18 +0100
              Re: 64 bit code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-10-27 12:54 +0100
              Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-27 15:13 +0200
                Re: 64 bit code Robert Miles <milesrf@Usenet-News.net> - 2012-10-28 04:12 -0500
                Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-28 13:10 +0100
                Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-29 04:38 +0000
                Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-29 09:30 +0100
                Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-30 22:09 +0000
                Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-31 09:47 +0100
                Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-31 09:55 +0100
                Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-31 14:32 +0000
            Re: 64 bit code Patricia Shanahan <pats@acm.org> - 2012-10-27 08:51 -0700
              Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-27 17:23 +0100
              Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-27 20:43 +0200
                Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-30 22:16 +0000
                Re: 64 bit code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-10-31 09:53 +0100
                Re: 64 bit code "LudovicoVan" <julio@diegidio.name> - 2012-10-31 14:33 +0000
                Re: 64 bit code Fritz Wuehler <fritz@spamexpire-201211.rodent.frell.theremailer.net> - 2012-11-01 00:25 +0100
      Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-10 21:04 +0100
        Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-10 21:52 +0100
          Re: 64 bit code Ian Collins <ian-news@hotmail.com> - 2012-10-11 10:50 +1300
            Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-10 21:54 -0500
              Re: 64 bit code "BartC" <bc@freeuk.com> - 2012-10-11 13:11 +0100
                Re: 64 bit code BGB <cr88192@hotmail.com> - 2012-10-11 11:17 -0500
      Re: 64 bit code Ben Pfaff <blp@cs.stanford.edu> - 2012-10-10 13:17 -0700
        Re: 64 bit code Fritz Wuehler <fritz@spamexpire-201210.rodent.frell.theremailer.net> - 2012-10-11 19:36 +0200
          Re: 64 bit code Ben Pfaff <blp@cs.stanford.edu> - 2012-10-12 08:13 -0700
    Re: 64 bit code Rui Maciel <rui.maciel@gmail.com> - 2012-10-10 20:38 +0100
    Re: 64 bit code Robin Vowels <robin.vowels@gmail.com> - 2012-10-10 15:22 -0700
  Re: 64 bit code Robert Miles <milesrf@Usenet-News.net> - 2012-10-12 02:13 -0500

csiph-web