Article View: gnu.misc.discuss
Article #63227Re: GMP without assembly?
From: Wilhelm B. Kloke
Date: Mon, 20 Feb 1995 09:46
Date: Mon, 20 Feb 1995 09:46
28 lines
2460 bytes
2460 bytes
In article <3ho7a6$lhv@hermes.synopsys.com>,
Joe Buck <jbuck@synopsys.com> wrote:
>cbloom@mail.utexas.edu (Charles Bloom) writes:
>multiprecision integer arithmetic ("bignums", to use the Lisp term)
>inherently inefficient. Among these features is the notion that when you
>multiply two 32-bit integers together you get a 32-bit result (long*long
>is long). In reality, multiplying two N-bit integers together gives a
>2N-bit result, and this fact is often reflected at the assembly language
>level. Furthermore, in assembly language you have carry bits and
>add-with-carry instructions, which you can't get to from higher level
>languages.
Though I don't disagree with most of this, it has to be added, that
the penalty for using carry bits must be paid in the processor design.
The veteran of RISC processors, MIPS R2/3000, doesn't have these bits
at all, because they interfere with a pipelined processor design. Other
processors are heavily complicated by implementing a carry bit.
And, I doubt that accessing the carry bit makes the computation faster
in modern processors. Though the instructions to do the carry computations
seem to be more complicated, they are probably more efficient than
branching on carry.
Of course, if there are carry bits, which can be used to make processing
more efficient, it is perfectly legitimate to use them.
--
Dipl.-Math. Wilhelm Bernhard Kloke
Institut fuer Arbeitsphysiologie an der Universitaet Dortmund
Ardeystrasse 67, D-44139 Dortmund, Tel. 0231-1084-257
Technical Details
Message-ID:
<3i9ods$3is@gisli.arb-phys.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!ra.nrl.navy.mil!news.pop.psu.edu!psuvax1!uwm.edu!news.alpha.net!news.mathworks.com!usenet.eel.ufl.edu!news-feed-1.peachnet.edu!gatech!swrinde!cs.utexas.edu!news.sprintlink.net!EU.net!Germany.EU.net!mips.arb-phys.uni-dortmund.de!arb-phys.uni-dortmund.de!not-for-mailReferences:
<3hjepi$2p4@geraldo.cc.utexas.edu> <3ho7a6$lhv@hermes.synopsys.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,8b89763aa244595a X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1995-02-20 01:46:36 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!ra.nrl.navy.mil!news.pop.psu.edu!psuvax1!uwm.edu!news.alpha.net!news.mathworks.com!usenet.eel.ufl.edu!news-feed-1.peachnet.edu!gatech!swrinde!cs.utexas.edu!news.sprintlink.net!EU.net!Germany.EU.net!mips.arb-phys.uni-dortmund.de!arb-phys.uni-dortmund.de!not-for-mail From: wb@arb-phys.uni-dortmund.de (Wilhelm B. Kloke) Newsgroups: gnu.misc.discuss Subject: Re: GMP without assembly? Date: 20 Feb 1995 10:46:36 +0100 Organization: Inst f Arbeitsphysiologie Dortmund Lines: 28 Message-ID: <3i9ods$3is@gisli.arb-phys.uni-dortmund.de> References: <3hjepi$2p4@geraldo.cc.utexas.edu> <3ho7a6$lhv@hermes.synopsys.com> NNTP-Posting-Host: gisli.arb-phys.uni-dortmund.de