[net.micro.68k] Sun-3 floating point

joel@gould9.UUCP (Joel West) (12/03/85)

This is probably a trivial question -- I don't currently have a 
Sun-3, but may evenutally port software to one.

I understand two Sun-3 configurations are distinct in their 
approach to floating point arithmetic:
	* 68020 + 68881
	* 68020 + Weitek (?) FP board
The second is somewhat faster and is expected to be more popular, I'm told.

Are executables for these two variants binary compatible, i.e., does 
the compiler have to know what machine it is targetting?  If so, I 
assume this means the FP board is emulating the 68881 instruction set, 
or some such.

The machine-language equivalent of the following VAX sequence for one
or both configurations would be appreciated.

	/*	A = B * C + D  */
		movd	B,r0
		muld2	C,r0
		addd2	D,r0
		movd	r0,A
-- 
	Joel West	 	(619) 457-9681
	CACI, Inc. Federal, 3344 N. Torrey Pines Ct., La Jolla, CA  92037
	{cbosgd,ihnp4,pyramid,sdcsvax,ucla-cs}!gould9!joel
	gould9!joel@nosc.ARPA

henry@utzoo.UUCP (Henry Spencer) (12/04/85)

> I understand two Sun-3 configurations are distinct in their 
> approach to floating point arithmetic:
> 	* 68020 + 68881
> 	* 68020 + Weitek (?) FP board
> ...
> Are executables for these two variants binary compatible...?

Almost certainly not, since the Weitek boards I know about pre-date the
introduction, and probably the design, of the 68881.  There has also been
some recent commentary about what the Weitek designers should learn from
the 68881, which again strongly suggests the two are not compatible.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

henry@utzoo.UUCP (Henry Spencer) (12/08/85)

> > Are executables for these two [Sun 3] variants binary compatible...?
> 
> Almost certainly not, since the Weitek boards I know about pre-date the
> introduction, and probably the design, of the 68881...

Turns out I was right, but for the wrong reasons.  The 68881 interface has
been frozen for much longer than I thought, and the Sun people who designed
the fast-floating-point board using the Weitek chips knew about it.  But
they opted for a more specialized interface for higher speed, so the Sun-3
Weitek floating-point option is *not* binary compatible with the 68881
floating point.  That word comes from multiple sources within Sun, so I think
it's definitive.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

andrew@aimmi.UUCP (Andrew Stewart) (12/10/85)

In article <196@gould9.UUCP> joel@gould9.UUCP (Joel West) writes:
>I understand two Sun-3 configurations are distinct in their 
>approach to floating point arithmetic:
>	* 68020 + 68881
>	* 68020 + Weitek (?) FP board
>The second is somewhat faster and is expected to be more popular, I'm told.
>
>Are executables for these two variants binary compatible, .....

Yes - as I understand it, the SUN software checks for the FPA board at
boot time. If it's there, it ships stuff over the fast local bus to the
FPA instead of the 68881 chip.
The clever bit is that the FPA doesn't need to emulate the 68881 - in certain
out-of-range cases, the FPA board gives up in disgust, so the CPU passes the
sum to the 68881 which gives the correct-according-to-IEEE answer.
Since this happens in a very small % of cases, the speed loss is trivial.
And the binaries are compatible. Neat.

-- 
-------------------------------------------
Andrew Stewart		 UUCP:	andrew@aimmi.UUCP
			 ARPA:	andrew@aimmi.ac.uk

"Once the subject is clearly understood,
	the explanation will seem sensible."

kds@intelca.UUCP (Ken Shoemaker) (12/13/85)

> Yes - as I understand it, the SUN software checks for the FPA board at
> boot time. If it's there, it ships stuff over the fast local bus to the
> FPA instead of the 68881 chip.
> The clever bit is that the FPA doesn't need to emulate the 68881 - in certain
> out-of-range cases, the FPA board gives up in disgust, so the CPU passes the

I would think that there are still some problems with this, with respect to
round-off models, but oh well...Can anyone explain to me how this works?
If the FPA board is there, does the 68020 trap on every floating point
op and ship the stuff over by hand, or is there something in the coprocessor
interface that the startup code sets to make the 020 use the FPA rather than
the 881?  As they say, pardon my ignorance...
--
yes, some uncomplicated peoples still believe this myth...

Ken Shoemaker, Santa Clara, Ca.
{pur-ee,hplabs,amd,scgvaxd,dual,qantel}!intelca!kds
     
---the above views are personal.