comp.lang.ada
 help / color / mirror / Atom feed
* Q re floating point operations
@ 2005-11-09  1:34 Bobby D. Bryant
  2005-11-09  3:23 ` Jeffrey R. Carter
  2005-11-09 14:54 ` Steve
  0 siblings, 2 replies; 4+ messages in thread
From: Bobby D. Bryant @ 2005-11-09  1:34 UTC (permalink / raw)


How come on an x86 architecture 64-bit multiplications (GNAT
Long_Float) are just as fast as 32-bit multiplications (GNAT Float)?

Thanks,
-- 
Bobby Bryant
Austin, Texas



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q re floating point operations
  2005-11-09  1:34 Q re floating point operations Bobby D. Bryant
@ 2005-11-09  3:23 ` Jeffrey R. Carter
  2005-11-09 14:54 ` Steve
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey R. Carter @ 2005-11-09  3:23 UTC (permalink / raw)


Bobby D. Bryant wrote:

> How come on an x86 architecture 64-bit multiplications (GNAT
> Long_Float) are just as fast as 32-bit multiplications (GNAT Float)?

Probably because they're both done using 80-bit registers.

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus
21



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q re floating point operations
  2005-11-09  1:34 Q re floating point operations Bobby D. Bryant
  2005-11-09  3:23 ` Jeffrey R. Carter
@ 2005-11-09 14:54 ` Steve
  2005-12-01  0:10   ` Randy Brukardt
  1 sibling, 1 reply; 4+ messages in thread
From: Steve @ 2005-11-09 14:54 UTC (permalink / raw)


"Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message 
news:dkrjmn$peg$1@geraldo.cc.utexas.edu...
> How come on an x86 architecture 64-bit multiplications (GNAT
> Long_Float) are just as fast as 32-bit multiplications (GNAT Float)?
>
> Thanks,
> -- 
> Bobby Bryant
> Austin, Texas

This is an x86 architecture question, not an Ada question.

The speed difference on these multiplications went away several years ago.

Steve
(The Duck) 





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q re floating point operations
  2005-11-09 14:54 ` Steve
@ 2005-12-01  0:10   ` Randy Brukardt
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2005-12-01  0:10 UTC (permalink / raw)


"Steve" <nospam_steved94@comcast.net> wrote in message
news:rcKdnaRpgeb3kO_enZ2dnUVZ_v-dnZ2d@comcast.com...
> "Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message
> news:dkrjmn$peg$1@geraldo.cc.utexas.edu...
> > How come on an x86 architecture 64-bit multiplications (GNAT
> > Long_Float) are just as fast as 32-bit multiplications (GNAT Float)?
>
> This is an x86 architecture question, not an Ada question.
>
> The speed difference on these multiplications went away several years ago.

Yeah, in about 1981. :-)

That is to say, there *never* has been a difference in multiply times on the
8087 architecture (now folded into the Pentium and later processors). I
dragged out my July 1981 8086/8087 processor manual. (Very well used; much
of the output of Janus/Ada was designed based on this book.) There is only
one multiply instruction; it works on 80-bit registers, and the clock times
depend only on the values being multiplied. It takes longer if the values
have a lot of one bits, so I suppose values from 32-bit float might multiply
faster than those from 64-bit long_float IFF the values are different -- but
if the values are the same, the multiply time has always been the same.

More modern versions multiply in constant time (not depending on the
values); that goes back at least to the original Pentium (my book is dated
1993). The only possible difference is the memory access times for the
operands (not strictly part of the multiply, but it might appear so). But
those should be quite small on modern machines.

                           Randy.







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-01  0:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-09  1:34 Q re floating point operations Bobby D. Bryant
2005-11-09  3:23 ` Jeffrey R. Carter
2005-11-09 14:54 ` Steve
2005-12-01  0:10   ` Randy Brukardt

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