comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Q re floating point operations
Date: Wed, 30 Nov 2005 18:10:29 -0600
Date: 2005-11-30T18:10:29-06:00	[thread overview]
Message-ID: <rNOdnTIWW6_ioxPenZ2dnUVZ_tydnZ2d@megapath.net> (raw)
In-Reply-To: rcKdnaRpgeb3kO_enZ2dnUVZ_v-dnZ2d@comcast.com

"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.







      reply	other threads:[~2005-12-01  0:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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