Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!purdue!i.cc.purdue.edu!k.cc.purdue.edu!l.cc.purdue.edu!cik
From: cik@l.cc.purdue.edu (Herman Rubin)
Newsgroups: comp.arch
Subject: Re: Assembly or .... (two-result functions)
Summary: Machines have had two-result functions since antiquity; the languages
	 have not.
Keywords: remainder 80x87
Message-ID: <1047@l.cc.purdue.edu>
Date: 4 Dec 88 11:07:15 GMT
References: <1388@aucs.UUCP| <729@convex.UUCP> <1961@crete.cs.glasgow.ac.uk> <6089@eagle.ukc.ac.uk>
Organization: Purdue University Statistics Department
Lines: 30

In article <6089@eagle.ukc.ac.uk>, mch@ukc.ac.uk (Martin Howe) writes:
> In article <1039@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes:
> >In article <7740@boring.cwi.nl>, dik@cwi.nl (Dik T. Winter) writes:
> >> In article <21390@apple.Apple.COM> desnoyer@Apple.COM (Peter Desnoyers) writes:
> >< < In article <1032@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes:
> >> mandate operations that return two results.  So no machine I know does
> >> return two results; even with sine and cosine, which is implemented on
> >> many (as an extension to IEEE?).
> 
> What exactly, then is the 80387 FSINCOS instruction, which takes ST(0) and
> returns it's sine and cosine in ST(0) and ST(1), ready for division (tangent) or
> whatever else. In what way does it not return two results ? For that matter
> how are the flags set if both results return the same exception ?

I did not know of the 80387 instruction.  But how will programmers use it?
The languages still do not allow

	x, y = fsincos(z);

This being comp.arch, I must also state that I consider it unfortunate that
this type of operation requires that specific registers must be used; in other
situations, this is certainly considered a bad thing.  Now I do not always
agree with the gurus, but this is one case where I do.  Unless the hardware
actually uses the registers for the computation, such as the accumulator and
mq registers in the early von Neumann machines, the registers for a hardware
operation should be flexible.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)