Article View: comp.arch
Article #11875Re: new instructions
From: Herman Rubin
Date: Thu, 30 May 1991 12:51
Date: Thu, 30 May 1991 12:51
37 lines
2217 bytes
2217 bytes
In article <4712.2843b438@iccgcc.decnet.ab.com>, herrickd@iccgcc.decnet.ab.com writes:
> Aren't you afraid you will spoil the argument by bringing some
> facts into it?
>
> In article <1991May21.191034.25980@murdoch.acc.Virginia.EDU>, clc5q@hemlock.cs.Virginia.EDU (Clark L. Coleman) writes:
> [most of his wonderful data omitted - see the original article]
>
> > Given the C source code statement:
> > z = x % y; /* z gets the remainder of x divided by y */
> > movl r6,r1 /* Transfer quotient to r1 */
> > clrl r0 /* Zero out upper word to form 64-bit r0/r1
> > register pair quotient */
> > ediv r7,r0,r2,r11 /* Divide r0-r1 pair by r7; throw away quotient
> > into r2 and keep remainder in r11 */
> This looks to me like it does only unsigned div/rem. Is that a feature
> of the ediv instruction or do we need a way to sign extend r1 into r0
> for the signed division case?
This points out another reason for cheap instructions at little cost.
There are a rather large number of cases in which unsigned arithmetic
is needed. In fact, the EMUL description in the VAX manual even
indicates that, for multiple precision arithmetic, this is quite
definitely the case.
Now how much additional silicon would it take to provide both signed
and unsigned? The VAX does have instructions to sign extend 8 and
16 bit units to 16 and 32; why not to extend 32 to 64? These are
cheap instructions. Of course, if it is fast enough, a shift of -32
would sign-extend a 32 to a 64.
--
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet) {purdue,pur-ee}!l.cc!hrubin(UUCP)
Technical Details
Message-ID:
<12947@mentor.cc.purdue.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubinReferences:
<9105200213.AA05095@ucbvax.Berkeley.EDU> <4712.2843b438@iccgcc.decnet.ab.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin From: hrubin@pop.stat.purdue.edu (Herman Rubin) Newsgroups: comp.arch Subject: Re: new instructions Message-ID: <12947@mentor.cc.purdue.edu> Date: 30 May 91 12:51:16 GMT References: <9105200213.AA05095@ucbvax.Berkeley.EDU> <4712.2843b438@iccgcc.decnet.ab.com> Sender: news@mentor.cc.purdue.edu Lines: 37