[comp.unix.microport] more gcc diffs

james@bigtex.uucp (James Van Artsdalen) (08/14/88)

First: if anyone has a *small* program that compiles with floating
point but does not work, I'd like to see it.  I've got perl, but it's
not real small :-( If anyone has any floating point programs running,
I'd like to know too.

Here are more changes to the i386.md file.  Remember to re-link i386.md
to md!  If you missed my first patch, let me know and I'll mail it to
you.

*** /tmp/,RCSt1a27406	Sat Aug 13 19:33:27 1988
--- i386.md	Sat Aug 13 17:08:23 1988
***************
*** 98,104
    "*
  {
    rtx xops[1];
!   fp_push_sf (operands[0]);
  /*  fp_pop_level--; */
    xops[0] = FP_TOP;
    output_asm_insn (\"ftst\;fstp %0(0)\;fstsw %Rax\;sahf\", xops);

--- 98,105 -----
    "*
  {
    rtx xops[1];
!   if (!FP_REG_P (operands[0]))
!     fp_push_sf (operands[0]);
  /*  fp_pop_level--; */
    xops[0] = FP_TOP;
    output_asm_insn (\"ftst\;fstp %0(0)\;fstsw %Rax\;sahf\", xops);
***************
*** 114,120
    "*
  {
    rtx xops[1];
!   fp_push_df (operands[0]);
  /*  fp_pop_level--; */
    xops[0] = FP_TOP;
    output_asm_insn (\"ftst\;fstp %0(0)\;fstsw %Rax\;sahf\", xops);

--- 115,122 -----
    "*
  {
    rtx xops[1];
!   if (!FP_REG_P (operands[0]))
!     fp_push_df (operands[0]);
  /*  fp_pop_level--; */
    xops[0] = FP_TOP;
    output_asm_insn (\"ftst\;fstp %0(0)\;fstsw %Rax\;sahf\", xops);
***************
*** 303,309
        && GET_MODE (REG_NOTES (insn)) == (enum machine_mode) REG_WAS_0
        /* Make sure the insn that stored the 0 is still present.  */
        && ! XEXP (REG_NOTES (insn), 0)->volatil
!       && GET_CODE (XEXP (REG_NOTES (insn), 0)) != NOTE)
      /* Fastest way to change a 0 to a 1.  */
      return \"inc%W %0\";
    return \"mov%W %1,%0\";

--- 305,313 -----
        && GET_MODE (REG_NOTES (insn)) == (enum machine_mode) REG_WAS_0
        /* Make sure the insn that stored the 0 is still present.  */
        && ! XEXP (REG_NOTES (insn), 0)->volatil
!       && GET_CODE (XEXP (REG_NOTES (insn), 0)) != NOTE
!       /* Make sure cross jumping didn't happen here.  */
!       && no_labels_between_p (XEXP (REG_NOTES (insn), 0), insn))
      /* Fastest way to change a 0 to a 1.  */
      return \"inc%W %0\";
    return \"mov%W %1,%0\";
***************
*** 322,328
        && GET_MODE (REG_NOTES (insn)) == (enum machine_mode) REG_WAS_0
        /* Make sure the insn that stored the 0 is still present.  */
        && ! XEXP (REG_NOTES (insn), 0)->volatil
!       && GET_CODE (XEXP (REG_NOTES (insn), 0)) != NOTE)
      /* Fastest way to change a 0 to a 1.  */
      return \"inc%B %0\";
    /* If mov%B isn't allowed for one of these regs, use mov%W.  */

--- 326,334 -----
        && GET_MODE (REG_NOTES (insn)) == (enum machine_mode) REG_WAS_0
        /* Make sure the insn that stored the 0 is still present.  */
        && ! XEXP (REG_NOTES (insn), 0)->volatil
!       && GET_CODE (XEXP (REG_NOTES (insn), 0)) != NOTE
!       /* Make sure cross jumping didn't happen here.  */
!       && no_labels_between_p (XEXP (REG_NOTES (insn), 0), insn))
      /* Fastest way to change a 0 to a 1.  */
      return \"inc%B %0\";
    /* If mov%B isn't allowed for one of these regs, use mov%W.  */

Here is a change to flow.c that RMS suggested:

*** /tmp/,RCSt1a27435	Sat Aug 13 19:36:13 1988
--- flow.c	Thu Aug 11 04:27:27 1988
***************
*** 1613,1619
  
  	if (GET_CODE (testreg) == REG
  	    && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM)
! 	    && regno != ARG_POINTER_REGNUM
  	    && (regno >= FIRST_PSEUDO_REGISTER
  		|| INSN_VOLATILE (insn)))
  	  {

--- 1613,1621 -----
  
  	if (GET_CODE (testreg) == REG
  	    && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM)
! 	    && regno != ARG_POINTER_REGNUM)
! #if 0 /* This was added in 1.25, but screws up death notes for hard regs.
! 	 It probably isn't really needed anyway.  */
  	    && (regno >= FIRST_PSEUDO_REGISTER
  		|| INSN_VOLATILE (insn)))
  #endif
***************
*** 1616,1621
  	    && regno != ARG_POINTER_REGNUM
  	    && (regno >= FIRST_PSEUDO_REGISTER
  		|| INSN_VOLATILE (insn)))
  	  {
  	    register int offset = regno / REGSET_ELT_BITS;
  	    register int bit = 1 << (regno % REGSET_ELT_BITS);

--- 1618,1624 -----
  	 It probably isn't really needed anyway.  */
  	    && (regno >= FIRST_PSEUDO_REGISTER
  		|| INSN_VOLATILE (insn)))
+ #endif
  	  {
  	    register int offset = regno / REGSET_ELT_BITS;
  	    register int bit = 1 << (regno % REGSET_ELT_BITS);

Here is my current config.h:
---
#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.  This should always be true -
   no worthwhile 386 system is going to fail to emulate a missing 387! */

/* RMS says maybe this doesn't work yet...

#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