gcc-1.18 for 3b1
Alex S. Crain
alex at umbc3.UMD.EDU
Thu Mar 24 05:03:11 AEST 1988
In light of the recent discussions, and since they were small, I
decided to post these. (small = ~800 lines)
These are the diffs to make gcc-1.18 work on a unixpc. Obtaining
the sources for gcc-1.18 is left as project for the energetic student,
the sources are available from uunet, prep.ai.mit.edu, etc. uunet provides
some kind of uucp or mail service for those without ftp access, But I don't
know the details. If you are really in a bind, write me and we'll work it
out.
:alex
nerwin!alex at umbc3.umd.edu
alex at umbc3.umd.edu
-----------------------diff files, cut here------------------------------------
*** cccp.c.orig Mon Mar 14 18:17:01 1988
--- cccp.c Mon Mar 14 22:51:33 1988
***************
*** 142,148
int do_define (), do_line (), do_include (), do_undef (), do_error (),
do_pragma (), do_if (), do_xifdef (), do_else (),
! do_elif (), do_endif ();
struct hashnode *install ();
struct hashnode *lookup ();
--- 142,148 -----
int do_define (), do_line (), do_include (), do_undef (), do_error (),
do_pragma (), do_if (), do_xifdef (), do_else (),
! do_elif (), do_endif (), do_sccs ();
struct hashnode *install ();
struct hashnode *lookup ();
***************
*** 342,347
T_LINE, /* `#line' */
T_ERROR, /* `#error' */
T_ENDIF, /* `#endif' */
T_SPECLINE, /* special symbol `__LINE__' */
T_DATE, /* `__DATE__' */
T_FILE, /* `__FILE__' */
--- 342,350 -----
T_LINE, /* `#line' */
T_ERROR, /* `#error' */
T_ENDIF, /* `#endif' */
+ #ifdef SCCS_DIRECTIVE
+ T_SCCS, /* `#sccs' for SGS Include files */
+ #endif
T_SPECLINE, /* special symbol `__LINE__' */
T_DATE, /* `__DATE__' */
T_FILE, /* `__FILE__' */
***************
*** 415,420
#if 0
{ 6, do_pragma, "pragma", T_PRAGMA},
#endif
{ -1, 0, "", T_UNUSED},
};
--- 418,426 -----
#if 0
{ 6, do_pragma, "pragma", T_PRAGMA},
#endif
+ #ifdef SCCS_DIRECTIVE
+ { 4, do_sccs, "sccs", T_SCCS},
+ #endif
{ -1, 0, "", T_UNUSED},
};
***************
*** 2839,2844
nope:
fatal ("You are in a maze of twisty compiler features, all different");
}
#endif
/*
--- 2845,2857 -----
nope:
fatal ("You are in a maze of twisty compiler features, all different");
}
+ #endif
+ #ifdef SCCS_DIRECTIVE
+ /*
+ #sccs -- do not very much.
+ */
+ do_sccs()
+ { ; }
#endif
/*
*** final.c.orig Mon Mar 7 20:02:49 1988
--- final.c Mon Mar 21 21:36:08 1988
***************
*** 367,372
fprintf (file, ASM_APP_OFF);
app_on = 0;
}
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
CC_STATUS_INIT;
break;
--- 367,397 -----
fprintf (file, ASM_APP_OFF);
app_on = 0;
}
+ #ifdef unixpc
+ /*
+ the unixpc gets confused by jump tables, so we have to declare
+ them special. if the label refers to a jump table (next_body),
+ then we print a prefix wiht the size (in words) of the table.
+ This is untested for absolute address tables.
+ */
+ {
+ register rtx next_insn = NEXT_INSN (insn);
+ if (next_insn)
+ switch (GET_CODE (next_insn))
+ {
+ case NOTE:
+ case BARRIER:
+ case CODE_LABEL:
+ break;
+ default:
+ next_insn = PATTERN (next_insn);
+ if (GET_CODE (next_insn) == ADDR_VEC)
+ fprintf (file, "\tswbeg &%d\n", 2*XVECLEN (next_insn, 1));
+ if (GET_CODE (next_insn) == ADDR_DIFF_VEC)
+ fprintf (file, "\tswbeg &%d\n", XVECLEN (next_insn, 1));
+ }
+ }
+ #endif
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
CC_STATUS_INIT;
break;
***************
*** 638,644
if (filename && (lastfile == 0 || strcmp (filename, lastfile)))
#ifdef ASM_OUTPUT_SOURCE_FILENAME
! ASM_OUTPUT_SOURCE_FILENAME (file, FILENAME);
#else
fprintf (file, "\t.stabs \"%s\",%d,0,0,Ltext\n",
filename, N_SOL);
--- 663,669 -----
if (filename && (lastfile == 0 || strcmp (filename, lastfile)))
#ifdef ASM_OUTPUT_SOURCE_FILENAME
! ASM_OUTPUT_SOURCE_FILENAME (file, filename);
#else
fprintf (file, "\t.stabs \"%s\",%d,0,0,Ltext\n",
filename, N_SOL);
*** varasm.c.orig Sun Mar 20 18:09:55 1988
--- varasm.c Wed Mar 23 00:32:00 1988
***************
*** 194,199
char *label;
label = (char *) alloca (strlen (name) + 10);
sprintf (label, "%s$%d", name, labelno);
name = obstack_copy0 (current_obstack, label, strlen (label));
}
--- 194,203 -----
char *label;
label = (char *) alloca (strlen (name) + 10);
+
+ #ifdef GENERATE_SPECIAL_LABEL
+ GENERATE_SPECIAL_LABEL (label, name, labelno);
+ #else
sprintf (label, "%s$%d", name, labelno);
#endif
***************
*** 195,200
label = (char *) alloca (strlen (name) + 10);
sprintf (label, "%s$%d", name, labelno);
name = obstack_copy0 (current_obstack, label, strlen (label));
}
--- 199,206 -----
GENERATE_SPECIAL_LABEL (label, name, labelno);
#else
sprintf (label, "%s$%d", name, labelno);
+ #endif
+
name = obstack_copy0 (current_obstack, label, strlen (label));
}
*** m68k.md.orig Wed Mar 23 01:13:05 1988
--- m68k.md Mon Mar 21 23:56:58 1988
***************
*** 509,515
labelref = XEXP (XEXP (operands[1], 0), 0);
else
labelref = XEXP (XEXP (operands[1], 0), 1);
! #ifdef MOTOROLA
#ifdef SGS
fprintf (asm_out_file, \"\\tset %s%d,.+2\\n\", \"LI\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
--- 509,515 -----
labelref = XEXP (XEXP (operands[1], 0), 0);
else
labelref = XEXP (XEXP (operands[1], 0), 1);
! #if defined( MOTOROLA ) && ! defined( unixpc )
#ifdef SGS
fprintf (asm_out_file, \"\\tset %s%d,.+2\\n\", \"LI\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
***************
*** 826,831
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return \"clr.l -(%0)\;move%.b %1,(3,%0)\";
#else
return \"clrl %0 at -\;moveb %1,%0@(3)\";
--- 826,834 -----
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
+ #ifdef unixpc
+ return \"clr.l -(%0)\;move%.b %1,3(%0)\";
+ #else
return \"clr.l -(%0)\;move%.b %1,(3,%0)\";
#endif
#else
***************
*** 827,832
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return \"clr.l -(%0)\;move%.b %1,(3,%0)\";
#else
return \"clrl %0 at -\;moveb %1,%0@(3)\";
#endif
--- 830,836 -----
return \"clr.l -(%0)\;move%.b %1,3(%0)\";
#else
return \"clr.l -(%0)\;move%.b %1,(3,%0)\";
+ #endif
#else
return \"clrl %0 at -\;moveb %1,%0@(3)\";
#endif
***************
*** 836,841
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return \"clr.l (%0)+\;move%.b %1,(-1,%0)\";
#else
return \"clrl %0 at +\;moveb %1,%0@(-1)\";
--- 840,848 -----
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
+ #ifdef unixpc
+ return \"clr.l (%0)+\;move%.b %1,-1(%0)\";
+ #else
return \"clr.l (%0)+\;move%.b %1,(-1,%0)\";
#endif
#else
***************
*** 837,842
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return \"clr.l (%0)+\;move%.b %1,(-1,%0)\";
#else
return \"clrl %0 at +\;moveb %1,%0@(-1)\";
#endif
--- 844,850 -----
return \"clr.l (%0)+\;move%.b %1,-1(%0)\";
#else
return \"clr.l (%0)+\;move%.b %1,(-1,%0)\";
+ #endif
#else
return \"clrl %0 at +\;moveb %1,%0@(-1)\";
#endif
***************
*** 1044,1049
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)
return \"move%.l %2,%0\;add%.l %1,%0\";
#ifdef MOTOROLA
if (GET_CODE (operands[2]) == REG)
return \"lea (%1,%2.l),%0\";
--- 1052,1063 -----
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)
return \"move%.l %2,%0\;add%.l %1,%0\";
+ #ifdef unixpc
+ if (GET_CODE (operands[2]) == REG)
+ return \"lea (%1,%2.l),%0\";
+ else
+ return \"lea %c2(%1),%0\";
+ #else
#ifdef MOTOROLA
if (GET_CODE (operands[2]) == REG)
return \"lea (%1,%2.l),%0\";
***************
*** 1055,1060
else
return \"lea %1@(%c2),%0\";
#endif
}
if (GET_CODE (operands[2]) == CONST_INT)
{
--- 1069,1075 -----
else
return \"lea %1@(%c2),%0\";
#endif
+ #endif
}
if (GET_CODE (operands[2]) == CONST_INT)
{
***************
*** 1197,1202
So do this specially. */
if (INTVAL (operands[2]) == -0x8000)
return \"move%.l %1,%0\;sub%.l %2,%0\";
#ifdef MOTOROLA
return \"lea (%n2,%1),%0\";
#else
--- 1212,1220 -----
So do this specially. */
if (INTVAL (operands[2]) == -0x8000)
return \"move%.l %1,%0\;sub%.l %2,%0\";
+ #ifdef unixpc
+ return \"lea %n2(%1),%0\";
+ #else
#ifdef MOTOROLA
return \"lea (%n2,%1),%0\";
#else
***************
*** 1202,1207
#else
return \"lea %1@(%n2),%0\";
#endif
}
if (GET_CODE (operands[2]) == CONST_INT)
{
--- 1220,1226 -----
#else
return \"lea %1@(%n2),%0\";
#endif
+ #endif
}
if (GET_CODE (operands[2]) == CONST_INT)
{
***************
*** 1815,1820
"(GET_CODE (operands[0]) == CONST_INT
&& (INTVAL (operands[0]) & ~0xff) == 0)"
"*
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
")
--- 1834,1842 -----
"(GET_CODE (operands[0]) == CONST_INT
&& (INTVAL (operands[0]) & ~0xff) == 0)"
"*
+ #ifdef unixpc
+ cc_status.flags |= CC_REVERSED; return \"cmp%.b %1,%0\";
+ #else
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
#endif
")
***************
*** 1816,1821
&& (INTVAL (operands[0]) & ~0xff) == 0)"
"*
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
")
(define_insn ""
--- 1838,1844 -----
cc_status.flags |= CC_REVERSED; return \"cmp%.b %1,%0\";
#else
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
+ #endif
")
(define_insn ""
***************
*** 1824,1830
(match_operand:QI 1 "general_operand" "i")))]
"(GET_CODE (operands[1]) == CONST_INT
&& (INTVAL (operands[1]) & ~0xff) == 0)"
! "cmp%.b %1,%0")
(define_insn ""
[(set (cc0) (minus (match_operand:QI 0 "general_operand" "i")
--- 1847,1859 -----
(match_operand:QI 1 "general_operand" "i")))]
"(GET_CODE (operands[1]) == CONST_INT
&& (INTVAL (operands[1]) & ~0xff) == 0)"
! "*
! #ifdef unixpc
! return \"cmp%.b %0,%1\";
! #else
! return \"cmp%.b %1,%0\";
! #endif
! ")
(define_insn ""
[(set (cc0) (minus (match_operand:QI 0 "general_operand" "i")
***************
*** 1833,1838
"(GET_CODE (operands[0]) == CONST_INT
&& ((INTVAL (operands[0]) + 0x80) & ~0xff) == 0)"
"*
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
")
--- 1862,1870 -----
"(GET_CODE (operands[0]) == CONST_INT
&& ((INTVAL (operands[0]) + 0x80) & ~0xff) == 0)"
"*
+ #ifdef unixpc
+ cc_status.flags |= CC_REVERSED; return \"cmp%.b %1,%0\";
+ #else
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
#endif
")
***************
*** 1834,1839
&& ((INTVAL (operands[0]) + 0x80) & ~0xff) == 0)"
"*
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
")
(define_insn ""
--- 1866,1872 -----
cc_status.flags |= CC_REVERSED; return \"cmp%.b %1,%0\";
#else
cc_status.flags |= CC_REVERSED; return \"cmp%.b %0,%1\";
+ #endif
")
(define_insn ""
***************
*** 1842,1848
(match_operand:QI 1 "general_operand" "i")))]
"(GET_CODE (operands[1]) == CONST_INT
&& ((INTVAL (operands[1]) + 0x80) & ~0xff) == 0)"
! "cmp%.b %1,%0")
;;- arithmetic shift instructions
;;- don't need the shift memory by 1 bit instruction
--- 1875,1887 -----
(match_operand:QI 1 "general_operand" "i")))]
"(GET_CODE (operands[1]) == CONST_INT
&& ((INTVAL (operands[1]) + 0x80) & ~0xff) == 0)"
! "*
! #ifdef unixpc
! return \"cmp%.b %0,%1\";
! #else
! return \"cmp%.b %1,%0\";
! #endif
! ")
;;- arithmetic shift instructions
;;- don't need the shift memory by 1 bit instruction
***************
*** 2790,2795
(use (label_ref (match_operand 1 "" "")))]
""
"*
#ifdef SGS
return \"jmp 2(%%pc,%0.w)\";
#else
--- 2829,2837 -----
(use (label_ref (match_operand 1 "" "")))]
""
"*
+ #ifdef unixpc
+ return \"jmp 6(%%pc,%0.w)\";
+ #else
#ifdef SGS
return \"jmp 2(%%pc,%0.w)\";
#else
***************
*** 2799,2804
return \"jmp pc@(2,%0:w)\";
#endif
#endif
")
(define_insn ""
--- 2841,2847 -----
return \"jmp pc@(2,%0:w)\";
#endif
#endif
+ #endif
")
(define_insn ""
***************
*** 2827,2832
#endif
}
#ifdef MOTOROLA
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#else
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
--- 2870,2878 -----
#endif
}
#ifdef MOTOROLA
+ #ifdef unixpc
+ return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
+ #else
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#endif
#else
***************
*** 2828,2833
}
#ifdef MOTOROLA
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#else
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
#endif
--- 2874,2880 -----
return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
#else
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
+ #endif
#else
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
#endif
***************
*** 2853,2858
return \"dbra %0,%l1\;clr.w %0\;subq.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq.l %#1,%0\;jbcc %l1\";
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#else
if (DATA_REG_P (operands[0]))
--- 2900,2908 -----
return \"dbra %0,%l1\;clr.w %0\;subq.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq.l %#1,%0\;jbcc %l1\";
+ #ifdef unixpc
+ return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
+ #else
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif
#else
***************
*** 2854,2859
if (GET_CODE (operands[0]) == MEM)
return \"subq.l %#1,%0\;jbcc %l1\";
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#else
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clrw %0\;subql %#1,%0\;jcc %l1\";
--- 2904,2910 -----
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#else
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
+ #endif
#else
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clrw %0\;subql %#1,%0\;jcc %l1\";
*** tm-unixpc.h.orig Wed Mar 23 01:16:35 1988
--- tm-unixpc.h Wed Mar 23 00:30:22 1988
***************
*** 0
--- 1,301 -----
+ /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
+ Copyright (C) 1987 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. No author or distributor
+ accepts responsibility to anyone for the consequences of using it
+ or for whether it serves any particular purpose or works at all,
+ unless he says so in writing. Refer to the GNU CC General Public
+ License for full details.
+
+ Everyone is granted permission to copy, modify and redistribute
+ GNU CC, but only under the conditions described in the
+ GNU CC General Public License. A copy of this license is
+ supposed to have been given to you along with GNU CC so you
+ can know your rights and responsibilities. It should be in a
+ file named COPYING. Among other things, the copyright notice
+ and this notice must be preserved on all copies. */
+
+ #include "tm-hp9k320.h"
+
+ /* See tm-m68k.h. 7 means 680[01]0 with no 68881. */
+
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT 0
+
+ /* -m68020 requires special flags to the assembler. */
+
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{m68020:-68020}%{!m68020:-68010}"
+
+ /* we use /lib/libp/lib* when profiling */
+
+ #undef LIB_SPEC
+ #define LIB_SPEC "%{!shlib:%{p:-L/lib/libp} %{pg:-L/lib/libp} -lc}"
+
+ /* shared libraries need to use crt0s.o */
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+ "%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
+ %{shlib:crt0s.o%s shlib.ifile%s} "
+
+ /* cpp has to support a #sccs directive for the /usr/include files */
+
+ #define SCCS_DIRECTIVE
+
+ /* Names to predefine in the preprocessor for this target machine. */
+
+ #undef CPP_PREDEFINES
+ #define CPP_PREDEFINES "-Dmc68000 -Dmc68k -Dm68k -Dunix -Dunixpc"
+
+ /* Override parts of tm-m68k.h to fit the HPUX assembler. */
+
+ #undef TARGET_VERSION
+ #undef ASM_OUTPUT_DOUBLE
+ #undef ASM_OUTPUT_FLOAT
+ #undef ASM_OUTPUT_ALIGN
+ #undef ASM_OUTPUT_SOURCE_FILENAME
+ #undef ASM_OUTPUT_SOURCE_LINE
+ #undef PRINT_OPERAND_ADDRESS
+ #undef ASM_OUTPUT_INTERNAL_LABEL
+ #undef ASM_OUTPUT_OPCODE
+ #undef ASM_OUTPUT_LOCAL
+ #undef ASM_OUTPUT_LABELREF
+ #undef GENERATE_SPECIAL_LABEL
+
+ #define TARGET_VERSION printf (" (68k, SGS/AT&T unixpc syntax)");
+
+ /* The unixpc doesn't know about double's and float's */
+
+ #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
+ do { union { double d; long l[2]; } tem; \
+ tem.d = (VALUE); \
+ fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
+ } while (0)
+
+ #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
+ do { union { float f; long l;} tem; \
+ tem.f = (VALUE); \
+ fprintf (FILE, "\tlong 0x%x\n", tem.l); \
+ } while (0)
+
+ #define ASM_OUTPUT_ALIGN(FILE,LOG) \
+ if ((LOG) == 1) \
+ fprintf (FILE, "\teven\n"); \
+ else if ((LOG) != 0) \
+ abort ();
+
+ /* The beginnings of sdb support... */
+
+ #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
+ fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME);
+
+ #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO) \
+ fprintf (FILE, "\tln\t%d\n", LINENO);
+
+ /* Yet another null terminated string format. */
+
+ #if 0
+ #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
+ { register int sp = 0, lp = 0; \
+ fprintf (FILE, "\tbyte\t"); \
+ loop: \
+ if (PTR[sp] > ' ' && ! (PTR[sp] & 0x80) && PTR[sp] != '\\') \
+ { lp += 3; \
+ fprintf (FILE, "'%c", PTR[sp]); } \
+ else \
+ { lp += 5; \
+ fprintf (FILE, "0x%x", PTR[sp]); } \
+ if (++sp < LEN) \
+ { if (lp > 60) \
+ { lp = 0; \
+ fprintf (FILE, "\n%s ", ASCII_DATA_ASM_OP); } \
+ else \
+ putc (',', FILE); \
+ goto loop; } \
+ putc ('\n', FILE); }
+ #endif
+
+ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
+ { register rtx reg1, reg2, breg, ireg; \
+ register rtx addr = ADDR; \
+ rtx offset; \
+ switch (GET_CODE (addr)) \
+ { \
+ case REG: \
+ fprintf (FILE, "(%s)", reg_name [REGNO (addr)]); \
+ break; \
+ case PRE_DEC: \
+ fprintf (FILE, "-(%s)", reg_name [REGNO (XEXP (addr, 0))]); \
+ break; \
+ case POST_INC: \
+ fprintf (FILE, "(%s)+", reg_name [REGNO (XEXP (addr, 0))]); \
+ break; \
+ case PLUS: \
+ reg1 = 0; reg2 = 0; \
+ ireg = 0; breg = 0; \
+ offset = 0; \
+ if (CONSTANT_ADDRESS_P (XEXP (addr, 0))) \
+ { \
+ offset = XEXP (addr, 0); \
+ addr = XEXP (addr, 1); \
+ } \
+ else if (CONSTANT_ADDRESS_P (XEXP (addr, 1))) \
+ { \
+ offset = XEXP (addr, 1); \
+ addr = XEXP (addr, 0); \
+ } \
+ if (GET_CODE (addr) != PLUS) ; \
+ else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND) \
+ { \
+ reg1 = XEXP (addr, 0); \
+ addr = XEXP (addr, 1); \
+ } \
+ else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND) \
+ { \
+ reg1 = XEXP (addr, 1); \
+ addr = XEXP (addr, 0); \
+ } \
+ else if (GET_CODE (XEXP (addr, 0)) == MULT) \
+ { \
+ reg1 = XEXP (addr, 0); \
+ addr = XEXP (addr, 1); \
+ } \
+ else if (GET_CODE (XEXP (addr, 1)) == MULT) \
+ { \
+ reg1 = XEXP (addr, 1); \
+ addr = XEXP (addr, 0); \
+ } \
+ else if (GET_CODE (XEXP (addr, 0)) == REG) \
+ { \
+ reg1 = XEXP (addr, 0); \
+ addr = XEXP (addr, 1); \
+ } \
+ else if (GET_CODE (XEXP (addr, 1)) == REG) \
+ { \
+ reg1 = XEXP (addr, 1); \
+ addr = XEXP (addr, 0); \
+ } \
+ if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT \
+ || GET_CODE (addr) == SIGN_EXTEND) \
+ { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; } \
+ /* for OLD_INDEXING \
+ else if (GET_CODE (addr) == PLUS) \
+ { \
+ if (GET_CODE (XEXP (addr, 0)) == REG) \
+ { \
+ reg2 = XEXP (addr, 0); \
+ addr = XEXP (addr, 1); \
+ } \
+ else if (GET_CODE (XEXP (addr, 1)) == REG) \
+ { \
+ reg2 = XEXP (addr, 1); \
+ addr = XEXP (addr, 0); \
+ } \
+ } \
+ */ \
+ if (offset != 0) { if (addr != 0) abort (); addr = offset; } \
+ if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND \
+ || GET_CODE (reg1) == MULT)) \
+ || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2)))) \
+ { breg = reg2; ireg = reg1; } \
+ else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1))) \
+ { breg = reg1; ireg = reg2; } \
+ if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF) \
+ { int scale = 1; \
+ if (GET_CODE (ireg) == MULT) \
+ { scale = INTVAL (XEXP (ireg, 1)); \
+ ireg = XEXP (ireg, 0); } \
+ if (GET_CODE (ireg) == SIGN_EXTEND) \
+ fprintf (FILE, "L%d-LI%d-2(%%pc,%s.w)", \
+ CODE_LABEL_NUMBER (XEXP (addr, 0)), \
+ CODE_LABEL_NUMBER (XEXP (addr, 0)), \
+ reg_name[REGNO (XEXP (ireg, 0))]); \
+ else \
+ fprintf (FILE, "L%d-LI%d-2(%%pc,%s.l)", \
+ CODE_LABEL_NUMBER (XEXP (addr, 0)), \
+ CODE_LABEL_NUMBER (XEXP (addr, 0)), \
+ reg_name[REGNO (ireg)]); \
+ if (scale != 1) fprintf (FILE, ":%d", scale); \
+ break; } \
+ if (ireg != 0 || breg != 0) \
+ { int scale = 1; \
+ if (breg == 0) \
+ abort (); \
+ if (addr != 0) \
+ output_addr_const (FILE, addr); \
+ fprintf (FILE, "(%s", reg_name[REGNO (breg)]); \
+ if (ireg != 0) \
+ putc (',', FILE); \
+ if (ireg != 0 && GET_CODE (ireg) == MULT) \
+ { scale = INTVAL (XEXP (ireg, 1)); \
+ ireg = XEXP (ireg, 0); } \
+ if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) \
+ fprintf (FILE, "%s.w", reg_name[REGNO (XEXP (ireg, 0))]); \
+ else if (ireg != 0) \
+ fprintf (FILE, "%s.l", reg_name[REGNO (ireg)]); \
+ if (scale != 1) fprintf (FILE, ":%d", scale); \
+ putc (')', FILE); \
+ break; \
+ } \
+ else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF) \
+ { fprintf (FILE, "10(%%pc,%s.w)", reg_name[REGNO (reg1)]); \
+ break; } \
+ default: \
+ if (GET_CODE (addr) == CONST_INT \
+ && INTVAL (addr) < 0x8000 \
+ && INTVAL (addr) >= -0x8000) \
+ fprintf (FILE, "%d", INTVAL (addr)); \
+ else \
+ output_addr_const (FILE, addr); \
+ }}
+
+ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
+ fprintf (FILE, "%s%d:\n", PREFIX, NUM)
+
+ #define ASM_OUTPUT_OPCODE(FILE, PTR) \
+ { if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
+ { ++(PTR); \
+ while (*(PTR) != ' ') \
+ { putc (*(PTR), (FILE)); ++(PTR); } \
+ fprintf ((FILE), ".w"); } \
+ else if ((PTR)[0] == 'f') \
+ { \
+ if (!strncmp ((PTR), "fmove", 5)) \
+ { fprintf ((FILE), "fmov"); (PTR) += 5; } \
+ else if (!strncmp ((PTR), "ftst", 4)) \
+ { fprintf ((FILE), "ftest"); (PTR) += 4; } \
+ } \
+ /* MOVE, MOVEA, MOVEQ, MOVEC ==> MOV */ \
+ else if ((PTR)[0] == 'm' && (PTR)[1] == 'o' \
+ && (PTR)[2] == 'v' && (PTR)[3] == 'e') \
+ { fprintf ((FILE), "mov"); (PTR) += 4; \
+ if ((PTR)[0] == 'q' || (PTR)[0] == 'a' || \
+ (PTR)[0] == 'c') (PTR)++; } \
+ /* SUB, SUBQ, SUBA, SUBI ==> SUB */ \
+ else if ((PTR)[0] == 's' && (PTR)[1] == 'u' \
+ && (PTR)[2] == 'b') \
+ { fprintf ((FILE), "sub"); (PTR) += 3; \
+ if ((PTR)[0] == 'q' || (PTR)[0] == 'i' || \
+ (PTR)[0] == 'a') (PTR)++; } \
+ /* CMP, CMPA, CMPI, CMPM ==> CMP */ \
+ else if ((PTR)[0] == 'c' && (PTR)[1] == 'm' \
+ && (PTR)[2] == 'p') \
+ { fprintf ((FILE), "cmp"); (PTR) += 3; \
+ if ((PTR)[0] == 'a' || (PTR)[0] == 'i' || \
+ (PTR)[0] == 'm') (PTR)++; } \
+ }
+
+ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE) \
+ ( fputs ("\tlcomm ", (FILE)), \
+ assemble_name ((FILE), (NAME)), \
+ fprintf ((FILE), ",%d\n", (SIZE)))
+
+ #define ASM_OUTPUT_LABELREF(FILE,NAME) \
+ fprintf (FILE, "%s", NAME)
+
+ #define GENERATE_SPECIAL_LABEL(LABEL, NAME, NUMBER) \
+ sprintf (LABEL, "%s%%%d", NAME, NUMBER)
--------------------End of diff files-----------------------------------------
--
:alex.
nerwin!alex at umbc3.umd.edu
alex at umbc3.umd.edu
More information about the Comp.sys.att
mailing list