[comp.unix.xenix] XENIX and math coprocessors

boesch@Shasta.STANFORD.EDU (Brian Boesch) (07/15/87)

----

We have SCO Xenix 286 and I would likt to know it the C compiler supports
the 287 coprocessor. I looked in the manuals and there is no mention of
the coprocessor in the CC sections of the manual.

Brian Boesch
boesch@shasta.stanford.edu
boesch@shasta.uucp

ericg@sco.UUCP (Eric Griswold) (07/15/87)

In article <1859@Shasta.STANFORD.EDU> boesch@Shasta.UUCP (Brian Boesch) writes:
>
>----
>
>We have SCO Xenix 286 and I would likt to know it the C compiler supports
>the 287 coprocessor. I looked in the manuals and there is no mention of
>the coprocessor in the CC sections of the manual.
>
>Brian Boesch

Absolutely.  The C compiler generates code, that is smart enough to
use a coprocessor if it present or use the software emulator if it 
is not.  In other words, one generally need not worry about the presence
of a coprocessor.  If it is present, your program will use it, ifj it
isn't the operating system will simulate it.


-- 
Eric Griswold   
Quote:  3 more of these will make a gallon
Path: {decvax!microsoft, ihnp4, ucbvax!ucscc}!sco!ericg
Disclaimer: It's all my fault, SCO had NOTHING to do with it.

davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) (07/15/87)

In article <1859@Shasta.STANFORD.EDU> boesch@Shasta.UUCP (Brian Boesch) writes:
|We have SCO Xenix 286 and I would likt to know it the C compiler supports
|the 287 coprocessor. I looked in the manuals and there is no mention of
|the coprocessor in the CC sections of the manual.

Yes. Do a compile of a short routine and look at the code.

Ex:
  $ cat > x.c
  main() { float a,b,c; c = a*b; }
  ^D
  $ cc -c -Fc x.c
  $ more x.L

-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {chinet | philabs | sesimo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

chkg@ptsfa.UUCP (Chuck Gentry) (07/15/87)

In article <1859@Shasta.STANFORD.EDU> boesch@Shasta.UUCP (Brian Boesch) writes:
>
>----
>
>We have SCO Xenix 286 and I would likt to know it the C compiler supports
>the 287 coprocessor. I looked in the manuals and there is no mention of
>the coprocessor in the CC sections of the manual.
>
The 8087, 80287, and 80387 are all supported by the related version of XENIX.
I believe that it is the kernel that provides the floating point support.  The
compiler "assumes" that the coprocessor exists in the system when generating
code.  If no coprocessor is present, the kernel will emulate the routine.  If
a coprocessor is present, the floating point instruction is executed. 
(Makes your code portable between machines.)

The coprocessor is mentioned in the manual: "Run Time Environment", Operating
System Release Notes.  Depending on your version, you'll find the info on:
V2.1.0 Page 8, V2.2.1 Page 43.  During boot time, Xenix will tell you if
a math coprocessor is present.  (There are also references in the
Hardware Dependent Misc. section, and the MASM section in Programmer's Guide,
system development tools, User's section 2-5.  It seems my copy does not 
have these pages. They are mentioned in various places in the manual.)

Chuck Gentry
{lll-lcc,quantel,ihnp4}!ptsfa!pbcesar!chkg