From:	CSBVAX::MRGATE!info-gcc-request@prep.ai.mit.edu@SMTP 11-AUG-1988 19:40
To:	ARISIA::EVERHART
Subj:	gcc 1.25/80386 w/floating point?


Received: from TUT.CIS.OHIO-STATE.EDU by prep.ai.mit.edu; Thu, 11 Aug 88 06:57:40 EST
Received: by tut.cis.ohio-state.edu (5.54/2.880803)
	id AA20487; Thu, 11 Aug 88 08:07:47 EDT
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for info-gcc@prep.ai.mit.edu (info-gcc@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 11 Aug 88 10:39:46 GMT
From: cs.utexas.edu!natinst!bigtex!james@tut.cis.ohio-state.edu  (James Van Artsdalen)
Organization: F.B.N. Software, Austin TX
Subject: gcc 1.25/80386 w/floating point?
Message-Id: <5866@bigtex.uucp>
Sender: info-gcc-request@prep.ai.mit.edu
To: info-gcc@prep.ai.mit.edu

Has anyone had success getting floating point working with gcc 1.25 on
an 80386 of any variety?  I have found 1.25 to work very well with
programs not using any floating point, but gcc just loses it whenever
a float or double shows up.  Sometimes gcc generates syntax errors in
its assembly (these have been reported to the bug list).  I'm wondering
about the machine description file.

As delivered, gcc assumes software floating point on the 386.  Is this
necessary on any systems?  The 386 architecture is such that a system
would be rather looney not to emulate software floating point
transparently to the application.  My uPort 386 system does this.
Are there any systems that need software floating point as a default?

For the record, here is the config.h file I'm using.  It fixes a few
problems for me.
-----
#include "config-i386v.h"

/* These next two are needed to fix a bug wherein the assembler pseudo-op
   .file is not printed if -g is not selected.  The SysV assembler always
   wants to see .file */

#define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME)

#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
  fprintf(FILE, "\t.file\t\"%s\"\n", dump_base_name);

/* This is *necessary* for performance reasons.  Try parse.tab.c with
   alloca.c and you'll see */

#ifdef __GNUC__
#define alloca(n) __builtin_alloca(n)
#else
asm char *alloca(n)
{
%mem	n
	subl	n,  %esp
	andl	$-4, %esp
	mov	%esp,%eax
%reg	n
	subl	n,  %esp
	andl	$-4, %esp
	mov	%esp,%eax
%con	n
	subl	n,  %esp
	andl	$-4, %esp
	mov	%esp,%eax
}
#endif

/* These two allow shared libraries to be used */

#define STARTFILE_SPEC  \
  "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt1.o%s}}"

#define LIB_SPEC "%{!p:%{!pg:-lc crtn.o%s}}%{p:-lc_p}%{pg:-lc_p}"

/* This allows full 8 bit data to be placed in strings. */

#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(asm_out_file, p, size) \
{int i=0; \
  while (i < size) \
    { if (i%10 ==0) { if(i!=0)fprintf(asm_out_file,"\n"); \
		      fprintf(asm_out_file,ASM_BYTE); } \
        else fprintf(asm_out_file,","); \
	  fprintf (asm_out_file, "0x%x",p[i++]);} \
	fprintf(asm_out_file,"\n"); }

/* This says to use the 80387 by default.  It is not clear to me how
   it could ever be correct to do otherwise - all 386 systems trap
   387 op-codes and emulate when the 387 is not actually present, and
   this is entirely transparent to the program */

#undef TARGET_DEFAULT
#define TARGET_DEFAULT 1
-- 
James R. Van Artsdalen    ...!uunet!utastro!bigtex!james     "Live Free or Die"
Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746
