mirror of
https://github.com/pret/agbcc.git
synced 2026-10-01 22:35:14 -04:00
delete irrelevant configs
This commit is contained in:
@@ -1,734 +0,0 @@
|
||||
/* Subroutines for insn-output.c for MIL-STD-1750.
|
||||
Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define __datalbl
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "rtl.h"
|
||||
#include "tree.h"
|
||||
#include "expr.h"
|
||||
#define HAVE_cc0
|
||||
#include "conditions.h"
|
||||
#include "real.h"
|
||||
#include "regs.h"
|
||||
|
||||
struct datalabel_array datalbl[DATALBL_ARRSIZ];
|
||||
int datalbl_ndx = -1;
|
||||
struct jumplabel_array jmplbl[JMPLBL_ARRSIZ];
|
||||
int jmplbl_ndx = -1;
|
||||
int label_pending = 0, program_counter = 0;
|
||||
enum section current_section = Normal;
|
||||
char *sectname[4] =
|
||||
{"Init", "Normal", "Konst", "Static"};
|
||||
|
||||
int
|
||||
notice_update_cc (exp)
|
||||
rtx exp;
|
||||
{
|
||||
if (GET_CODE (exp) == SET)
|
||||
{
|
||||
enum rtx_code src_code = GET_CODE (SET_SRC (exp));
|
||||
/* Jumps do not alter the cc's. */
|
||||
if (SET_DEST (exp) == pc_rtx)
|
||||
return;
|
||||
/* Moving a register or constant into memory doesn't alter the cc's. */
|
||||
if (GET_CODE (SET_DEST (exp)) == MEM
|
||||
&& (src_code == REG || src_code == CONST_INT))
|
||||
return;
|
||||
/* Function calls clobber the cc's. */
|
||||
if (src_code == CALL)
|
||||
{
|
||||
CC_STATUS_INIT;
|
||||
return;
|
||||
}
|
||||
/* Emulated longword bit-ops leave cc's incorrect */
|
||||
if (GET_MODE (SET_DEST (exp)) == HImode ?
|
||||
src_code == AND || src_code == IOR ||
|
||||
src_code == XOR || src_code == NOT : 0)
|
||||
{
|
||||
CC_STATUS_INIT;
|
||||
return;
|
||||
}
|
||||
/* Tests and compares set the cc's in predictable ways. */
|
||||
if (SET_DEST (exp) == cc0_rtx)
|
||||
{
|
||||
CC_STATUS_INIT;
|
||||
cc_status.value1 = SET_SRC (exp);
|
||||
return;
|
||||
}
|
||||
/* Anything else will set cc_status. */
|
||||
cc_status.flags = CC_NO_OVERFLOW;
|
||||
cc_status.value1 = SET_SRC (exp);
|
||||
cc_status.value2 = SET_DEST (exp);
|
||||
return;
|
||||
}
|
||||
else if (GET_CODE (exp) == PARALLEL
|
||||
&& GET_CODE (XVECEXP (exp, 0, 0)) == SET)
|
||||
{
|
||||
if (SET_DEST (XVECEXP (exp, 0, 0)) == pc_rtx)
|
||||
return;
|
||||
if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx)
|
||||
{
|
||||
CC_STATUS_INIT;
|
||||
cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0));
|
||||
return;
|
||||
}
|
||||
CC_STATUS_INIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_STATUS_INIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rtx
|
||||
function_arg (cum, mode, type, named)
|
||||
int cum;
|
||||
enum machine_mode mode;
|
||||
tree type;
|
||||
int named;
|
||||
{
|
||||
int size;
|
||||
|
||||
if (MUST_PASS_IN_STACK (mode, type))
|
||||
return (rtx) 0;
|
||||
if (mode == BLKmode)
|
||||
size = int_size_in_bytes (type);
|
||||
else
|
||||
size = GET_MODE_SIZE (mode);
|
||||
if (cum + size < 12)
|
||||
return gen_rtx (REG, mode, cum);
|
||||
else
|
||||
return (rtx) 0;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
get_double (x)
|
||||
rtx x;
|
||||
{
|
||||
union
|
||||
{
|
||||
double d;
|
||||
long i[2];
|
||||
}
|
||||
du;
|
||||
|
||||
du.i[0] = CONST_DOUBLE_LOW (x);
|
||||
du.i[1] = CONST_DOUBLE_HIGH (x);
|
||||
return du.d;
|
||||
}
|
||||
|
||||
char *
|
||||
float_label (code, value)
|
||||
char code;
|
||||
double value;
|
||||
{
|
||||
int i = 1;
|
||||
static char label[32];
|
||||
char *p;
|
||||
|
||||
label[0] = code;
|
||||
p = label + 1;
|
||||
sprintf (p, "%lf", value);
|
||||
while (*p)
|
||||
{
|
||||
*p = (*p == '+') ? 'p' :
|
||||
(*p == '-') ? 'm' : *p;
|
||||
p++;
|
||||
}
|
||||
return xstrdup (label);
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
movcnt_regno_adjust (op)
|
||||
rtx *op;
|
||||
{
|
||||
static char outstr[80];
|
||||
int op0r = REGNO (op[0]), op1r = REGNO (op[1]), op2r = REGNO (op[2]);
|
||||
#define dstreg op0r
|
||||
#define srcreg op1r
|
||||
#define cntreg op2r
|
||||
#define cntreg_1750 (op0r + 1)
|
||||
|
||||
if (cntreg == cntreg_1750)
|
||||
sprintf (outstr, "mov r%d,r%d", op0r, op1r);
|
||||
else if (dstreg + 1 == srcreg && cntreg > srcreg)
|
||||
sprintf (outstr, "xwr r%d,r%d\n\tmov r%d,r%d", op2r, op1r, op0r, op2r);
|
||||
else if (dstreg == cntreg + 1)
|
||||
sprintf (outstr, "xwr r%d,r%d\n\tmov r%d,r%d", op0r, op2r, op2r, op1r);
|
||||
else if (dstreg == srcreg + 1)
|
||||
sprintf (outstr, "xwr r%d,r%d\n\txwr r%d,r%d\n\tmov r%d,r%d",
|
||||
op0r, op1r, op0r, op2r, op1r, op2r);
|
||||
else if (cntreg + 1 == srcreg)
|
||||
sprintf (outstr, "xwr r%d,r%d\n\txwr r%d,r%d\n\tmov r%d,r%d",
|
||||
op2r, op1r, op0r, op2r, op2r, op0r);
|
||||
else if (cntreg == srcreg + 1)
|
||||
sprintf (outstr, "xwr r%d,r%d\n\tmov r%d,r%d", op0r, op1r, op1r, op0r);
|
||||
else
|
||||
sprintf (outstr, "xwr r%d,r%d\n\tmov r%d,r%d\n\txwr r%d,r%d",
|
||||
op2r, cntreg_1750, op0r, op1r, op2r, cntreg_1750);
|
||||
return outstr;
|
||||
}
|
||||
|
||||
char *
|
||||
mod_regno_adjust (instr, op)
|
||||
char *instr;
|
||||
rtx *op;
|
||||
{
|
||||
static char outstr[40];
|
||||
char *r = (!strncmp (instr, "dvr", 3) ? "r" : "");
|
||||
int modregno_gcc = REGNO (op[3]), modregno_1750 = REGNO (op[0]) + 1;
|
||||
|
||||
if (modregno_gcc == modregno_1750
|
||||
|| (reg_renumber != NULL
|
||||
&& reg_renumber[modregno_gcc] >= 0
|
||||
&& reg_renumber[modregno_gcc] == reg_renumber[modregno_1750]))
|
||||
sprintf (outstr, "%s r%%0,%s%%2", instr, r);
|
||||
else
|
||||
sprintf (outstr, "lr r%d,r%d\n\t%s r%%0,%s%%2\n\txwr r%d,r%d",
|
||||
modregno_gcc, modregno_1750, instr, r, modregno_1750,
|
||||
modregno_gcc);
|
||||
return outstr;
|
||||
}
|
||||
|
||||
|
||||
/* Check if op is a valid memory operand for 1750A Load/Store instructions
|
||||
(memory indirection permitted.) */
|
||||
|
||||
int
|
||||
memop_valid (op)
|
||||
rtx op;
|
||||
{
|
||||
static int recurred = 0;
|
||||
int valid;
|
||||
|
||||
if (GET_MODE (op) != Pmode && GET_MODE (op) != VOIDmode
|
||||
&& GET_MODE (op) != QImode)
|
||||
return 0;
|
||||
switch (GET_CODE (op))
|
||||
{
|
||||
case MEM:
|
||||
if (!recurred && GET_CODE (XEXP (op, 0)) == REG)
|
||||
return 1;
|
||||
case MINUS:
|
||||
case MULT:
|
||||
case DIV:
|
||||
return 0;
|
||||
case PLUS:
|
||||
recurred = 1;
|
||||
valid = memop_valid (XEXP (op, 0));
|
||||
if (valid)
|
||||
valid = memop_valid (XEXP (op, 1));
|
||||
recurred = 0;
|
||||
return valid;
|
||||
case REG:
|
||||
if (REGNO (op) > 0)
|
||||
return 1;
|
||||
return 0;
|
||||
case CONST:
|
||||
case CONST_INT:
|
||||
case SYMBOL_REF:
|
||||
case SUBREG:
|
||||
return 1;
|
||||
default:
|
||||
printf ("memop_valid: code=%d\n", (int) GET_CODE (op));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* predicate for the MOV instruction: */
|
||||
int
|
||||
mov_memory_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
return (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG);
|
||||
}
|
||||
|
||||
/* predicate for the STC instruction: */
|
||||
int
|
||||
small_nonneg_const (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
if (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) <= 15)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* predicate for constant zero: */
|
||||
int
|
||||
zero_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
return op == CONST0_RTX (mode);
|
||||
}
|
||||
|
||||
|
||||
/* predicate for 1750 `B' addressing mode (Base Register with Offset)
|
||||
memory operand */
|
||||
int
|
||||
b_mode_operand (op)
|
||||
rtx op;
|
||||
{
|
||||
if (GET_CODE (op) == MEM)
|
||||
{
|
||||
rtx inner = XEXP (op, 0);
|
||||
if (GET_CODE (inner) == REG && REG_OK_FOR_INDEX_P (inner))
|
||||
return 1;
|
||||
if (GET_CODE (inner) == PLUS)
|
||||
{
|
||||
rtx plus_op0 = XEXP (inner, 0);
|
||||
if (GET_CODE (plus_op0) == REG && REG_OK_FOR_INDEX_P (plus_op0))
|
||||
{
|
||||
rtx plus_op1 = XEXP (inner, 1);
|
||||
if (GET_CODE (plus_op1) == CONST_INT
|
||||
&& INTVAL (plus_op1) >= 0
|
||||
&& INTVAL (plus_op1) <= 255)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Decide whether to output a conditional jump as a "Jump Conditional"
|
||||
or as a "Branch Conditional": */
|
||||
|
||||
int
|
||||
find_jmplbl (labelnum)
|
||||
int labelnum;
|
||||
{
|
||||
int i, found = 0;
|
||||
|
||||
for (i = 0; i <= jmplbl_ndx; i++)
|
||||
if (labelnum == jmplbl[i].num)
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *
|
||||
branch_or_jump (condition, targetlabel_number)
|
||||
char *condition;
|
||||
int targetlabel_number;
|
||||
{
|
||||
static char buf[30];
|
||||
int index;
|
||||
|
||||
if ((index = find_jmplbl (targetlabel_number)) >= 0)
|
||||
if (program_counter - jmplbl[index].pc < 128)
|
||||
{
|
||||
sprintf (buf, "b%s %%l0", condition);
|
||||
return buf;
|
||||
}
|
||||
sprintf (buf, "jc %s,%%l0", condition);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
unsigned_comparison_operator (insn)
|
||||
rtx insn;
|
||||
{
|
||||
switch (GET_CODE (insn))
|
||||
{
|
||||
case GEU:
|
||||
case GTU:
|
||||
case LEU:
|
||||
case LTU:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
next_cc_user_is_unsigned (insn)
|
||||
rtx insn;
|
||||
{
|
||||
if ( !(insn = next_cc0_user (insn)))
|
||||
abort ();
|
||||
else if (GET_CODE (insn) == JUMP_INSN
|
||||
&& GET_CODE (PATTERN (insn)) == SET
|
||||
&& GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE)
|
||||
return unsigned_comparison_operator (XEXP (SET_SRC (PATTERN (insn)), 0));
|
||||
else if (GET_CODE (insn) == INSN
|
||||
&& GET_CODE (PATTERN (insn)) == SET)
|
||||
return unsigned_comparison_operator (SET_SRC (PATTERN (insn)));
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
|
||||
|
||||
static int addr_inc;
|
||||
|
||||
/* A C compound statement to output to stdio stream STREAM the
|
||||
assembler syntax for an instruction operand X. X is an RTL
|
||||
expression.
|
||||
|
||||
CODE is a value that can be used to specify one of several ways
|
||||
of printing the operand. It is used when identical operands
|
||||
must be printed differently depending on the context. CODE
|
||||
comes from the `%' specification that was used to request
|
||||
printing of the operand. If the specification was just `%DIGIT'
|
||||
then CODE is 0; if the specification was `%LTR DIGIT' then CODE
|
||||
is the ASCII code for LTR.
|
||||
|
||||
If X is a register, this macro should print the register's name.
|
||||
The names can be found in an array `reg_names' whose type is
|
||||
`char *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
|
||||
|
||||
When the machine description has a specification `%PUNCT' (a `%'
|
||||
followed by a punctuation character), this macro is called with
|
||||
a null pointer for X and the punctuation character for CODE.
|
||||
|
||||
The 1750 specific codes are:
|
||||
'J' for the negative of a constant
|
||||
'Q' for printing addresses in B mode syntax
|
||||
'd' for the second register in a pair
|
||||
't' for the third register in a triple
|
||||
'b' for the bit number (using 1750 test bit convention)
|
||||
'B' for the bit number of the 1's complement (for bit clear)
|
||||
'w' for int - 16
|
||||
*/
|
||||
|
||||
print_operand (file, x, letter)
|
||||
FILE *file;
|
||||
rtx x;
|
||||
int letter;
|
||||
{
|
||||
switch (GET_CODE (x))
|
||||
{
|
||||
case REG:
|
||||
if (letter == 'd')
|
||||
fprintf (file, "%d", REGNO (x) + 1);
|
||||
else if (letter == 't')
|
||||
fprintf (file, "%d", REGNO (x) + 2);
|
||||
else
|
||||
fprintf (file, "%d", REGNO (x));
|
||||
break;
|
||||
|
||||
case SYMBOL_REF:
|
||||
fprintf (file, "%s", XSTR (x, 0));
|
||||
if (letter == 'A')
|
||||
fprintf (file, "+1");
|
||||
break;
|
||||
|
||||
case LABEL_REF:
|
||||
case CONST:
|
||||
case MEM:
|
||||
if (letter == 'Q')
|
||||
{
|
||||
rtx inner = XEXP (x, 0);
|
||||
switch (GET_CODE (inner))
|
||||
{
|
||||
case REG:
|
||||
fprintf (file, "r%d,0", REGNO (inner));
|
||||
break;
|
||||
case PLUS:
|
||||
fprintf (file, "r%d,%d", REGNO (XEXP (inner, 0)),
|
||||
INTVAL (XEXP (inner, 1)));
|
||||
break;
|
||||
default:
|
||||
fprintf (file, "[ill Q code=%d]", GET_CODE (inner));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addr_inc = (letter == 'A' ? 1 : 0);
|
||||
output_address (XEXP (x, 0));
|
||||
}
|
||||
break;
|
||||
|
||||
case CONST_DOUBLE:
|
||||
/* {
|
||||
double value = get_double (x);
|
||||
char fltstr[32];
|
||||
sprintf (fltstr, "%lf", value);
|
||||
|
||||
if (letter == 'D' || letter == 'E')
|
||||
{
|
||||
int i, found = 0;
|
||||
for (i = 0; i <= datalbl_ndx; i++)
|
||||
if (strcmp (fltstr, datalbl[i].value) == 0)
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
strcpy (datalbl[i = ++datalbl_ndx].value, fltstr);
|
||||
datalbl[i].name = float_label (letter, value);
|
||||
datalbl[i].size = (letter == 'E') ? 3 : 2;
|
||||
check_section (Konst);
|
||||
fprintf (file, "K%s \tdata%s %s ;p_o\n", datalbl[i].name,
|
||||
(letter == 'E' ? "ef" : "f"), fltstr);
|
||||
check_section (Normal);
|
||||
}
|
||||
}
|
||||
else if (letter == 'F' || letter == 'G')
|
||||
{
|
||||
int i, found = 0;
|
||||
for (i = 0; i <= datalbl_ndx; i++)
|
||||
if (strcmp (fltstr, datalbl[i].value) == 0)
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"float value %lfnot found upon label reference\n", value);
|
||||
strcpy (datalbl[i = ++datalbl_ndx].value, fltstr);
|
||||
datalbl[i].name = float_label (letter, value);
|
||||
datalbl[i].size = (letter == 'G') ? 3 : 2;
|
||||
check_section (Konst);
|
||||
fprintf (file, "K%s \tdata%s %s ;p_o\n", datalbl[i].name,
|
||||
(letter == 'G' ? "ef" : "f"), fltstr);
|
||||
check_section (Normal);
|
||||
}
|
||||
fprintf (file, "%s ;P_O 'F'", datalbl[i].name);
|
||||
}
|
||||
else
|
||||
fprintf (file, " %s ;P_O cst_dbl ", fltstr);
|
||||
}
|
||||
*/
|
||||
fprintf (file, "%lf", get_double (x));
|
||||
break;
|
||||
|
||||
case CONST_INT:
|
||||
if (letter == 'J')
|
||||
fprintf (file, "%d", -INTVAL (x));
|
||||
else if (letter == 'b')
|
||||
fprintf (file, "%d", which_bit (INTVAL (x)));
|
||||
else if (letter == 'B')
|
||||
fprintf (file, "%d", which_bit (~INTVAL (x)));
|
||||
else if (letter == 'w')
|
||||
fprintf (file, "%d", INTVAL (x) - 16);
|
||||
else
|
||||
fprintf (file, "%d", INTVAL (x));
|
||||
break;
|
||||
|
||||
case CODE_LABEL:
|
||||
fprintf (file, "L%d", XINT (x, 3));
|
||||
break;
|
||||
|
||||
case CALL:
|
||||
fprintf (file, "CALL nargs=%d, func is either '%s' or '%s'",
|
||||
XEXP (x, 1), XSTR (XEXP (XEXP (x, 0), 1), 0), XSTR (XEXP (x, 0), 1));
|
||||
break;
|
||||
|
||||
case PLUS:
|
||||
{
|
||||
rtx op0 = XEXP (x, 0), op1 = XEXP (x, 1);
|
||||
int op0code = GET_CODE (op0), op1code = GET_CODE (op1);
|
||||
if (op1code == CONST_INT)
|
||||
switch (op0code)
|
||||
{
|
||||
case REG:
|
||||
fprintf (file, "%d,r%d ; p_o_PLUS for REG and CONST_INT",
|
||||
INTVAL (op1), REGNO (op0));
|
||||
break;
|
||||
case SYMBOL_REF:
|
||||
fprintf (file, "%d+%s", INTVAL (op1), XSTR (op0, 0));
|
||||
break;
|
||||
case MEM:
|
||||
fprintf (file, "%d,[mem:", INTVAL (op1));
|
||||
output_address (XEXP (op0, 0));
|
||||
fprintf (file, "] ;P_O plus");
|
||||
break;
|
||||
default:
|
||||
fprintf (file, "p_o_PLUS UFO, code=%d, with CONST=%d",
|
||||
(int) op0code, INTVAL (op1));
|
||||
}
|
||||
else if (op1code == SYMBOL_REF && op0code == REG)
|
||||
fprintf (file, "%s,r%d ; P_O: (plus reg sym)",
|
||||
XSTR (op1, 0), REGNO (op0));
|
||||
else
|
||||
fprintf (file, "p_o_+: op0code=%d, op1code=%d", op0code, op1code);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (file, "p_o_UFO code=%d", GET_CODE (x));
|
||||
}
|
||||
|
||||
addr_inc = 0;
|
||||
}
|
||||
|
||||
print_operand_address (file, addr)
|
||||
FILE *file;
|
||||
rtx addr;
|
||||
{
|
||||
switch (GET_CODE (addr))
|
||||
{
|
||||
case REG:
|
||||
fprintf (file, "%d,r%d ; P_O_A", addr_inc, REGNO (addr));
|
||||
break;
|
||||
case PLUS:
|
||||
{
|
||||
register rtx x = XEXP (addr, 0), y = XEXP (addr, 1);
|
||||
switch (GET_CODE (x))
|
||||
{
|
||||
case REG:
|
||||
switch (GET_CODE (y))
|
||||
{
|
||||
case CONST:
|
||||
output_address (XEXP (y, 0));
|
||||
fprintf (file, ",r%d ;P_O_A reg + const expr", REGNO (x));
|
||||
break;
|
||||
case CONST_INT:
|
||||
fprintf (file, "%d,r%d", INTVAL (y) + addr_inc, REGNO (x));
|
||||
break;
|
||||
case SYMBOL_REF:
|
||||
fprintf (file, "%s", XSTR (y, 0));
|
||||
if (addr_inc)
|
||||
fprintf (file, "+%d", addr_inc);
|
||||
fprintf (file, ",r%d ; P_O_A reg + sym", REGNO (x));
|
||||
break;
|
||||
case LABEL_REF:
|
||||
output_address (XEXP (y, 0));
|
||||
fprintf (file, ",r%d ; P_O_A reg + label", REGNO (x));
|
||||
break;
|
||||
default:
|
||||
fprintf (file, "[P_O_A reg%d+UFO code=%d]",
|
||||
REGNO (x), GET_CODE (y));
|
||||
}
|
||||
break;
|
||||
case LABEL_REF:
|
||||
output_address (XEXP (x, 0));
|
||||
break;
|
||||
case SYMBOL_REF:
|
||||
switch (GET_CODE (y))
|
||||
{
|
||||
case CONST_INT:
|
||||
fprintf (file, "%d+%s", INTVAL (y) + addr_inc, XSTR (x, 0));
|
||||
break;
|
||||
case REG:
|
||||
fprintf (file, "%s,r%d ;P_O_A sym + reg",
|
||||
XSTR (x, 0), REGNO (y));
|
||||
break;
|
||||
default:
|
||||
fprintf (file, "P_O_A sym/lab+UFO[sym=%s,code(y)=%d]",
|
||||
XSTR (x, 0), GET_CODE (y));
|
||||
}
|
||||
break;
|
||||
case CONST:
|
||||
output_address (XEXP (x, 0));
|
||||
if (GET_CODE (y) == REG)
|
||||
fprintf (file, ",r%d ;P_O_A const + reg", REGNO (x));
|
||||
else
|
||||
fprintf (file, "P_O_A const+UFO code(y)=%d]", GET_CODE (y));
|
||||
break;
|
||||
case MEM:
|
||||
output_address (y);
|
||||
fprintf (file, ",[mem:");
|
||||
output_address (XEXP (x, 0));
|
||||
fprintf (file, "] ;P_O_A plus");
|
||||
break;
|
||||
default:
|
||||
fprintf (file, "P_O_A plus op1_UFO[code1=%d,code2=%d]",
|
||||
GET_CODE (x), GET_CODE (y));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CONST_INT:
|
||||
if (INTVAL (addr) < 0x10000 && INTVAL (addr) >= -0x10000)
|
||||
fprintf (file, "%d ; p_o_a const addr?!", INTVAL (addr));
|
||||
else
|
||||
{
|
||||
fprintf (file, "[p_o_a=ILLEGAL_CONST]");
|
||||
output_addr_const (file, addr);
|
||||
}
|
||||
break;
|
||||
case LABEL_REF:
|
||||
case SYMBOL_REF:
|
||||
fprintf (file, "%s", XSTR (addr, 0));
|
||||
if (addr_inc)
|
||||
fprintf (file, "+%d", addr_inc);
|
||||
break;
|
||||
case MEM:
|
||||
fprintf (file, "[memUFO:");
|
||||
output_address (XEXP (addr, 0));
|
||||
fprintf (file, "]");
|
||||
break;
|
||||
case CONST:
|
||||
output_address (XEXP (addr, 0));
|
||||
fprintf (file, " ;P_O_A const");
|
||||
break;
|
||||
case CODE_LABEL:
|
||||
fprintf (file, "L%d", XINT (addr, 3));
|
||||
break;
|
||||
default:
|
||||
fprintf (file, " p_o_a UFO, code=%d val=0x%x",
|
||||
(int) GET_CODE (addr), INTVAL (addr));
|
||||
break;
|
||||
}
|
||||
addr_inc = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return non zero if the LS 16 bits of the given value has just one bit set,
|
||||
* otherwise return zero. Note this function may be used to detect one
|
||||
* bit clear by inverting the param.
|
||||
*/
|
||||
int
|
||||
one_bit_set_p (x)
|
||||
int x;
|
||||
{
|
||||
x &= 0xffff;
|
||||
return x && (x & (x - 1)) == 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the number of the least significant bit set, using the same
|
||||
* convention for bit numbering as in the MIL-STD-1750 sb instruction.
|
||||
*/
|
||||
int
|
||||
which_bit (x)
|
||||
int x;
|
||||
{
|
||||
int b = 15;
|
||||
|
||||
while (b > 0 && (x & 1) == 0)
|
||||
{
|
||||
b--;
|
||||
x >>= 1;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,158 +0,0 @@
|
||||
;; GCC assembler includefile for AS1750
|
||||
;;
|
||||
;; Macros defined:
|
||||
;; EFLR.M #d,#s Load the three regs starting at R#s to R#d following.
|
||||
;; RET.M #fs Return from function (uses the framesize #fs)
|
||||
|
||||
|
||||
UC SET 15
|
||||
|
||||
; Return from function ; parameter: framesize
|
||||
MACRO RET.M
|
||||
IF `1` > 0
|
||||
IF `1` <= 16
|
||||
AISP R14,`1`
|
||||
ELSE
|
||||
AIM R14,`1`
|
||||
ENDIF
|
||||
ENDIF
|
||||
LR R15,R14
|
||||
URS R15
|
||||
ENDMACRO
|
||||
|
||||
; Useful instructions missing from the 1750A standard:
|
||||
|
||||
; Extended Float Load from Registers
|
||||
MACRO EFLR.M ; args : #1=dest-regno, #2=source-regno
|
||||
ONE SET `1` + 2
|
||||
TWO SET `2` + 2
|
||||
IF `1` >= `2` || `1`+2 < `2`
|
||||
LR R`ONE`,R`TWO`
|
||||
DLR R`1`,R`2`
|
||||
ELSE
|
||||
DLR R`1`,R`2`
|
||||
LR R`ONE`,R`TWO`
|
||||
DLR R`1`,R`1` ; Just to update condition codes
|
||||
ENDIF
|
||||
ENDMACRO
|
||||
|
||||
; The following leave the condition codes haywire. But that is
|
||||
; accounted for (see notice_update_cc in config/1750a.c.)
|
||||
|
||||
; Double ANd Register with Register
|
||||
MACRO DANR.M
|
||||
ONE SET `1` + 1
|
||||
TWO SET `2` + 1
|
||||
ANDR R`1`,R`2`
|
||||
ANDR R`ONE`,R`TWO`
|
||||
ENDMACRO
|
||||
|
||||
; Double OR Register with Register
|
||||
MACRO DORR.M
|
||||
ONE SET `1` + 1
|
||||
TWO SET `2` + 1
|
||||
ORR R`1`,R`2`
|
||||
ORR R`ONE`,R`TWO`
|
||||
ENDMACRO
|
||||
|
||||
; Double eXoR Register with Register
|
||||
MACRO DXRR.M
|
||||
ONE SET `1` + 1
|
||||
TWO SET `2` + 1
|
||||
XORR R`1`,R`2`
|
||||
XORR R`ONE`,R`TWO`
|
||||
ENDMACRO
|
||||
|
||||
; Double Nand Register with register
|
||||
MACRO DNR.M
|
||||
ONE SET `1` + 1
|
||||
TWO SET `2` + 1
|
||||
NR R`1`,R`2`
|
||||
NR R`ONE`,R`TWO`
|
||||
ENDMACRO
|
||||
|
||||
; Unsigned Compare Immediate
|
||||
|
||||
MACRO UCIM.M
|
||||
LAST SET `1` + 3
|
||||
PSHM R`1`,R`LAST`
|
||||
LO SET `1` + 1
|
||||
LR R`LO`,R`1`
|
||||
XORR R`1`,R`1`
|
||||
HI SET `1` + 2
|
||||
XORR R`HI`,R`HI`
|
||||
LIM R`LAST`,`2`
|
||||
DCR R`1`,R`HI`
|
||||
POPM R`1`,R`LAST`
|
||||
ENDMACRO
|
||||
|
||||
|
||||
; Unsigned Compare Register with register
|
||||
|
||||
MACRO UCR.M
|
||||
PSHM R10,R13 ; R12 and R13 are assumed not to be input parameters
|
||||
LR R13,R`2`
|
||||
LR R11,R`1`
|
||||
XORR R12,R12
|
||||
XORR R10,R10
|
||||
DCR R10,R12
|
||||
POPM R10,R13
|
||||
ENDMACRO
|
||||
|
||||
|
||||
; Unsigned Compare register with memory
|
||||
|
||||
MACRO UC.M
|
||||
PSHM R10,R13
|
||||
L R13,`2`
|
||||
LR R11,R`1`
|
||||
XORR R12,R12
|
||||
XORR R10,R10
|
||||
DCR R10,R12
|
||||
POPM R10,R13
|
||||
ENDMACRO
|
||||
|
||||
|
||||
; Double Unsigned Compare Register with register
|
||||
|
||||
MACRO DUCR.M
|
||||
PSHM R13,R14 ; R13 and R14 are assumed not to be input parameters
|
||||
LOW1 SET `1` + 1
|
||||
LOW2 SET `2` + 1
|
||||
PSHM R`1`,R`LOW1`
|
||||
PSHM R`2`,R`LOW2`
|
||||
LR R13,R`LOW1`
|
||||
LR R14,R`LOW2`
|
||||
DSRL R`1`,1
|
||||
DSRL R`2`,1
|
||||
DCR R`1`,R`2`
|
||||
BNE +6
|
||||
ANDM R13,1
|
||||
ANDM R14,1
|
||||
CR R13,R14
|
||||
POPM R`2`,R`LOW2`
|
||||
POPM R`1`,R`LOW1`
|
||||
POPM R13,R14
|
||||
ENDMACRO
|
||||
|
||||
|
||||
; Double Unsigned Compare register with memory
|
||||
|
||||
MACRO DUC.M
|
||||
PSHM R13,R14 ; R13 and R14 are assumed not to be input parameters
|
||||
LOW1 SET `1` + 1
|
||||
PSHM R`1`,R`LOW1`
|
||||
DL R13,`2`
|
||||
DSRL R`1`,1
|
||||
DSRL R13,1
|
||||
DCR R`1`,R13
|
||||
BNE +10 ; done, go pop the saved regs
|
||||
DL R13,`2` ; interested in the *low* word (R14)
|
||||
L R13,1,R15
|
||||
ANDM R13,1
|
||||
ANDM R14,1
|
||||
CR R13,R14
|
||||
POPM R`1`,R`LOW1`
|
||||
POPM R13,R14
|
||||
ENDMACRO
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for MIL-STD-1750a.
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#error Gcc cannot run on a 1750a due to size problems!
|
||||
@@ -1,5 +0,0 @@
|
||||
This directory contains machine-specific files for the GNU C compiler.
|
||||
It has a subdirectory for each basic CPU type.
|
||||
The only files in this directory itself
|
||||
are some .h files that pertain to particular operating systems
|
||||
and are used for more than one CPU type.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
|
||||
# We need crt0.o.
|
||||
LIBGCC1_TEST =
|
||||
@@ -1,19 +0,0 @@
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
|
||||
# We need crt0.o.
|
||||
LIBGCC1_TEST =
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c > dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
|
||||
# We need crt0.o.
|
||||
LIBGCC1_TEST =
|
||||
|
||||
# We don't want to put exit in libgcc.a for VxWorks, because VxWorks
|
||||
# does not have _exit.
|
||||
TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c > dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
@@ -1,94 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for AMD Am29000 CPU
|
||||
running over UDI using COFF.
|
||||
Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Support the ctors and dtors sections for g++. */
|
||||
|
||||
#define CTORS_SECTION_ASM_OP "\t.use .ctors"
|
||||
#define DTORS_SECTION_ASM_OP "\t.use .dtors"
|
||||
|
||||
/* A list of other sections which the compiler might be "in" at any
|
||||
given time. */
|
||||
|
||||
#undef EXTRA_SECTIONS
|
||||
#define EXTRA_SECTIONS readonly_data, in_ctors, in_dtors
|
||||
|
||||
/* A list of extra section function definitions. */
|
||||
|
||||
#undef EXTRA_SECTION_FUNCTIONS
|
||||
#define EXTRA_SECTION_FUNCTIONS \
|
||||
READONLY_DATA_FUNCTION \
|
||||
CTORS_SECTION_FUNCTION \
|
||||
DTORS_SECTION_FUNCTION
|
||||
|
||||
#define READONLY_DATA_FUNCTION \
|
||||
void \
|
||||
literal_section () \
|
||||
{ \
|
||||
if (in_section != readonly_data) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \
|
||||
in_section = readonly_data; \
|
||||
} \
|
||||
} \
|
||||
|
||||
#define CTORS_SECTION_FUNCTION \
|
||||
void \
|
||||
ctors_section () \
|
||||
{ \
|
||||
if (in_section != in_ctors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
|
||||
in_section = in_ctors; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DTORS_SECTION_FUNCTION \
|
||||
void \
|
||||
dtors_section () \
|
||||
{ \
|
||||
if (in_section != in_dtors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
|
||||
in_section = in_dtors; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define INT_ASM_OP ".word"
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors. */
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
ctors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
@@ -1,92 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for AMD Am29000 CPU, Unix.
|
||||
Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* We define unix instead of EPI and define unix-style machine names. */
|
||||
|
||||
/* Set our default target to be the 29050; that is the more interesting chip
|
||||
for Unix systems. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (1+2+16+128)
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dam29k -Da29k -Dam29000 -Asystem(unix) -Acpu(a29k) -Amachine(a29k)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{!m29000:-Dam29050 -D__am29050__}"
|
||||
|
||||
/* Use a default linker configuration file. */
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-T default.gld%s"
|
||||
|
||||
/* Define the magic numbers that we recognize as COFF. */
|
||||
|
||||
#define MY_ISCOFF(magic) ((magic) == SIPFBOMAGIC || (magic) == SIPRBOMAGIC)
|
||||
|
||||
/* For some systems, it is best if double-word objects are aligned on a
|
||||
doubleword boundary. We want to maintain compatibility with MetaWare in
|
||||
a29k.h, but do not feel constrained to do so here. */
|
||||
|
||||
#undef BIGGEST_ALIGNMENT
|
||||
#define BIGGEST_ALIGNMENT 64
|
||||
|
||||
/* Add shared data as a kludge for now. */
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ char *p, *after_dir = main_input_filename; \
|
||||
if (TARGET_29050) \
|
||||
fprintf (FILE, "\t.cputype 29050\n"); \
|
||||
for (p = main_input_filename; *p; p++) \
|
||||
if (*p == '/') \
|
||||
after_dir = p + 1; \
|
||||
fprintf (FILE, "\t.file "); \
|
||||
output_quoted_string (FILE, after_dir); \
|
||||
fprintf (FILE, "\n"); \
|
||||
if (flag_shared_data) \
|
||||
fprintf (FILE, "\t.sect .shdata,data\n"); \
|
||||
fprintf (FILE, "\t.sect .lit,lit\n"); }
|
||||
|
||||
/* Output before shared data. */
|
||||
|
||||
#define SHARED_SECTION_ASM_OP "\t.use .shdata"
|
||||
|
||||
/* If we want shared data, we have to turn off commons. */
|
||||
|
||||
#define OVERRIDE_OPTIONS if (flag_shared_data) flag_no_common = 1;
|
||||
|
||||
/* Default to -fno-pcc-struct-return, since we don't have to worry about
|
||||
compatibility. */
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
|
||||
#if 0 /* This would be needed except that the 29k doesn't have strict
|
||||
alignment requirements. */
|
||||
|
||||
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
|
||||
(((TYPE) != 0) \
|
||||
? ((TYPE_ALIGN(TYPE) <= PARM_BOUNDARY) \
|
||||
? PARM_BOUNDARY \
|
||||
: TYPE_ALIGN(TYPE)) \
|
||||
: ((GET_MODE_ALIGNMENT(MODE) <= PARM_BOUNDARY) \
|
||||
? PARM_BOUNDARY \
|
||||
: GET_MODE_ALIGNMENT(MODE)))
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler. Vxworks 29k version.
|
||||
Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file just exists to give specs for the 29k running on VxWorks. */
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D_AM29K -D_AM29000 -Acpu(a29k) -Amachine(a29k) -D__vxworks -D__vxworks_5"
|
||||
|
||||
/* Vxworks header files require that the macro CPU be set.
|
||||
We could define it in CPP_PREDEFINES, but the value is (or will be)
|
||||
dependent upon GCC options. */
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "-DCPU=AM29200"
|
||||
|
||||
/* VxWorks does all the library stuff itself. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC ""
|
||||
|
||||
/* VxWorks provides the functionality of crt0.o and friends itself. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "crtbegin.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtend.o%s"
|
||||
@@ -1,2 +0,0 @@
|
||||
# Needed for missing functions in Sym1.
|
||||
CLIB=-liberty -lld
|
||||
@@ -1,41 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for AMD Am29000 processor.
|
||||
Copyright (C) 1987, 1988, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
#define HOST_WORDS_BIG_ENDIAN
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
@@ -1,43 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for AMD Am29000 processor.
|
||||
Copyright (C) 1987, 1988, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
#define HOST_WORDS_BIG_ENDIAN
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* Ultra is V7, which is closest to USG. */
|
||||
#define USG
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,33 +0,0 @@
|
||||
/^Makefile/,/^ rm -f config.run/d
|
||||
s/rm -f/del/
|
||||
s/|| cp/|| copy/
|
||||
/^config.status/,/ fi/d
|
||||
s/config.status//g
|
||||
s/\/dev\/null/NUL/g
|
||||
s/$(srcdir)\/c-parse/c-parse/g
|
||||
s/$(srcdir)\/c-gperf/c-gperf/g
|
||||
/^multilib.h/ s/multilib/not-multilib/
|
||||
/^target=/ c\
|
||||
target=winnt3.5
|
||||
/^xmake_file=/ d
|
||||
/^tmake_file=/ d
|
||||
/^out_file/ c\
|
||||
out_file=config/alpha/alpha.c
|
||||
/^out_object_file/ c\
|
||||
out_object_file=alpha.obj
|
||||
/^md_file/ c\
|
||||
md_file=config/alpha/alpha.md
|
||||
/^tm_file/ c\
|
||||
tm_file=config/alpha/alpha.h config/alpha/winnt.h
|
||||
/^build_xm_file/ c\
|
||||
build_xm_file=config/alpha/xm-alpha.h config/winnt/xm-winnt.h config/alpha/xm-winnt.h
|
||||
/^host_xm_file/ c\
|
||||
host_xm_file=config/alpha/xm-alpha.h config/winnt/xm-winnt.h config/alpha/xm-winnt.h
|
||||
/^####target/ i\
|
||||
CC = cl \
|
||||
CLIB = libc.lib kernel32.lib \
|
||||
CFLAGS = -Dalpha -DWIN32 -D_WIN32 -D_ALPHA_ -D_M_ALPHA \\\
|
||||
-DALMOST_STDC \
|
||||
LDFLAGS = -subsystem:console -entry:mainCRTStartup \\\
|
||||
-stack:1000000,1000 \
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
# Copyright (C) 1996, 1998 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2, or (at your option) any
|
||||
# later version.
|
||||
#
|
||||
# In addition to the permissions in the GNU General Public License, the
|
||||
# Free Software Foundation gives you unlimited permission to link the
|
||||
# compiled version of this file with other programs, and to distribute
|
||||
# those programs without any restriction coming from the use of this
|
||||
# file. (The General Public License restrictions do apply in other
|
||||
# respects; for example, they cover modification of the file, and
|
||||
# distribution when not linked into another program.)
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception, if you link this library with files
|
||||
# compiled with GCC to produce an executable, this does not cause
|
||||
# the resulting executable to be covered by the GNU General Public License.
|
||||
# This exception does not however invalidate any other reasons why
|
||||
# the executable file might be covered by the GNU General Public License.
|
||||
|
||||
#
|
||||
# Heads of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_LIST__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
.section .eh_frame,"aw"
|
||||
__EH_FRAME_BEGIN__:
|
||||
|
||||
#
|
||||
# Fragment of the ELF _fini routine that invokes our dtor cleanup.
|
||||
#
|
||||
|
||||
.section .fini,"ax"
|
||||
|
||||
# Since the bits of the _fini function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .fini section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_dtors_aux
|
||||
|
||||
# Ideally this call would go in crtend.o, except that we can't
|
||||
# get hold of __EH_FRAME_BEGIN__ there.
|
||||
|
||||
jsr $26,__do_frame_takedown
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _fini function and then SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Fragment of the ELF _init routine that sets up the frame info.
|
||||
#
|
||||
|
||||
.section .init,"ax"
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_frame_setup
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.data
|
||||
|
||||
# Support recursive calls to exit.
|
||||
$ptr: .quad __DTOR_LIST__
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_dtors_aux
|
||||
|
||||
__do_global_dtors_aux:
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $9,8($30)
|
||||
stq $26,0($30)
|
||||
.mask 0x4000200,-16
|
||||
.prologue 0
|
||||
|
||||
lda $9,$ptr
|
||||
br 1f
|
||||
0: stq $1,0($9)
|
||||
jsr $26,($27)
|
||||
1: ldq $1,0($9)
|
||||
ldq $27,8($1)
|
||||
addq $1,8,$1
|
||||
bne $27,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
ldq $9,8($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_dtors_aux
|
||||
|
||||
#
|
||||
# Install our frame info.
|
||||
#
|
||||
|
||||
# ??? How can we rationally keep this size correct?
|
||||
|
||||
.section .bss
|
||||
.type $object,@object
|
||||
.align 3
|
||||
$object:
|
||||
.zero 48
|
||||
.size $object, 48
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_frame_setup
|
||||
|
||||
__do_frame_setup:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $26,0($30)
|
||||
.mask 0x4000000,-16
|
||||
.prologue 1
|
||||
|
||||
lda $1,__register_frame_info
|
||||
beq $1,0f
|
||||
lda $16,__EH_FRAME_BEGIN__
|
||||
lda $17,$object
|
||||
jsr $26,__register_frame_info
|
||||
ldq $26,0($30)
|
||||
0: lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_frame_setup
|
||||
|
||||
#
|
||||
# Remove our frame info.
|
||||
#
|
||||
|
||||
.align 3
|
||||
.ent __do_frame_takedown
|
||||
|
||||
__do_frame_takedown:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $26,0($30)
|
||||
.mask 0x4000000,-16
|
||||
.prologue 1
|
||||
|
||||
lda $1,__deregister_frame_info
|
||||
beq $1,0f
|
||||
lda $16,__EH_FRAME_BEGIN__
|
||||
jsr $26,__deregister_frame_info
|
||||
ldq $26,0($30)
|
||||
0: lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_frame_takedown
|
||||
|
||||
.weak __register_frame_info
|
||||
.weak __deregister_frame_info
|
||||
@@ -1,108 +0,0 @@
|
||||
# Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2, or (at your option) any
|
||||
# later version.
|
||||
#
|
||||
# In addition to the permissions in the GNU General Public License, the
|
||||
# Free Software Foundation gives you unlimited permission to link the
|
||||
# compiled version of this file with other programs, and to distribute
|
||||
# those programs without any restriction coming from the use of this
|
||||
# file. (The General Public License restrictions do apply in other
|
||||
# respects; for example, they cover modification of the file, and
|
||||
# distribution when not linked into another program.)
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception, if you link this library with files
|
||||
# compiled with GCC to produce an executable, this does not cause
|
||||
# the resulting executable to be covered by the GNU General Public License.
|
||||
# This exception does not however invalidate any other reasons why
|
||||
# the executable file might be covered by the GNU General Public License.
|
||||
|
||||
#
|
||||
# Tails of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_END__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_END__:
|
||||
.quad 0
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_END__:
|
||||
.quad 0
|
||||
|
||||
.section .eh_frame,"aw"
|
||||
__FRAME_END__:
|
||||
.quad 0
|
||||
|
||||
#
|
||||
# Fragment of the ELF _init routine that invokes our ctor startup
|
||||
#
|
||||
|
||||
.section .init,"ax"
|
||||
|
||||
# Since the bits of the _init function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .init section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_ctors_aux
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _init function and thense SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_ctors_aux
|
||||
|
||||
__do_global_ctors_aux:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $9,8($30)
|
||||
stq $26,0($30)
|
||||
.mask 0x4000200,-16
|
||||
.prologue 1
|
||||
|
||||
lda $9,__CTOR_END__
|
||||
br 1f
|
||||
0: jsr $26,($27)
|
||||
1: ldq $27,-8($9)
|
||||
subq $9,8,$9
|
||||
not $27,$0
|
||||
bne $0,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
ldq $9,8($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_ctors_aux
|
||||
@@ -1,527 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF.
|
||||
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@tamu.edu).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef OBJECT_FORMAT_COFF
|
||||
#undef EXTENDED_COFF
|
||||
#define OBJECT_FORMAT_ELF
|
||||
|
||||
#define DBX_DEBUGGING_INFO
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
|
||||
#undef ASM_FINAL_SPEC
|
||||
|
||||
#undef CC1_SPEC
|
||||
#define CC1_SPEC "%{G*}"
|
||||
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "%{G*} %{relax:-relax} %{gdwarf*:-no-mdebug}"
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
|
||||
%{O*:-O3} %{!O*:-O1} \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
|
||||
%{static:-static}}"
|
||||
|
||||
/* Output at beginning of assembler file. */
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
do { \
|
||||
if (write_symbols != DWARF2_DEBUG) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
output_file_directive (FILE, main_input_filename); \
|
||||
} \
|
||||
fprintf (FILE, "\t.set noat\n"); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
if (TARGET_BWX | TARGET_MAX | TARGET_CIX) \
|
||||
{ \
|
||||
fprintf (FILE, "\t.arch %s\n", \
|
||||
(alpha_cpu == PROCESSOR_EV6 ? "ev6" \
|
||||
: TARGET_MAX ? "pca56" : "ev56")); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
extern void output_file_directive ();
|
||||
|
||||
/* Attach a special .ident directive to the end of the file to identify
|
||||
the version of GCC which compiled this code. The format of the
|
||||
.ident string is patterned after the ones produced by native svr4
|
||||
C compilers. */
|
||||
|
||||
#define IDENT_ASM_OP ".ident"
|
||||
|
||||
#ifdef IDENTIFY_WITH_IDENT
|
||||
#define ASM_IDENTIFY_GCC(FILE) /* nothing */
|
||||
#define ASM_IDENTIFY_LANGUAGE(FILE) \
|
||||
fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
|
||||
lang_identify(), version_string)
|
||||
#else
|
||||
#define ASM_FILE_END(FILE) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
|
||||
IDENT_ASM_OP, version_string); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* Allow #sccs in preprocessor. */
|
||||
#define SCCS_DIRECTIVE
|
||||
|
||||
/* Output #ident as a .ident. */
|
||||
#define ASM_OUTPUT_IDENT(FILE, NAME) \
|
||||
fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
|
||||
|
||||
/* This is how to allocate empty space in some section. The .zero
|
||||
pseudo-op is used for this on most svr4 assemblers. */
|
||||
|
||||
#define SKIP_ASM_OP ".zero"
|
||||
|
||||
#undef ASM_OUTPUT_SKIP
|
||||
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
|
||||
fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
|
||||
|
||||
/* Output the label which precedes a jumptable. Note that for all svr4
|
||||
systems where we actually generate jumptables (which is to say every
|
||||
svr4 target except i386, where we use casesi instead) we put the jump-
|
||||
tables into the .rodata section and since other stuff could have been
|
||||
put into the .rodata section prior to any given jumptable, we have to
|
||||
make sure that the location counter for the .rodata section gets pro-
|
||||
perly re-aligned prior to the actual beginning of the jump table. */
|
||||
|
||||
#define ALIGN_ASM_OP ".align"
|
||||
|
||||
#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
|
||||
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
|
||||
ASM_OUTPUT_ALIGN ((FILE), 2);
|
||||
#endif
|
||||
|
||||
#undef ASM_OUTPUT_CASE_LABEL
|
||||
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
|
||||
do { \
|
||||
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
|
||||
ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
|
||||
} while (0)
|
||||
|
||||
/* The standard SVR4 assembler seems to require that certain builtin
|
||||
library routines (e.g. .udiv) be explicitly declared as .globl
|
||||
in each assembly file where they are referenced. */
|
||||
|
||||
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
|
||||
ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized external linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#define COMMON_ASM_OP ".comm"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
|
||||
} while (0)
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized internal linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
if ((SIZE) <= g_switch_value) \
|
||||
sbss_section(); \
|
||||
else \
|
||||
bss_section(); \
|
||||
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
putc (',', FILE); \
|
||||
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
|
||||
putc ('\n', FILE); \
|
||||
if (!flag_inhibit_size_directive) \
|
||||
{ \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, ",%d\n", (SIZE)); \
|
||||
} \
|
||||
ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT)); \
|
||||
ASM_OUTPUT_LABEL(FILE, NAME); \
|
||||
ASM_OUTPUT_SKIP((FILE), (SIZE)); \
|
||||
} while (0)
|
||||
|
||||
/* This is the pseudo-op used to generate a 64-bit word of data with a
|
||||
specific value in some section. */
|
||||
|
||||
#define INT_ASM_OP ".quad"
|
||||
|
||||
/* Biggest alignment supported by the object file format of this
|
||||
machine. Use this macro to limit the alignment which can be
|
||||
specified using the `__attribute__ ((aligned (N)))' construct. If
|
||||
not defined, the default value is `BIGGEST_ALIGNMENT'.
|
||||
|
||||
This value is really 2^63. Since gcc figures the alignment in bits,
|
||||
we could only potentially get to 2^60 on suitible hosts. Due to other
|
||||
considerations in varasm, we must restrict this to what fits in an int. */
|
||||
|
||||
#define MAX_OFILE_ALIGNMENT \
|
||||
(1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
|
||||
|
||||
/* This is the pseudo-op used to generate a contiguous sequence of byte
|
||||
values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
|
||||
AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
|
||||
|
||||
#undef ASCII_DATA_ASM_OP
|
||||
#define ASCII_DATA_ASM_OP ".ascii"
|
||||
|
||||
/* Support const sections and the ctors and dtors sections for g++.
|
||||
Note that there appears to be two different ways to support const
|
||||
sections at the moment. You can either #define the symbol
|
||||
READONLY_DATA_SECTION (giving it some code which switches to the
|
||||
readonly data section) or else you can #define the symbols
|
||||
EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
|
||||
SELECT_RTX_SECTION. We do both here just to be on the safe side. */
|
||||
|
||||
#define USE_CONST_SECTION 1
|
||||
|
||||
#define CONST_SECTION_ASM_OP ".section\t.rodata"
|
||||
|
||||
/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
|
||||
|
||||
Note that we want to give these sections the SHF_WRITE attribute
|
||||
because these sections will actually contain data (i.e. tables of
|
||||
addresses of functions in the current root executable or shared library
|
||||
file) and, in the case of a shared library, the relocatable addresses
|
||||
will have to be properly resolved/relocated (and then written into) by
|
||||
the dynamic linker when it actually attaches the given shared library
|
||||
to the executing process. (Note that on SVR4, you may wish to use the
|
||||
`-z text' option to the ELF linker, when building a shared library, as
|
||||
an additional check that you are doing everything right. But if you do
|
||||
use the `-z text' option when building a shared library, you will get
|
||||
errors unless the .ctors and .dtors sections are marked as writable
|
||||
via the SHF_WRITE attribute.) */
|
||||
|
||||
#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
|
||||
#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
|
||||
|
||||
/* Handle the small data sections. */
|
||||
#define BSS_SECTION_ASM_OP ".section\t.bss"
|
||||
#define SBSS_SECTION_ASM_OP ".section\t.sbss,\"aw\""
|
||||
#define SDATA_SECTION_ASM_OP ".section\t.sdata,\"aw\""
|
||||
|
||||
/* On svr4, we *do* have support for the .init and .fini sections, and we
|
||||
can put stuff in there to be executed before and after `main'. We let
|
||||
crtstuff.c and other files know this by defining the following symbols.
|
||||
The definitions say how to change sections to the .init and .fini
|
||||
sections. This is the same for all known svr4 assemblers. */
|
||||
|
||||
#define INIT_SECTION_ASM_OP ".section\t.init"
|
||||
#define FINI_SECTION_ASM_OP ".section\t.fini"
|
||||
|
||||
/* A default list of other sections which we might be "in" at any given
|
||||
time. For targets that use additional sections (e.g. .tdesc) you
|
||||
should override this definition in the target-specific file which
|
||||
includes this file. */
|
||||
|
||||
#undef EXTRA_SECTIONS
|
||||
#define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_sbss, in_sdata
|
||||
|
||||
/* A default list of extra section function definitions. For targets
|
||||
that use additional sections (e.g. .tdesc) you should override this
|
||||
definition in the target-specific file which includes this file. */
|
||||
|
||||
#undef EXTRA_SECTION_FUNCTIONS
|
||||
#define EXTRA_SECTION_FUNCTIONS \
|
||||
CONST_SECTION_FUNCTION \
|
||||
SECTION_FUNCTION_TEMPLATE(ctors_section, in_ctors, CTORS_SECTION_ASM_OP) \
|
||||
SECTION_FUNCTION_TEMPLATE(dtors_section, in_dtors, DTORS_SECTION_ASM_OP) \
|
||||
SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
|
||||
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
|
||||
|
||||
#undef READONLY_DATA_SECTION
|
||||
#define READONLY_DATA_SECTION() const_section ()
|
||||
|
||||
extern void text_section ();
|
||||
|
||||
#define CONST_SECTION_FUNCTION \
|
||||
void \
|
||||
const_section () \
|
||||
{ \
|
||||
if (!USE_CONST_SECTION) \
|
||||
text_section(); \
|
||||
else if (in_section != in_const) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
|
||||
in_section = in_const; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
|
||||
void FN () \
|
||||
{ \
|
||||
if (in_section != ENUM) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", OP); \
|
||||
in_section = ENUM; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/* Switch into a generic section.
|
||||
This is currently only used to support section attributes.
|
||||
|
||||
We make the section read-only and executable for a function decl,
|
||||
read-only for a const data decl, and writable for a non-const data decl. */
|
||||
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
|
||||
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
|
||||
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
|
||||
(DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
|
||||
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors. */
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
ctors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement or statements to switch to the appropriate
|
||||
section for output of DECL. DECL is either a `VAR_DECL' node
|
||||
or a constant of some sort. RELOC indicates whether forming
|
||||
the initial value of DECL requires link-time relocations. */
|
||||
|
||||
#define SELECT_SECTION(DECL,RELOC) \
|
||||
{ \
|
||||
if (TREE_CODE (DECL) == STRING_CST) \
|
||||
{ \
|
||||
if (! flag_writable_strings) \
|
||||
const_section (); \
|
||||
else \
|
||||
data_section (); \
|
||||
} \
|
||||
else if (TREE_CODE (DECL) == VAR_DECL) \
|
||||
{ \
|
||||
if ((flag_pic && RELOC) \
|
||||
|| !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
|
||||
|| !DECL_INITIAL (DECL) \
|
||||
|| (DECL_INITIAL (DECL) != error_mark_node \
|
||||
&& !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
|
||||
{ \
|
||||
int size = int_size_in_bytes (TREE_TYPE (DECL)); \
|
||||
if (size >= 0 && size <= g_switch_value) \
|
||||
sdata_section (); \
|
||||
else \
|
||||
data_section (); \
|
||||
} \
|
||||
else \
|
||||
const_section (); \
|
||||
} \
|
||||
else \
|
||||
const_section (); \
|
||||
}
|
||||
|
||||
/* A C statement or statements to switch to the appropriate
|
||||
section for output of RTX in mode MODE. RTX is some kind
|
||||
of constant in RTL. The argument MODE is redundant except
|
||||
in the case of a `const_int' rtx. Currently, these always
|
||||
go into the const section. */
|
||||
|
||||
#undef SELECT_RTX_SECTION
|
||||
#define SELECT_RTX_SECTION(MODE,RTX) const_section()
|
||||
|
||||
/* Define the strings used for the special svr4 .type and .size directives.
|
||||
These strings generally do not vary from one system running svr4 to
|
||||
another, but if a given system (e.g. m88k running svr) needs to use
|
||||
different pseudo-op names for these, they may be overridden in the
|
||||
file which includes this one. */
|
||||
|
||||
#define TYPE_ASM_OP ".type"
|
||||
#define SIZE_ASM_OP ".size"
|
||||
|
||||
/* This is how we tell the assembler that a symbol is weak. */
|
||||
|
||||
#define ASM_WEAKEN_LABEL(FILE,NAME) \
|
||||
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); } while (0)
|
||||
|
||||
/* This is how we tell the assembler that two symbols have the same value. */
|
||||
|
||||
#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
|
||||
do { assemble_name(FILE, NAME1); \
|
||||
fputs(" = ", FILE); \
|
||||
assemble_name(FILE, NAME2); \
|
||||
fputc('\n', FILE); } while (0)
|
||||
|
||||
/* The following macro defines the format used to output the second
|
||||
operand of the .type assembler directive. Different svr4 assemblers
|
||||
expect various different forms for this operand. The one given here
|
||||
is just a default. You may need to override it in your machine-
|
||||
specific tm.h file (depending upon the particulars of your assembler). */
|
||||
|
||||
#define TYPE_OPERAND_FMT "@%s"
|
||||
|
||||
/* Write the extra assembler code needed to declare a function's result.
|
||||
Most svr4 assemblers don't require any special declaration of the
|
||||
result value, but there are exceptions. */
|
||||
|
||||
#ifndef ASM_DECLARE_RESULT
|
||||
#define ASM_DECLARE_RESULT(FILE, RESULT)
|
||||
#endif
|
||||
|
||||
/* These macros generate the special .type and .size directives which
|
||||
are used to set the corresponding fields of the linker symbol table
|
||||
entries in an ELF object file under SVR4. These macros also output
|
||||
the starting labels for the relevant functions/objects. */
|
||||
|
||||
/* Write the extra assembler code needed to declare an object properly. */
|
||||
|
||||
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
|
||||
do { \
|
||||
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
putc (',', FILE); \
|
||||
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
|
||||
putc ('\n', FILE); \
|
||||
size_directive_output = 0; \
|
||||
if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
|
||||
} \
|
||||
ASM_OUTPUT_LABEL(FILE, NAME); \
|
||||
} while (0)
|
||||
|
||||
/* Output the size directive for a decl in rest_of_decl_compilation
|
||||
in the case where we did not do so before the initializer.
|
||||
Once we find the error_mark_node, we know that the value of
|
||||
size_directive_output was set
|
||||
by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
|
||||
|
||||
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
|
||||
do { \
|
||||
char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
|
||||
if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
|
||||
&& ! AT_END && TOP_LEVEL \
|
||||
&& DECL_INITIAL (DECL) == error_mark_node \
|
||||
&& !size_directive_output) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, name); \
|
||||
putc (',', FILE); \
|
||||
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
|
||||
int_size_in_bytes (TREE_TYPE (DECL))); \
|
||||
putc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
|
||||
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
|
||||
corresponds to a particular byte value [0..255]. For any
|
||||
given byte value, if the value in the corresponding table
|
||||
position is zero, the given character can be output directly.
|
||||
If the table value is 1, the byte must be output as a \ooo
|
||||
octal escape. If the tables value is anything else, then the
|
||||
byte value should be output as a \ followed by the value
|
||||
in the table. Note that we can use standard UN*X escape
|
||||
sequences for many control characters, but we don't use
|
||||
\a to represent BEL because some svr4 assemblers (e.g. on
|
||||
the i386) don't know about that. Also, we don't use \v
|
||||
since some versions of gas, such as 2.2 did not accept it. */
|
||||
|
||||
#define ESCAPES \
|
||||
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
|
||||
|
||||
/* Some svr4 assemblers have a limit on the number of characters which
|
||||
can appear in the operand of a .string directive. If your assembler
|
||||
has such a limitation, you should define STRING_LIMIT to reflect that
|
||||
limit. Note that at least some svr4 assemblers have a limit on the
|
||||
actual number of bytes in the double-quoted string, and that they
|
||||
count each character in an escape sequence as one byte. Thus, an
|
||||
escape sequence like \377 would count as four bytes.
|
||||
|
||||
If your target assembler doesn't support the .string directive, you
|
||||
should define this to zero. */
|
||||
|
||||
#define STRING_LIMIT ((unsigned) 256)
|
||||
#define STRING_ASM_OP ".string"
|
||||
|
||||
/* GAS is the only Alpha/ELF assembler. */
|
||||
#undef TARGET_GAS
|
||||
#define TARGET_GAS (1)
|
||||
|
||||
/* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
|
||||
(even more) magical crtbegin.o file which provides part of the
|
||||
support for getting C++ file-scope static object constructed before
|
||||
entering `main'.
|
||||
|
||||
Don't bother seeing crtstuff.c -- there is absolutely no hope of
|
||||
getting that file to understand multiple GPs. GNU Libc provides a
|
||||
hand-coded version that is used on Linux; it could be copied here
|
||||
if there is ever a need. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC \
|
||||
"%{!shared: \
|
||||
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
|
||||
crti.o%s crtbegin.o%s"
|
||||
|
||||
/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
|
||||
magical crtend.o file which provides part of the support for
|
||||
getting C++ file-scope static object constructed before entering
|
||||
`main', followed by a normal ELF "finalizer" file, `crtn.o'. */
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC \
|
||||
"crtend.o%s crtn.o%s"
|
||||
|
||||
/* We support #pragma. */
|
||||
#define HANDLE_SYSV_PRAGMA
|
||||
@@ -1,327 +0,0 @@
|
||||
/* This file is CYGNUS LOCAL. */
|
||||
|
||||
/* DEC Alpha division and remainder support.
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
In addition to the permissions in the GNU General Public License, the
|
||||
Free Software Foundation gives you unlimited permission to link the
|
||||
compiled version of this file with other programs, and to distribute
|
||||
those programs without any restriction coming from the use of this
|
||||
file. (The General Public License restrictions do apply in other
|
||||
respects; for example, they cover modification of the file, and
|
||||
distribution when not linked into another program.)
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with other files,
|
||||
some of which are compiled with GCC, to produce an executable,
|
||||
this library does not by itself cause the resulting executable
|
||||
to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* This had to be written in assembler because the division functions
|
||||
use a non-standard calling convention.
|
||||
|
||||
This file provides an implementation of __divqu, __divq, __divlu,
|
||||
__divl, __remqu, __remq, __remlu and __reml. CPP macros control
|
||||
the exact operation.
|
||||
|
||||
Operation performed: $27 := $24 o $25, clobber $28, return address to
|
||||
caller in $23, where o one of the operations.
|
||||
|
||||
The following macros need to be defined:
|
||||
|
||||
SIZE, the number of bits, 32 or 64.
|
||||
|
||||
TYPE, either UNSIGNED or SIGNED
|
||||
|
||||
OPERATION, either DIVISION or REMAINDER
|
||||
|
||||
SPECIAL_CALLING_CONVENTION, 0 or 1. It is useful for debugging to
|
||||
define this to 0. That removes the `__' prefix to make the function
|
||||
name not collide with the existing libc.a names, and uses the
|
||||
standard Alpha procedure calling convention.
|
||||
*/
|
||||
|
||||
#ifndef SPECIAL_CALLING_CONVENTION
|
||||
#define SPECIAL_CALLING_CONVENTION 1
|
||||
#endif
|
||||
|
||||
#ifdef L_divl
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __divl
|
||||
#else
|
||||
#define FUNCTION_NAME divl
|
||||
#endif
|
||||
#define SIZE 32
|
||||
#define TYPE SIGNED
|
||||
#define OPERATION DIVISION
|
||||
#endif
|
||||
|
||||
#ifdef L_divlu
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __divlu
|
||||
#else
|
||||
#define FUNCTION_NAME divlu
|
||||
#endif
|
||||
#define SIZE 32
|
||||
#define TYPE UNSIGNED
|
||||
#define OPERATION DIVISION
|
||||
#endif
|
||||
|
||||
#ifdef L_divq
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __divq
|
||||
#else
|
||||
#define FUNCTION_NAME divq
|
||||
#endif
|
||||
#define SIZE 64
|
||||
#define TYPE SIGNED
|
||||
#define OPERATION DIVISION
|
||||
#endif
|
||||
|
||||
#ifdef L_divqu
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __divqu
|
||||
#else
|
||||
#define FUNCTION_NAME divqu
|
||||
#endif
|
||||
#define SIZE 64
|
||||
#define TYPE UNSIGNED
|
||||
#define OPERATION DIVISION
|
||||
#endif
|
||||
|
||||
#ifdef L_reml
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __reml
|
||||
#else
|
||||
#define FUNCTION_NAME reml
|
||||
#endif
|
||||
#define SIZE 32
|
||||
#define TYPE SIGNED
|
||||
#define OPERATION REMAINDER
|
||||
#endif
|
||||
|
||||
#ifdef L_remlu
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __remlu
|
||||
#else
|
||||
#define FUNCTION_NAME remlu
|
||||
#endif
|
||||
#define SIZE 32
|
||||
#define TYPE UNSIGNED
|
||||
#define OPERATION REMAINDER
|
||||
#endif
|
||||
|
||||
#ifdef L_remq
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __remq
|
||||
#else
|
||||
#define FUNCTION_NAME remq
|
||||
#endif
|
||||
#define SIZE 64
|
||||
#define TYPE SIGNED
|
||||
#define OPERATION REMAINDER
|
||||
#endif
|
||||
|
||||
#ifdef L_remqu
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define FUNCTION_NAME __remqu
|
||||
#else
|
||||
#define FUNCTION_NAME remqu
|
||||
#endif
|
||||
#define SIZE 64
|
||||
#define TYPE UNSIGNED
|
||||
#define OPERATION REMAINDER
|
||||
#endif
|
||||
|
||||
#define tmp0 $3
|
||||
#define tmp1 $28
|
||||
#define cnt $1
|
||||
#define result_sign $2
|
||||
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#define N $24
|
||||
#define D $25
|
||||
#define Q RETREG
|
||||
#define RETREG $27
|
||||
#else
|
||||
#define N $16
|
||||
#define D $17
|
||||
#define Q RETREG
|
||||
#define RETREG $0
|
||||
#endif
|
||||
|
||||
/* Misc symbols to make alpha assembler easier to read. */
|
||||
#define zero $31
|
||||
#define sp $30
|
||||
|
||||
/* Symbols to make interface nicer. */
|
||||
#define UNSIGNED 0
|
||||
#define SIGNED 1
|
||||
#define DIVISION 0
|
||||
#define REMAINDER 1
|
||||
|
||||
.set noreorder
|
||||
.set noat
|
||||
.text
|
||||
.align 3
|
||||
.globl FUNCTION_NAME
|
||||
.ent FUNCTION_NAME
|
||||
FUNCTION_NAME:
|
||||
|
||||
.frame $30,0,$26,0
|
||||
.prologue 0
|
||||
|
||||
/* Under the special calling convention, we have to preserve all register
|
||||
values but $23 and $28. */
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
lda sp,-64(sp)
|
||||
#if OPERATION == DIVISION
|
||||
stq N,0(sp)
|
||||
#endif
|
||||
stq D,8(sp)
|
||||
stq cnt,16(sp)
|
||||
stq result_sign,24(sp)
|
||||
stq tmp0,32(sp)
|
||||
#endif
|
||||
|
||||
/* If we are computing the remainder, move N to the register that is used
|
||||
for the return value, and redefine what register is used for N. */
|
||||
#if OPERATION == REMAINDER
|
||||
bis N,N,RETREG
|
||||
#undef N
|
||||
#define N RETREG
|
||||
#endif
|
||||
|
||||
/* Perform conversion from 32 bit types to 64 bit types. */
|
||||
#if SIZE == 32
|
||||
#if TYPE == SIGNED
|
||||
/* If there are problems with the signed case, add these instructions.
|
||||
The caller should already have done this.
|
||||
addl N,0,N # sign extend N
|
||||
addl D,0,D # sign extend D
|
||||
*/
|
||||
#else /* UNSIGNED */
|
||||
zap N,0xf0,N # zero extend N (caller required to sign extend)
|
||||
zap D,0xf0,D # zero extend D
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Check for divide by zero. */
|
||||
bne D,$34
|
||||
lda $16,-2(zero)
|
||||
call_pal 0xaa
|
||||
$34:
|
||||
|
||||
#if TYPE == SIGNED
|
||||
#if OPERATION == DIVISION
|
||||
xor N,D,result_sign
|
||||
#else
|
||||
bis N,N,result_sign
|
||||
#endif
|
||||
/* Get the absolute values of N and D. */
|
||||
subq zero,N,tmp0
|
||||
cmovlt N,tmp0,N
|
||||
subq zero,D,tmp0
|
||||
cmovlt D,tmp0,D
|
||||
#endif
|
||||
|
||||
/* Compute CNT = ceil(log2(N)) - ceil(log2(D)). This is the number of
|
||||
divide iterations we will have to perform. Should you wish to optimize
|
||||
this, check a few bits at a time, preferably using zap/zapnot. Be
|
||||
careful though, this code runs fast fro the most common cases, when the
|
||||
quotient is small. */
|
||||
bge N,$35
|
||||
bis zero,1,cnt
|
||||
blt D,$40
|
||||
.align 3
|
||||
$39: addq D,D,D
|
||||
addl cnt,1,cnt
|
||||
bge D,$39
|
||||
br zero,$40
|
||||
$35: cmpult N,D,tmp0
|
||||
bis zero,zero,cnt
|
||||
bne tmp0,$42
|
||||
.align 3
|
||||
$44: addq D,D,D
|
||||
cmpult N,D,tmp0
|
||||
addl cnt,1,cnt
|
||||
beq tmp0,$44
|
||||
$42: srl D,1,D
|
||||
$40:
|
||||
subl cnt,1,cnt
|
||||
|
||||
|
||||
/* Actual divide. Could be optimized with unrolling. */
|
||||
#if OPERATION == DIVISION
|
||||
bis zero,zero,Q
|
||||
#endif
|
||||
blt cnt,$46
|
||||
.align 3
|
||||
$49: cmpule D,N,tmp1
|
||||
subq N,D,tmp0
|
||||
srl D,1,D
|
||||
subl cnt,1,cnt
|
||||
cmovne tmp1,tmp0,N
|
||||
#if OPERATION == DIVISION
|
||||
addq Q,Q,Q
|
||||
bis Q,tmp1,Q
|
||||
#endif
|
||||
bge cnt,$49
|
||||
$46:
|
||||
|
||||
|
||||
/* The result is now in RETREG. NOTE! It was written to RETREG using
|
||||
either N or Q as a synonym! */
|
||||
|
||||
|
||||
/* Change the sign of the result as needed. */
|
||||
#if TYPE == SIGNED
|
||||
subq zero,RETREG,tmp0
|
||||
cmovlt result_sign,tmp0,RETREG
|
||||
#endif
|
||||
|
||||
|
||||
/* Restore clobbered registers. */
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
#if OPERATION == DIVISION
|
||||
ldq N,0(sp)
|
||||
#endif
|
||||
ldq D,8(sp)
|
||||
ldq cnt,16(sp)
|
||||
ldq result_sign,24(sp)
|
||||
ldq tmp0,32(sp)
|
||||
|
||||
lda sp,64(sp)
|
||||
#endif
|
||||
|
||||
|
||||
/* Sign extend an *unsigned* 32 bit result, as required by the Alpha
|
||||
conventions. */
|
||||
#if TYPE == UNSIGNED && SIZE == 32
|
||||
/* This could be avoided by adding some CPP hair to the divide loop.
|
||||
It is probably not worth the added complexity. */
|
||||
addl RETREG,0,RETREG
|
||||
#endif
|
||||
|
||||
|
||||
#if SPECIAL_CALLING_CONVENTION
|
||||
ret zero,($23),1
|
||||
#else
|
||||
ret zero,($26),1
|
||||
#endif
|
||||
.end FUNCTION_NAME
|
||||
@@ -1,37 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler
|
||||
for Alpha Linux-based GNU systems using ECOFF.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Bob Manson.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ECOFF)");
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC "-D__ECOFF__"
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-G 8 %{O*:-O3} %{!O*:-O1}"
|
||||
|
||||
/* stabs get slurped by the assembler into a queer ecoff format. */
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
|
||||
/* We support #pragma. */
|
||||
#define HANDLE_SYSV_PRAGMA
|
||||
@@ -1,48 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler
|
||||
for Alpha Linux-based GNU systems using ELF.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ELF)");
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
|
||||
|
||||
#undef SUB_CPP_PREDEFINES
|
||||
#define SUB_CPP_PREDEFINES "-D__ELF__"
|
||||
|
||||
#ifdef USE_GNULIBC_1
|
||||
#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
#else
|
||||
#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
#endif
|
||||
|
||||
#ifndef USE_GNULIBC_1
|
||||
#undef DEFAULT_VTABLE_THUNKS
|
||||
#define DEFAULT_VTABLE_THUNKS 1
|
||||
#endif
|
||||
|
||||
#ifndef USE_GNULIBC_1
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC \
|
||||
"%{shared:-lc}%{!shared:%{pthread:-lpthread }%{profile:-lc_p}%{!profile:-lc}} "
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler,
|
||||
for Alpha Linux-based GNU systems.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES \
|
||||
"-Dlinux -Dunix -Asystem(linux) -D_LONGLONG -D__alpha__ " \
|
||||
SUB_CPP_PREDEFINES
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
|
||||
|
||||
/* Generate calls to memcpy, etc., not bcopy, etc. */
|
||||
#define TARGET_MEM_FUNCTIONS 1
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fputs ("\tlda $28,_mcount\n\tjsr $28,($28),_mcount\n", (FILE))
|
||||
|
||||
/* Show that we need a GP when profiling. */
|
||||
#define TARGET_PROFILING_NEEDS_GP 1
|
||||
|
||||
/* Don't care about faults in the prologue. */
|
||||
#undef TARGET_CAN_FAULT_IN_PROLOGUE
|
||||
#define TARGET_CAN_FAULT_IN_PROLOGUE 1
|
||||
@@ -1,32 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler
|
||||
for Alpha NetBSD systems using ELF.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha NetBSD/ELF)");
|
||||
|
||||
#undef SUB_CPP_PREDEFINES
|
||||
#define SUB_CPP_PREDEFINES "-D__ELF__"
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
|
||||
|
||||
#define ELF_DYNAMIC_LINKER "/usr/libexec/ld.elf_so"
|
||||
@@ -1,39 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler,
|
||||
for Alpha NetBSD systems.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D_LONGLONG -Dnetbsd -Dunix " SUB_CPP_PREDEFINES
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
|
||||
|
||||
/* Generate calls to memcpy, etc., not bcopy, etc. */
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fputs ("\tlda $28,_mcount\n\tjsr $28,($28),_mcount\n", (FILE))
|
||||
|
||||
/* Show that we need a GP when profiling. */
|
||||
#define TARGET_PROFILING_NEEDS_GP
|
||||
@@ -1,127 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As of OSF 4.0, as can subtract adjacent labels. */
|
||||
|
||||
#undef TARGET_AS_CAN_SUBTRACT_LABELS
|
||||
#define TARGET_AS_CAN_SUBTRACT_LABELS 1
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#define CPP_PREDEFINES "\
|
||||
-Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \
|
||||
-D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4)"
|
||||
|
||||
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
|
||||
|
||||
#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"
|
||||
|
||||
/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
|
||||
optimizing, -O1 if we are not. Pass -shared, -non_shared or
|
||||
-call_shared as appropriate. Also pass -pg. */
|
||||
#define LINK_SPEC \
|
||||
"-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
|
||||
%{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
|
||||
%{rpath*}"
|
||||
|
||||
#define STARTFILE_SPEC \
|
||||
"%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
|
||||
|
||||
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
|
||||
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
fprintf (FILE, "\t.set noat\n"); \
|
||||
if (TARGET_SUPPORT_ARCH) \
|
||||
fprintf (FILE, "\t.arch %s\n", \
|
||||
alpha_cpu == PROCESSOR_EV6 ? "ev6" \
|
||||
: (alpha_cpu == PROCESSOR_EV5 \
|
||||
? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
|
||||
: "ev4")); \
|
||||
\
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
|
||||
/* No point in running CPP on our assembler output. */
|
||||
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
|
||||
/* Don't pass -g to GNU as, because some versions don't accept this option. */
|
||||
#define ASM_SPEC "%{malpha-as:-g} -nocpp %{pg}"
|
||||
#else
|
||||
/* In OSF/1 v3.2c, the assembler by default does not output file names which
|
||||
causes mips-tfile to fail. Passing -g to the assembler fixes this problem.
|
||||
??? Strictly speaking, we need -g only if the user specifies -g. Passing
|
||||
it always means that we get slightly larger than necessary object files
|
||||
if the user does not specify -g. If we don't pass -g, then mips-tfile
|
||||
will need to be fixed to work in this case. Pass -O0 since some
|
||||
optimization are broken and don't help us anyway. */
|
||||
#define ASM_SPEC "%{!mgas:-g} -nocpp %{pg} -O0"
|
||||
#endif
|
||||
|
||||
/* Specify to run a post-processor, mips-tfile after the assembler
|
||||
has run to stuff the ecoff debug information into the object file.
|
||||
This is needed because the Alpha assembler provides no way
|
||||
of specifying such information in the assembly file. */
|
||||
|
||||
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
|
||||
|
||||
#define ASM_FINAL_SPEC "\
|
||||
%{malpha-as: %{!mno-mips-tfile: \
|
||||
\n mips-tfile %{v*: -v} \
|
||||
%{K: -I %b.o~} \
|
||||
%{!K: %{save-temps: -I %b.o~}} \
|
||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||
%{.s:%i} %{!.s:%g.s}}}"
|
||||
|
||||
#else
|
||||
#define ASM_FINAL_SPEC "\
|
||||
%{!mgas: %{!mno-mips-tfile: \
|
||||
\n mips-tfile %{v*: -v} \
|
||||
%{K: -I %b.o~} \
|
||||
%{!K: %{save-temps: -I %b.o~}} \
|
||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||
%{.s:%i} %{!.s:%g.s}}}"
|
||||
|
||||
#endif
|
||||
|
||||
/* Indicate that we have a stamp.h to use. */
|
||||
#ifndef CROSS_COMPILE
|
||||
#define HAVE_STAMP_H 1
|
||||
#endif
|
||||
|
||||
/* Attempt to turn on access permissions for the stack. */
|
||||
|
||||
#define TRANSFER_FROM_TRAMPOLINE \
|
||||
void \
|
||||
__enable_execute_stack (addr) \
|
||||
void *addr; \
|
||||
{ \
|
||||
long size = getpagesize (); \
|
||||
long mask = ~(size-1); \
|
||||
char *page = (char *) (((long) addr) & mask); \
|
||||
char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
|
||||
\
|
||||
/* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
|
||||
if (mprotect (page, end - page, 7) < 0) \
|
||||
perror ("mprotect of trampoline code"); \
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha.
|
||||
Copyright (C) 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@nyu.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* In OSF 1.2, there is a linker bug that prevents use of -O3 to
|
||||
the linker. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"-G 8 -O1 %{static:-non_shared} %{rpath*} \
|
||||
%{!static:%{shared:-shared} %{!shared:-call_shared}} %{taso}"
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "short unsigned int"
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 16
|
||||
@@ -1,30 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha, osf[23].
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* In OSF 2 or 3, linking with -lprof1 doesn't require -lpdf. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} %{a:-lprof2} -lc"
|
||||
|
||||
/* As of OSF 3.2, as still can't subtract adjacent labels. */
|
||||
|
||||
#undef TARGET_AS_CAN_SUBTRACT_LABELS
|
||||
#define TARGET_AS_CAN_SUBTRACT_LABELS 0
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# Effectively disable the crtbegin/end rules using crtstuff.c
|
||||
T = disable
|
||||
|
||||
# Assemble startup files.
|
||||
crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm
|
||||
|
||||
crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm
|
||||
@@ -1,5 +0,0 @@
|
||||
# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
|
||||
# C library can handle them.
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
LIBGCC1_TEST =
|
||||
@@ -1,6 +0,0 @@
|
||||
# Do not build libgcc1.
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
|
||||
LIB2FUNCS_EXTRA = tramp.s
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/* A replacement for Digital Unix's <va_list.h>. */
|
||||
|
||||
#include <va-alpha.h>
|
||||
|
||||
#if !defined(_VA_LIST) && !defined(_HIDDEN_VA_LIST)
|
||||
#define _VA_LIST
|
||||
typedef __gnuc_va_list va_list;
|
||||
|
||||
#elif defined(_HIDDEN_VA_LIST) && !defined(_HIDDEN_VA_LIST_DONE)
|
||||
#define _HIDDEN_VA_LIST_DONE
|
||||
typedef __gnuc_va_list __va_list;
|
||||
|
||||
#elif defined(_HIDDEN_VA_LIST) && defined(_VA_LIST)
|
||||
#undef _HIDDEN_VA_LIST
|
||||
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
;# New Alpha OpenVMS trampoline
|
||||
;#
|
||||
.set noreorder
|
||||
.set volatile
|
||||
.set noat
|
||||
.file 1 "tramp.s"
|
||||
.text
|
||||
.align 3
|
||||
.globl __tramp
|
||||
.ent __tramp
|
||||
__tramp..en:
|
||||
|
||||
.link
|
||||
.align 3
|
||||
__tramp:
|
||||
.pdesc __tramp..en,null
|
||||
.text
|
||||
ldq $1,24($27)
|
||||
ldq $27,16($27)
|
||||
ldq $28,8($27)
|
||||
jmp $31,($28),0
|
||||
.end __tramp
|
||||
@@ -1,510 +0,0 @@
|
||||
/* Output variables, constants and external declarations, for GNU compiler.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define OPEN_VMS 1
|
||||
|
||||
/* This enables certain macros in alpha.h, which will make an indirect
|
||||
reference to an external symbol an invalid address. This needs to be
|
||||
defined before we include alpha.h, since it determines which macros
|
||||
are used for GO_IF_*. */
|
||||
|
||||
#define NO_EXTERNAL_INDIRECT_ADDRESS
|
||||
|
||||
#include "alpha/alpha.h"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES \
|
||||
"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem(vms)"
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC "\
|
||||
%{mfloat-ieee:-D__IEEE_FLOAT} \
|
||||
%{mfloat-vax:-D__G_FLOAT} \
|
||||
%{!mfloat-vax:-D__IEEE_FLOAT}"
|
||||
|
||||
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
|
||||
|
||||
#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"
|
||||
|
||||
/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
|
||||
optimizing, -O1 if we are not. Pass -shared, -non_shared or
|
||||
-call_shared as appropriate. Also pass -pg. */
|
||||
#define LINK_SPEC \
|
||||
"-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
|
||||
%{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
|
||||
%{rpath*}"
|
||||
|
||||
/* We allow $'s in identifiers unless -ansi is used .. */
|
||||
|
||||
#define DOLLARS_IN_IDENTIFIERS 2
|
||||
|
||||
/* These match the definitions used in DECCRTL, the VMS C run-time library
|
||||
|
||||
#define SIZE_TYPE "unsigned int"
|
||||
#define PTRDIFF_TYPE "int"
|
||||
*/
|
||||
|
||||
/* Use memcpy for structure copying, and so forth. */
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
/* By default, allow $ to be part of an identifier. */
|
||||
#define DOLLARS_IN_IDENTIFIERS 2
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS)
|
||||
#undef TARGET_OPEN_VMS
|
||||
#define TARGET_OPEN_VMS 1
|
||||
|
||||
#undef TARGET_NAME
|
||||
#define TARGET_NAME "OpenVMS/Alpha"
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
|
||||
|
||||
/* The structure return address arrives as an "argument" on VMS. */
|
||||
#undef STRUCT_VALUE_REGNUM
|
||||
#define STRUCT_VALUE 0
|
||||
#undef PCC_STATIC_STRUCT_RETURN
|
||||
|
||||
/* no floating emulation. */
|
||||
#undef REAL_ARITHMETIC
|
||||
|
||||
/* "long" is 32 bits. */
|
||||
#undef LONG_TYPE_SIZE
|
||||
#define LONG_TYPE_SIZE 32
|
||||
|
||||
/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
|
||||
#undef POINTER_SIZE
|
||||
#define POINTER_SIZE 32
|
||||
#define POINTERS_EXTEND_UNSIGNED 0
|
||||
|
||||
#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
|
||||
|
||||
#undef FIXED_REGISTERS
|
||||
#define FIXED_REGISTERS \
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
|
||||
|
||||
#undef CALL_USED_REGISTERS
|
||||
#define CALL_USED_REGISTERS \
|
||||
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
|
||||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
|
||||
|
||||
#undef HARD_FRAME_POINTER_REGNUM
|
||||
#define HARD_FRAME_POINTER_REGNUM 29
|
||||
|
||||
#undef CAN_ELIMINATE
|
||||
#define CAN_ELIMINATE(FROM, TO) \
|
||||
((TO) != STACK_POINTER_REGNUM || ! alpha_using_fp ())
|
||||
|
||||
#undef INITIAL_ELIMINATION_OFFSET
|
||||
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
||||
{ if ((FROM) == FRAME_POINTER_REGNUM) \
|
||||
(OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \
|
||||
else if ((FROM) == ARG_POINTER_REGNUM) \
|
||||
(OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \
|
||||
+ get_frame_size () \
|
||||
+ current_function_pretend_args_size) \
|
||||
- current_function_pretend_args_size); \
|
||||
if ((TO) == STACK_POINTER_REGNUM) \
|
||||
(OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \
|
||||
}
|
||||
|
||||
/* Define a data type for recording info about an argument list
|
||||
during the scan of that argument list. This data type should
|
||||
hold all necessary information about the function itself
|
||||
and about the args processed so far, enough to enable macros
|
||||
such as FUNCTION_ARG to determine where the next arg should go.
|
||||
|
||||
On Alpha/VMS, this is a structure that contains the number of
|
||||
arguments and, for each argument, the datatype of that argument.
|
||||
|
||||
The number of arguments is a number of words of arguments scanned so far.
|
||||
Thus 6 or more means all following args should go on the stack. */
|
||||
|
||||
enum avms_arg_type {I64, FF, FD, FG, FS, FT};
|
||||
typedef struct {char num_args; enum avms_arg_type atypes[6];} avms_arg_info;
|
||||
|
||||
#undef CUMULATIVE_ARGS
|
||||
#define CUMULATIVE_ARGS avms_arg_info
|
||||
|
||||
/* Initialize a variable CUM of type CUMULATIVE_ARGS
|
||||
for a call to a function whose data type is FNTYPE.
|
||||
For a library call, FNTYPE is 0. */
|
||||
|
||||
#undef INIT_CUMULATIVE_ARGS
|
||||
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
|
||||
(CUM).num_args = 0; \
|
||||
(CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
|
||||
(CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;
|
||||
|
||||
/* Update the data in CUM to advance over an argument
|
||||
of mode MODE and data type TYPE.
|
||||
(TYPE is null for libcalls where that information may not be available.) */
|
||||
|
||||
extern enum avms_arg_type alpha_arg_type ();
|
||||
|
||||
/* Determine where to put an argument to a function.
|
||||
Value is zero to push the argument on the stack,
|
||||
or a hard register in which to store the argument.
|
||||
|
||||
MODE is the argument's machine mode (or VOIDmode for no more args).
|
||||
TYPE is the data type of the argument (as a tree).
|
||||
This is null for libcalls where that information may
|
||||
not be available.
|
||||
CUM is a variable of type CUMULATIVE_ARGS which gives info about
|
||||
the preceding args and about the function being called.
|
||||
NAMED is nonzero if this argument is a named parameter
|
||||
(otherwise it is an extra parameter matching an ellipsis).
|
||||
|
||||
On Alpha the first 6 words of args are normally in registers
|
||||
and the rest are pushed. */
|
||||
|
||||
extern struct rtx_def *alpha_arg_info_reg_val ();
|
||||
#undef FUNCTION_ARG
|
||||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
||||
((MODE) == VOIDmode ? alpha_arg_info_reg_val (CUM) \
|
||||
: ((CUM.num_args) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \
|
||||
? gen_rtx(REG, (MODE), \
|
||||
((CUM).num_args + 16 \
|
||||
+ ((TARGET_FPREGS \
|
||||
&& (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \
|
||||
|| GET_MODE_CLASS (MODE) == MODE_FLOAT)) \
|
||||
* 32))) \
|
||||
: 0))
|
||||
|
||||
#undef FUNCTION_ARG_ADVANCE
|
||||
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
||||
if (MUST_PASS_IN_STACK (MODE, TYPE)) \
|
||||
(CUM).num_args += 6; \
|
||||
else \
|
||||
{ \
|
||||
if ((CUM).num_args < 6) \
|
||||
(CUM).atypes[(CUM).num_args] = alpha_arg_type (MODE); \
|
||||
\
|
||||
(CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \
|
||||
}
|
||||
|
||||
/* For an arg passed partly in registers and partly in memory,
|
||||
this is the number of registers used.
|
||||
For args passed entirely in registers or entirely in memory, zero. */
|
||||
|
||||
#undef FUNCTION_ARG_PARTIAL_NREGS
|
||||
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
|
||||
((CUM).num_args < 6 && 6 < (CUM).num_args \
|
||||
+ ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
|
||||
? 6 - (CUM).num_args : 0)
|
||||
|
||||
/* Perform any needed actions needed for a function that is receiving a
|
||||
variable number of arguments.
|
||||
|
||||
CUM is as for INIT_CUMULATIVE_ARGS.
|
||||
|
||||
MODE and TYPE are the mode and type of the current parameter.
|
||||
|
||||
PRETEND_SIZE is a variable that should be set to the amount of stack
|
||||
that must be pushed by the prolog to pretend that our caller pushed
|
||||
it.
|
||||
|
||||
Normally, this macro will push all remaining incoming registers on the
|
||||
stack and set PRETEND_SIZE to the length of the registers pushed.
|
||||
|
||||
For VMS, we allocate space for all 6 arg registers plus a count.
|
||||
|
||||
However, if NO registers need to be saved, don't allocate any space.
|
||||
This is not only because we won't need the space, but because AP includes
|
||||
the current_pretend_args_size and we don't want to mess up any
|
||||
ap-relative addresses already made. */
|
||||
|
||||
#undef SETUP_INCOMING_VARARGS
|
||||
#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
|
||||
{ if ((CUM).num_args < 6) \
|
||||
{ \
|
||||
if (! (NO_RTL)) \
|
||||
{ \
|
||||
emit_move_insn (gen_rtx (REG, DImode, 1), \
|
||||
virtual_incoming_args_rtx); \
|
||||
emit_insn (gen_arg_home ()); \
|
||||
} \
|
||||
\
|
||||
PRETEND_SIZE = 7 * UNITS_PER_WORD; \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
|
||||
#undef ASM_OUTPUT_FLOAT
|
||||
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
|
||||
{ \
|
||||
if (REAL_VALUE_ISINF (VALUE) \
|
||||
|| REAL_VALUE_ISNAN (VALUE) \
|
||||
|| REAL_VALUE_MINUS_ZERO (VALUE)) \
|
||||
{ \
|
||||
long t; \
|
||||
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
|
||||
fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
char str[30]; \
|
||||
REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
|
||||
fprintf (FILE, "\t.%c_floating %s\n", (TARGET_FLOAT_VAX)?'f':'s', str); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LINK_SECTION_ASM_OP ".link"
|
||||
#define READONLY_SECTION_ASM_OP ".rdata"
|
||||
#define LITERALS_SECTION_ASM_OP ".literals"
|
||||
#define CTORS_SECTION_ASM_OP ".ctors"
|
||||
#define DTORS_SECTION_ASM_OP ".dtors"
|
||||
|
||||
#undef EXTRA_SECTIONS
|
||||
#define EXTRA_SECTIONS in_link, in_rdata, in_literals, in_ctors, in_dtors
|
||||
|
||||
#undef EXTRA_SECTION_FUNCTIONS
|
||||
#define EXTRA_SECTION_FUNCTIONS \
|
||||
void \
|
||||
readonly_section () \
|
||||
{ \
|
||||
if (in_section != in_rdata) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
|
||||
in_section = in_rdata; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
link_section () \
|
||||
{ \
|
||||
if (in_section != in_link) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", LINK_SECTION_ASM_OP); \
|
||||
in_section = in_link; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
literals_section () \
|
||||
{ \
|
||||
if (in_section != in_literals) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", LITERALS_SECTION_ASM_OP); \
|
||||
in_section = in_literals; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
ctors_section () \
|
||||
{ \
|
||||
if (in_section != in_ctors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
|
||||
in_section = in_ctors; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
dtors_section () \
|
||||
{ \
|
||||
if (in_section != in_dtors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
|
||||
in_section = in_dtors; \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort ()
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_VEC_ELT
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
|
||||
fprintf (FILE, "\t.quad $L%d\n", (VALUE))
|
||||
|
||||
#undef READONLY_DATA_SECTION
|
||||
#define READONLY_DATA_SECTION readonly_section
|
||||
|
||||
#define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
|
||||
|
||||
#undef CASE_VECTOR_MODE
|
||||
#define CASE_VECTOR_MODE DImode
|
||||
#undef CASE_VECTOR_PC_RELATIVE
|
||||
|
||||
#undef ASM_OUTPUT_CASE_LABEL
|
||||
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
|
||||
{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized external linkage data object. */
|
||||
|
||||
#define COMMON_ASM_OP ".comm"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
|
||||
} while (0)
|
||||
|
||||
#define NO_MD_PROTOTYPES
|
||||
|
||||
/* Output assembler code for a block containing the constant parts
|
||||
of a trampoline, leaving space for the variable parts.
|
||||
|
||||
The trampoline should set the static chain pointer to value placed
|
||||
into the trampoline and should branch to the specified routine.
|
||||
Note that $27 has been set to the address of the trampoline, so we can
|
||||
use it for addressability of the two data items. Trampolines are always
|
||||
aligned to FUNCTION_BOUNDARY, which is 64 bits. */
|
||||
|
||||
#undef TRAMPOLINE_TEMPLATE
|
||||
#define TRAMPOLINE_TEMPLATE(FILE) \
|
||||
{ \
|
||||
fprintf (FILE, "\t.quad 0\n"); \
|
||||
fprintf (FILE, "\t.linkage __tramp\n"); \
|
||||
fprintf (FILE, "\t.quad 0\n"); \
|
||||
}
|
||||
|
||||
/* Length in units of the trampoline for entering a nested function. */
|
||||
|
||||
#undef TRAMPOLINE_SIZE
|
||||
#define TRAMPOLINE_SIZE 32
|
||||
|
||||
/* Emit RTL insns to initialize the variable parts of a trampoline.
|
||||
FNADDR is an RTX for the address of the function's pure code.
|
||||
CXT is an RTX for the static chain value for the function. */
|
||||
|
||||
#undef INITIALIZE_TRAMPOLINE
|
||||
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
||||
alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, -1)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors. */
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
ctors_section (); \
|
||||
fprintf (FILE, "\t.quad "); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtors_section (); \
|
||||
fprintf (FILE, "\t.quad "); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
|
||||
(vms_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
|
||||
extern int vms_valid_decl_attribute_p ();
|
||||
|
||||
#undef SDB_DEBUGGING_INFO
|
||||
#undef MIPS_DEBUGGING_INFO
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
fprintf (FILE, "\t.align %d\n", LOG);
|
||||
|
||||
#define UNALIGNED_SHORT_ASM_OP ".word"
|
||||
#define UNALIGNED_INT_ASM_OP ".long"
|
||||
#define UNALIGNED_DOUBLE_INT_ASM_OP ".quad"
|
||||
|
||||
#define ASM_OUTPUT_SECTION(FILE,SECTION) \
|
||||
(strcmp (SECTION, ".text") == 0) \
|
||||
? text_section () \
|
||||
: named_section (NULL_TREE, SECTION, 0), \
|
||||
ASM_OUTPUT_ALIGN (FILE, 0) \
|
||||
|
||||
#define ASM_OUTPUT_SECTION_NAME(FILE,DECL,NAME,RELOC) \
|
||||
do \
|
||||
{ \
|
||||
char *flags; \
|
||||
int ovr = 0; \
|
||||
if (DECL && DECL_MACHINE_ATTRIBUTES (DECL) \
|
||||
&& lookup_attribute \
|
||||
("overlaid", DECL_MACHINE_ATTRIBUTES (DECL))) \
|
||||
flags = ",OVR", ovr = 1; \
|
||||
else if (strncmp (NAME,".debug", 6) == 0) \
|
||||
flags = ",NOWRT"; \
|
||||
else \
|
||||
flags = ""; \
|
||||
fputc ('\n', (FILE)); \
|
||||
fprintf (FILE, ".section\t%s%s\n", NAME, flags); \
|
||||
if (ovr) \
|
||||
(NAME) = ""; \
|
||||
} while (0)
|
||||
|
||||
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
|
||||
do { literals_section(); \
|
||||
fprintf ((FILE), "\t"); \
|
||||
assemble_name (FILE, LABEL1); \
|
||||
fprintf (FILE, " = "); \
|
||||
assemble_name (FILE, LABEL2); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
#undef ASM_FORMAT_PRIVATE_NAME
|
||||
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
||||
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
|
||||
sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
|
||||
|
||||
/* ??? VMS uses different linkage. */
|
||||
#undef ASM_OUTPUT_MI_THUNK
|
||||
|
||||
#undef ASM_SPEC
|
||||
#undef ASM_FINAL_SPEC
|
||||
#undef LINK_SPEC
|
||||
#undef STARTFILE_SPEC
|
||||
#define ASM_SPEC "-nocpp %{pg}"
|
||||
#define LINK_SPEC "%{g3:-g3} %{g0:-g0} %{shared:-shared} %{v:-v}"
|
||||
|
||||
/* Define the names of the division and modulus functions. */
|
||||
#define DIVSI3_LIBCALL "OTS$DIV_I"
|
||||
#define DIVDI3_LIBCALL "OTS$DIV_L"
|
||||
#define UDIVSI3_LIBCALL "OTS$DIV_UI"
|
||||
#define UDIVDI3_LIBCALL "OTS$DIV_UL"
|
||||
#define MODSI3_LIBCALL "OTS$REM_I"
|
||||
#define MODDI3_LIBCALL "OTS$REM_L"
|
||||
#define UMODSI3_LIBCALL "OTS$REM_UI"
|
||||
#define UMODDI3_LIBCALL "OTS$REM_UL"
|
||||
|
||||
#define DIR_SEPARATOR ']'
|
||||
|
||||
#define PREFIX "GNU_ROOT:"
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler. Vxworks Alpha version.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file just exists to give specs for the Alpha running on VxWorks. */
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC "\
|
||||
%{mvxsim:-DCPU=SIMALPHADUNIX} \
|
||||
%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \
|
||||
%{posix: -D_POSIX_SOURCE}"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "\
|
||||
-D__vxworks -D__alpha_vxworks -Asystem(vxworks) \
|
||||
-Asystem(embedded) -D_LONGLONG"
|
||||
|
||||
/* VxWorks does all the library stuff itself. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC ""
|
||||
|
||||
/* VxWorks uses object files, not loadable images. make linker just
|
||||
combine objects. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-r"
|
||||
|
||||
/* VxWorks provides the functionality of crt0.o and friends itself. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC ""
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC ""
|
||||
@@ -1,129 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha
|
||||
running Windows/NT.
|
||||
Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS)
|
||||
|
||||
#undef TARGET_WINDOWS_NT
|
||||
#define TARGET_WINDOWS_NT 1
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC \
|
||||
-D_M_ALPHA -D_ALPHA_ -D_LONGLONG -D__unaligned= -D__stdcall= -Asystem(winnt)"
|
||||
|
||||
#undef ASM_SPEC
|
||||
#undef ASM_FINAL_SPEC
|
||||
#define ASM_SPEC "-nopp -nologo %{g:-Zi}"
|
||||
|
||||
/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
|
||||
#undef POINTER_SIZE
|
||||
#define POINTER_SIZE 32
|
||||
#define POINTERS_EXTEND_UNSIGNED 0
|
||||
|
||||
/* "long" is 32 bits. */
|
||||
#undef LONG_TYPE_SIZE
|
||||
#define LONG_TYPE_SIZE 32
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "short unsigned int"
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 16
|
||||
|
||||
/* We can't do any debugging. */
|
||||
#undef SDB_DEBUGGING_INFO
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
#undef MIPS_DEBUGGING_INFO
|
||||
|
||||
#include "winnt/win-nt.h"
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
fprintf (FILE, "\t.set noat\n"); \
|
||||
fprintf (FILE, "\t.globl\t__fltused\n"); \
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{mwindows:-subsystem windows -e _WinMainCRTStartup \
|
||||
USER32.LIB%s GDI32.LIB%s COMDLG32.LIB%s WINSPOOL.LIB%s} \
|
||||
%{!mwindows:-subsystem console -e _mainCRTStartup} \
|
||||
%{mcrtmt:LIBCMT.LIB%s KERNEL32.LIB%s} %{!mcrtmt:LIBC.LIB%s KERNEL32.LIB%s} \
|
||||
%{v}"
|
||||
|
||||
|
||||
/* Output assembler code for a block containing the constant parts
|
||||
of a trampoline, leaving space for the variable parts.
|
||||
|
||||
The trampoline should set the static chain pointer to value placed
|
||||
into the trampoline and should branch to the specified routine. */
|
||||
|
||||
#undef TRAMPOLINE_TEMPLATE
|
||||
#define TRAMPOLINE_TEMPLATE(FILE) \
|
||||
{ \
|
||||
fprintf (FILE, "\tbr $27,$LTRAMPP\n"); \
|
||||
fprintf (FILE, "$LTRAMPP:\n\tldl $1,12($27)\n"); \
|
||||
fprintf (FILE, "\tldl $27,16($27)\n"); \
|
||||
fprintf (FILE, "\tjmp $31,($27),0\n"); \
|
||||
fprintf (FILE, "\t.long 0,0\n"); \
|
||||
}
|
||||
|
||||
/* Length in units of the trampoline for entering a nested function. */
|
||||
|
||||
#undef TRAMPOLINE_SIZE
|
||||
#define TRAMPOLINE_SIZE 24
|
||||
|
||||
/* Emit RTL insns to initialize the variable parts of a trampoline.
|
||||
FNADDR is an RTX for the address of the function's pure code.
|
||||
CXT is an RTX for the static chain value for the function. */
|
||||
|
||||
#undef INITIALIZE_TRAMPOLINE
|
||||
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
||||
alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 20, 12)
|
||||
|
||||
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
|
||||
Used for C++ multiple inheritance. */
|
||||
|
||||
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
|
||||
do { \
|
||||
char *op, *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
|
||||
int reg; \
|
||||
\
|
||||
/* Mark end of prologue. */ \
|
||||
output_end_prologue (FILE); \
|
||||
\
|
||||
/* Rely on the assembler to macro expand a large delta. */ \
|
||||
reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
|
||||
fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
|
||||
\
|
||||
op = "jsr"; \
|
||||
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
|
||||
op = "br"; \
|
||||
fprintf (FILE, "\t%s $31,", op); \
|
||||
assemble_name (FILE, fn_name); \
|
||||
fputc ('\n', FILE); \
|
||||
} while (0)
|
||||
@@ -1,2 +0,0 @@
|
||||
CLIB=-lmld
|
||||
EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
|
||||
@@ -1,76 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for DEC Alpha.
|
||||
Copyright (C) 1990, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 64
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* #define HOST_WORDS_BIG_ENDIAN */
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* If compiled with GNU C, use the builtin alloca. */
|
||||
#ifndef alloca
|
||||
#if defined(__GNUC__) && !defined(USE_C_ALLOCA)
|
||||
#define alloca __builtin_alloca
|
||||
#else
|
||||
#if !defined(_WIN32) && !defined(USE_C_ALLOCA) && !defined(OPEN_VMS)
|
||||
#include <alloca.h>
|
||||
#else
|
||||
extern void *alloca ();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* The host compiler has problems with enum bitfields since it makes
|
||||
them signed so we can't fit all our codes in. */
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define ONLY_INT_FIELDS
|
||||
#endif
|
||||
|
||||
/* Declare some functions needed for this machine. We don't want to
|
||||
include these in the sources since other machines might define them
|
||||
differently. */
|
||||
|
||||
extern void *malloc (), *realloc (), *calloc ();
|
||||
|
||||
#ifndef inhibit_libc
|
||||
#include "string.h"
|
||||
#endif
|
||||
|
||||
/* OSF/1 is POSIX.1 compliant. */
|
||||
|
||||
#define POSIX
|
||||
@@ -1,2 +0,0 @@
|
||||
#undef USE_BFD
|
||||
#define USE_BFD
|
||||
@@ -1,93 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for openVMS/Alpha.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Klaus Kaempf (kkaempf@progis.de).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* If compiling with DECC, need to fix problem with <stdio.h>
|
||||
which defines a macro called FILE_TYPE that breaks "tree.h".
|
||||
Fortunately it uses #ifndef to suppress multiple inclusions.
|
||||
Three possible cases:
|
||||
1) <stdio.h> has already been included -- ours will be no-op;
|
||||
2) <stdio.h> will be included after us -- "theirs" will be no-op;
|
||||
3) <stdio.h> isn't needed -- including it here shouldn't hurt.
|
||||
In all three cases, the problem macro will be removed here. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef __DECC
|
||||
#undef FILE_TYPE
|
||||
#endif
|
||||
|
||||
#undef HOST_BITS_PER_LONG
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
|
||||
#define HOST_WIDE_INT long long
|
||||
#define HOST_BITS_PER_WIDE_INT 64
|
||||
|
||||
#undef SUCCESS_EXIT_CODE
|
||||
#define SUCCESS_EXIT_CODE 1
|
||||
#undef FATAL_EXIT_CODE
|
||||
#define FATAL_EXIT_CODE (44 | 0x10000000) /* Abort, and no DCL message. */
|
||||
|
||||
/* A couple of conditionals for execution machine are controlled here. */
|
||||
#ifndef VMS
|
||||
#define VMS
|
||||
#endif
|
||||
|
||||
#define GCC_INCLUDE_DIR ""
|
||||
/* Specify the list of include file directories. */
|
||||
#define INCLUDE_DEFAULTS \
|
||||
{ \
|
||||
{ "GNU_GXX_INCLUDE:", "G++", 1, 1 }, \
|
||||
{ "GNU_CC_INCLUDE:", "GCC", 0, 0 }, \
|
||||
{ ".", 0, 0, 1 }, \
|
||||
{ 0, 0, 0, 0 } \
|
||||
}
|
||||
|
||||
/* Define a local equivalent (sort of) for unlink */
|
||||
#define unlink remove
|
||||
|
||||
#define NEED_ATEXIT
|
||||
#define HAVE_VPRINTF
|
||||
#define HAVE_PUTENV
|
||||
#define HAVE_STRERROR
|
||||
#define HAVE_ATOLL
|
||||
|
||||
#define NO_SYS_PARAMS_H /* Don't have <sys/params.h> */
|
||||
#define USE_C_ALLOCA /* Using alloca.c */
|
||||
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_CPP_STRINGIFY 1
|
||||
|
||||
#if __STDC__
|
||||
extern void *alloca (size_t);
|
||||
#else
|
||||
extern char *alloca (unsigned int);
|
||||
#endif
|
||||
|
||||
#define OBJECT_SUFFIX ".obj"
|
||||
#define EXECUTABLE_SUFFIX ".exe"
|
||||
@@ -1,34 +0,0 @@
|
||||
/* Configuration for GNU compiler for an Alpha running Windows NT 3.x.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Douglas B. Rupp (drupp@cs.washington.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef HOST_BITS_PER_LONG
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
|
||||
#undef POSIX
|
||||
|
||||
#define access _access
|
||||
#define close _close
|
||||
#define mktemp _mktemp
|
||||
#define open _open
|
||||
#define read _read
|
||||
#define write _write
|
||||
|
||||
#undef HAS_INIT_SECTION
|
||||
@@ -1,88 +0,0 @@
|
||||
/* aoutos.h -- operating system specific defines to be used when
|
||||
targeting GCC for some system that uses a.out file format.
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
|
||||
Written by Ron Guilmette (rfg@netcom.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* To use this file, make up a file with a name like:
|
||||
|
||||
?????aout.h
|
||||
|
||||
where ????? is replaced by the name of the basic hardware that you
|
||||
are targeting for. Then, in the file ?????aout.h, put something
|
||||
like:
|
||||
|
||||
#include "?????.h"
|
||||
#include "aoutos.h"
|
||||
|
||||
followed by any really system-specific defines (or overrides of
|
||||
defines) which you find that you need. Now, modify the configure
|
||||
or configure.in script to properly use the new ?????aout.h file
|
||||
when configuring for the system. */
|
||||
|
||||
/* Define a symbol indicating that we are using aoutos.h. */
|
||||
#define USING_AOUTOS_H
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors.
|
||||
If using GNU LD, tell it that this is part of the static destructor set.
|
||||
This code works for any machine provided you use GNU as/ld.
|
||||
If not using GNU LD, rely on a "collect" program to look for names defined
|
||||
in the particular form we choose as global constructor function names. */
|
||||
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___CTOR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___DTOR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Likewise for entries we want to record for garbage collection.
|
||||
Garbage collection is still under development. */
|
||||
|
||||
#define ASM_OUTPUT_GC_ENTRY(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___PTR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,157 +0,0 @@
|
||||
/* .init/.fini section handling + C++ global constructor/destructor handling.
|
||||
This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
|
||||
|
||||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this file with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* Declare a pointer to void function type. */
|
||||
typedef void (*func_ptr) (void);
|
||||
|
||||
#ifdef CRT_INIT
|
||||
|
||||
/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
|
||||
to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
|
||||
__DTOR_END__ } per root executable and also one set of these symbols
|
||||
per shared library. So in any given whole process image, we may have
|
||||
multiple definitions of each of these symbols. In order to prevent
|
||||
these definitions from conflicting with one another, and in order to
|
||||
ensure that the proper lists are used for the initialization/finalization
|
||||
of each individual shared library (respectively), we give these symbols
|
||||
only internal (i.e. `static') linkage, and we also make it a point to
|
||||
refer to only the __CTOR_END__ symbol in crtfini.o and the __DTOR_LIST__
|
||||
symbol in crtinit.o, where they are defined. */
|
||||
|
||||
static func_ptr __CTOR_LIST__[1] __attribute__ ((section (".ctors")))
|
||||
= { (func_ptr) (-1) };
|
||||
|
||||
static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors")))
|
||||
= { (func_ptr) (-1) };
|
||||
|
||||
/* Run all the global destructors on exit from the program. */
|
||||
|
||||
/* Some systems place the number of pointers in the first word of the
|
||||
table. On SVR4 however, that word is -1. In all cases, the table is
|
||||
null-terminated. On SVR4, we start from the beginning of the list and
|
||||
invoke each per-compilation-unit destructor routine in order
|
||||
until we find that null.
|
||||
|
||||
Note that this function MUST be static. There will be one of these
|
||||
functions in each root executable and one in each shared library, but
|
||||
although they all have the same code, each one is unique in that it
|
||||
refers to one particular associated `__DTOR_LIST__' which belongs to the
|
||||
same particular root executable or shared library file. */
|
||||
|
||||
static void __do_global_dtors ()
|
||||
asm ("__do_global_dtors") __attribute__ ((section (".text")));
|
||||
|
||||
static void
|
||||
__do_global_dtors ()
|
||||
{
|
||||
func_ptr *p;
|
||||
for (p = __DTOR_LIST__ + 1; *p; p++)
|
||||
(*p) ();
|
||||
}
|
||||
|
||||
/* .init section start.
|
||||
This must appear at the start of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .init\n
|
||||
.global init\n
|
||||
.word 0\n
|
||||
init:\n
|
||||
st blink,[sp,4]\n
|
||||
st fp,[sp]\n
|
||||
mov fp,sp\n
|
||||
sub sp,sp,16\n
|
||||
");
|
||||
|
||||
/* .fini section start.
|
||||
This must appear at the start of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .fini\n
|
||||
.global fini\n
|
||||
.word 0\n
|
||||
fini:\n
|
||||
st blink,[sp,4]\n
|
||||
st fp,[sp]\n
|
||||
mov fp,sp\n
|
||||
sub sp,sp,16\n
|
||||
bl.nd __do_global_dtors
|
||||
");
|
||||
|
||||
#endif /* CRT_INIT */
|
||||
|
||||
#ifdef CRT_FINI
|
||||
|
||||
/* Put a word containing zero at the end of each of our two lists of function
|
||||
addresses. Note that the words defined here go into the .ctors and .dtors
|
||||
sections of the crtend.o file, and since that file is always linked in
|
||||
last, these words naturally end up at the very ends of the two lists
|
||||
contained in these two sections. */
|
||||
|
||||
static func_ptr __CTOR_END__[1] __attribute__ ((section (".ctors")))
|
||||
= { (func_ptr) 0 };
|
||||
|
||||
static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors")))
|
||||
= { (func_ptr) 0 };
|
||||
|
||||
/* Run all global constructors for the program.
|
||||
Note that they are run in reverse order. */
|
||||
|
||||
static void __do_global_ctors ()
|
||||
asm ("__do_global_ctors") __attribute__ ((section (".text")));
|
||||
|
||||
static void
|
||||
__do_global_ctors ()
|
||||
{
|
||||
func_ptr *p;
|
||||
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
|
||||
(*p) ();
|
||||
}
|
||||
|
||||
/* .init section end.
|
||||
This must live at the end of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .init\n
|
||||
bl.nd __do_global_ctors
|
||||
ld blink,[fp,4]\n
|
||||
j.d blink\n
|
||||
ld.a fp,[sp,16]\n
|
||||
");
|
||||
|
||||
/* .fini section end.
|
||||
This must live at the end of the .fini section. */
|
||||
|
||||
asm ("
|
||||
.section .fini\n
|
||||
ld blink,[fp,4]\n
|
||||
j.d blink\n
|
||||
ld.a fp,[sp,16]\n
|
||||
");
|
||||
|
||||
#endif /* CRT_FINI */
|
||||
@@ -1,273 +0,0 @@
|
||||
; libgcc1 routines for ARC cpu.
|
||||
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
In addition to the permissions in the GNU General Public License, the
|
||||
Free Software Foundation gives you unlimited permission to link the
|
||||
compiled version of this file with other programs, and to distribute
|
||||
those programs without any restriction coming from the use of this
|
||||
file. (The General Public License restrictions do apply in other
|
||||
respects; for example, they cover modification of the file, and
|
||||
distribution when not linked into another program.)
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with other files,
|
||||
some of which are compiled with GCC, to produce an executable,
|
||||
this library does not by itself cause the resulting executable
|
||||
to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifdef L_mulsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___mulsi3
|
||||
___mulsi3:
|
||||
|
||||
/* This the simple version.
|
||||
|
||||
while (a)
|
||||
{
|
||||
if (a & 1)
|
||||
r += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
*/
|
||||
mov r2,0 ; Accumulate result here.
|
||||
.Lloop:
|
||||
sub.f 0,r0,0 ; while (a)
|
||||
nop
|
||||
beq.nd .Ldone
|
||||
and.f 0,r0,1 ; if (a & 1)
|
||||
add.nz r2,r2,r1 ; r += b
|
||||
lsr r0,r0 ; a >>= 1
|
||||
b.d .Lloop
|
||||
lsl r1,r1 ; b <<= 1
|
||||
.Ldone:
|
||||
j.d blink
|
||||
mov r0,r2
|
||||
#endif
|
||||
|
||||
#endif /* L_mulsi3 */
|
||||
|
||||
#ifdef L_umulsidi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___umulsidi3
|
||||
___umulsidi3:
|
||||
|
||||
/* This the simple version.
|
||||
|
||||
while (a)
|
||||
{
|
||||
if (a & 1)
|
||||
r += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
*/
|
||||
mov r2,0 ; Top part of b.
|
||||
mov r3,0 ; Accumulate result here.
|
||||
mov r4,0
|
||||
.Lloop:
|
||||
sub.f 0,r0,0 ; while (a)
|
||||
nop
|
||||
beq.nd .Ldone
|
||||
and.f 0,r0,1 ; if (a & 1)
|
||||
add.nz r4,r4,r1 ; r += b
|
||||
adc.nz r3,r3,r2
|
||||
lsr r0,r0 ; a >>= 1
|
||||
lsl.f r1,r1 ; b <<= 1
|
||||
b.d .Lloop
|
||||
rlc r2,r2
|
||||
.Ldone:
|
||||
#ifdef __big_endian__
|
||||
mov r1,r4
|
||||
j.d blink
|
||||
mov r0,r3
|
||||
#else
|
||||
mov r0,r4
|
||||
j.d blink
|
||||
mov r1,r3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* L_umulsidi3 */
|
||||
|
||||
#ifdef L_divmod_tools
|
||||
|
||||
; Utilities used by all routines.
|
||||
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
; inputs: r0 = numerator, r1 = denominator
|
||||
; outputs: positive r0/r1,
|
||||
; r6.bit1 = sign of numerator, r6.bit0 = sign of result
|
||||
|
||||
.global ___divnorm
|
||||
___divnorm:
|
||||
mov r6,0 ; keep sign in r6
|
||||
sub.f 0,r0,0 ; is numerator -ve?
|
||||
sub.lt r0,0,r0 ; negate numerator
|
||||
mov.lt r6,3 ; sign is -ve
|
||||
sub.f 0,r1,0 ; is denominator -ve?
|
||||
sub.lt r1,0,r1 ; negate denominator
|
||||
xor.lt r6,r6,1 ; toggle sign
|
||||
j.nd blink
|
||||
|
||||
/*
|
||||
unsigned long
|
||||
udivmodsi4(int modwanted, unsigned long num, unsigned long den)
|
||||
{
|
||||
unsigned long bit = 1;
|
||||
unsigned long res = 0;
|
||||
|
||||
while (den < num && bit && !(den & (1L<<31)))
|
||||
{
|
||||
den <<=1;
|
||||
bit <<=1;
|
||||
}
|
||||
while (bit)
|
||||
{
|
||||
if (num >= den)
|
||||
{
|
||||
num -= den;
|
||||
res |= bit;
|
||||
}
|
||||
bit >>=1;
|
||||
den >>=1;
|
||||
}
|
||||
if (modwanted) return num;
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
|
||||
; inputs: r0 = numerator, r1 = denominator
|
||||
; outputs: r0 = quotient, r1 = remainder, r2/r3 trashed
|
||||
|
||||
.global ___udivmodsi4
|
||||
___udivmodsi4:
|
||||
mov r2,1 ; bit = 1
|
||||
mov r3,0 ; res = 0
|
||||
.Lloop1:
|
||||
sub.f 0,r1,r0 ; while (den < num
|
||||
nop
|
||||
bnc.nd .Lloop2
|
||||
sub.f 0,r2,0 ; && bit
|
||||
nop
|
||||
bz.nd .Lloop2
|
||||
lsl.f 0,r1 ; && !(den & (1<<31))
|
||||
nop
|
||||
bc.nd .Lloop2
|
||||
lsl r1,r1 ; den <<= 1
|
||||
b.d .Lloop1
|
||||
lsl r2,r2 ; bit <<= 1
|
||||
.Lloop2:
|
||||
sub.f 0,r2,0 ; while (bit)
|
||||
nop
|
||||
bz.nd .Ldivmodend
|
||||
sub.f 0,r0,r1 ; if (num >= den)
|
||||
nop
|
||||
bc.nd .Lshiftdown
|
||||
sub r0,r0,r1 ; num -= den
|
||||
or r3,r3,r2 ; res |= bit
|
||||
.Lshiftdown:
|
||||
lsr r2,r2 ; bit >>= 1
|
||||
b.d .Lloop2
|
||||
lsr r1,r1 ; den >>= 1
|
||||
.Ldivmodend:
|
||||
mov r1,r0 ; r1 = mod
|
||||
j.d blink
|
||||
mov r0,r3 ; r0 = res
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef L_udivsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___udivsi3
|
||||
___udivsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___udivmodsi4
|
||||
j.nd r7
|
||||
#endif
|
||||
|
||||
#endif /* L_udivsi3 */
|
||||
|
||||
#ifdef L_divsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___divsi3
|
||||
___divsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___divnorm
|
||||
bl.nd ___udivmodsi4
|
||||
and.f 0,r6,1
|
||||
sub.nz r0,0,r0 ; cannot go in delay slot, has limm value
|
||||
j.nd r7
|
||||
#endif
|
||||
|
||||
#endif /* L_divsi3 */
|
||||
|
||||
#ifdef L_umodsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___umodsi3
|
||||
___umodsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___udivmodsi4
|
||||
j.d r7
|
||||
mov r0,r1
|
||||
#endif
|
||||
|
||||
#endif /* L_umodsi3 */
|
||||
|
||||
#ifdef L_modsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___modsi3
|
||||
___modsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___divnorm
|
||||
bl.nd ___udivmodsi4
|
||||
and.f 0,r6,2
|
||||
sub.nz r1,0,r1
|
||||
j.d r7
|
||||
mov r0,r1
|
||||
#endif
|
||||
|
||||
#endif /* L_modsi3 */
|
||||
@@ -1,72 +0,0 @@
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = arc/lib1funcs.asm
|
||||
LIB1ASMFUNCS = _mulsi3 _umulsidi3 _udivsi3 _divsi3 _umodsi3 _modsi3 _divmod_tools
|
||||
|
||||
# We need libgcc routines to be mangled according to which cpu they
|
||||
# were compiled for.
|
||||
# ??? -mmangle-cpu passed by default for now.
|
||||
#LIBGCC2_CFLAGS = -g1 -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -mmangle-cpu
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#ifndef __big_endian__' > dp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
|
||||
echo '#endif' >> dp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#ifndef __big_endian__' >> fp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
|
||||
echo '#endif' >> fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
# .init/.fini section routines
|
||||
|
||||
x-crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
|
||||
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
|
||||
-DCRT_INIT -finhibit-size-directive -fno-inline-functions \
|
||||
-g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtinit.o
|
||||
|
||||
x-crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
|
||||
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
|
||||
-DCRT_FINI -finhibit-size-directive -fno-inline-functions \
|
||||
-g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtfini.o
|
||||
|
||||
MULTILIB_OPTIONS = EB
|
||||
MULTILIB_DIRNAMES = be
|
||||
|
||||
# We need our own versions to build multiple copies of crt*.o.
|
||||
# ??? Use new support in Makefile.
|
||||
|
||||
LIBGCC = stmp-multilib-arc
|
||||
INSTALL_LIBGCC = install-multilib-arc
|
||||
|
||||
stmp-multilib-arc: stmp-multilib
|
||||
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
|
||||
dir=`echo $$i | sed -e 's/;.*$$//'`; \
|
||||
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
|
||||
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" \
|
||||
HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
|
||||
GCC_CFLAGS="$(GCC_CFLAGS) $${flags}" \
|
||||
INCLUDES="$(INCLUDES)" CRTSTUFF_T_CFLAGS=$(CRTSTUFF_T_CFLAGS) \
|
||||
dir="$${dir}" x-crtinit.o x-crtfini.o; \
|
||||
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
|
||||
done
|
||||
touch stmp-multilib-arc
|
||||
|
||||
install-multilib-arc: install-multilib
|
||||
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
|
||||
dir=`echo $$i | sed -e 's/;.*$$//'`; \
|
||||
rm -f $(libsubdir)/$${dir}/crtinit.o; \
|
||||
$(INSTALL_DATA) $${dir}/crtinit.o $(libsubdir)/$${dir}/crtinit.o; \
|
||||
chmod a-x $(libsubdir)/$${dir}/crtinit.o; \
|
||||
rm -f $(libsubdir)/$${dir}/crtfini.o; \
|
||||
$(INSTALL_DATA) $${dir}/crtfini.o $(libsubdir)/$${dir}/crtfini.o; \
|
||||
chmod a-x $(libsubdir)/$${dir}/crtfini.o; \
|
||||
done
|
||||
@@ -1,47 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for the ARC processor.
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Doubles are stored in memory with the high order word first. This
|
||||
matters when cross-compiling. */
|
||||
#define HOST_WORDS_BIG_ENDIAN 1
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* If compiled with Sun CC, the use of alloca requires this #include. */
|
||||
#ifndef __GNUC__
|
||||
#include "alloca.h"
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = c4x/libgcc.S
|
||||
LIB1ASMFUNCS = _divqf3 _divqi3 _udivqi3 _umodqi3 _modqi3 _mulqi3 \
|
||||
_mulhf3 _divhf3 _unsfltconst _unsfltcompare \
|
||||
_mulhi3 _umulhi3_high _smulhi3_high _divhi3 _modhi3 _umodhi3 _udivhi3 \
|
||||
_fix_truncqfhi2 _ufix_truncqfhi2 _floathiqf2 _ufloathiqf2 \
|
||||
_floathihf2 _ufloathihf2 _fix_trunchfhi2 _ufix_trunchfhi2 _ffs
|
||||
|
||||
# We do not have DF or DI types (or SF and SI for that matter),
|
||||
# so fake out the libgcc2 compilation.
|
||||
LIBGCC2_CFLAGS = -O2 -Dexit=unused_exit $(GCC_CFLAGS) $(LIBGCC2_INCLUDES) -DDF=HF -DDI=HI -DSF=QF -DSI=QI -Dinhibit_libc
|
||||
|
||||
MULTILIB_OPTIONS = m30 msmall mmemparm
|
||||
MULTILIB_DIRNAMES = c3x small mem
|
||||
MULTILIB_MATCHES = m30=mcpu?30 m30=mcpu?31 m30=mcpu?32 m30=m31 m30=m32
|
||||
MULTILIB_EXCEPTIONS =
|
||||
MULTILIB_EXTRA_OPTS =
|
||||
LIBGCC = stmp-multilib
|
||||
INSTALL_LIBGCC = install-multilib
|
||||
|
||||
# Don't make libgcc1-test since require crt0.o
|
||||
LIBGCC1_TEST =
|
||||
@@ -1,21 +0,0 @@
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 32
|
||||
#define HOST_BITS_PER_SHORT 32
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
#define HOST_WORDS_BIG_ENDIAN
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
@@ -1,508 +0,0 @@
|
||||
/* Subroutines for insn-output.c for Clipper
|
||||
Copyright (C) 1987, 1988, 1991, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Holger Teutsch (holger@hotbso.rhein-main.de)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include "rtl.h"
|
||||
#include "regs.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "real.h"
|
||||
#include "insn-config.h"
|
||||
#include "conditions.h"
|
||||
#include "insn-flags.h"
|
||||
#include "output.h"
|
||||
#include "insn-attr.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "expr.h"
|
||||
#include "flags.h"
|
||||
#include "machmode.h"
|
||||
|
||||
extern char regs_ever_live[];
|
||||
|
||||
extern int frame_pointer_needed;
|
||||
|
||||
static int frame_size;
|
||||
|
||||
/*
|
||||
* compute size of a clipper stack frame where 'lsize' is the required
|
||||
* space for local variables.
|
||||
*/
|
||||
|
||||
int
|
||||
clipper_frame_size (lsize)
|
||||
int lsize;
|
||||
{
|
||||
int i,size; /* total size of frame */
|
||||
int save_size;
|
||||
save_size = 0; /* compute size for reg saves */
|
||||
|
||||
for (i = 16; i < 32; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
save_size += 8;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
save_size += 4;
|
||||
|
||||
size = lsize + save_size;
|
||||
|
||||
size = (size + 7) & ~7; /* align to 64 Bit */
|
||||
return size;
|
||||
}
|
||||
|
||||
/*
|
||||
* prologue and epilogue output
|
||||
* function is entered with pc pushed, i.e. stack is 32 bit aligned
|
||||
*
|
||||
* current_function_args_size == 0 means that the current function's args
|
||||
* are passed totally in registers i.e fp is not used as ap.
|
||||
* If frame_size is also 0 the current function does not push anything and
|
||||
* can run with misaligned stack -> subq $4,sp / add $4,sp on entry and exit
|
||||
* can be omitted.
|
||||
*
|
||||
*/
|
||||
void
|
||||
output_function_prologue (file, lsize)
|
||||
FILE *file;
|
||||
int lsize; /* size for locals */
|
||||
{
|
||||
int i, offset;
|
||||
int size;
|
||||
|
||||
frame_size = size = clipper_frame_size (lsize);
|
||||
|
||||
if (frame_pointer_needed)
|
||||
{
|
||||
fputs ("\tpushw fp,sp\n", file);
|
||||
fputs ("\tmovw sp,fp\n", file);
|
||||
}
|
||||
else if (size != 0 || current_function_args_size != 0)
|
||||
{
|
||||
size += 4; /* keep stack aligned */
|
||||
frame_size = size; /* must push data or access args */
|
||||
}
|
||||
|
||||
if (size)
|
||||
{
|
||||
if (size < 16)
|
||||
fprintf (file, "\tsubq $%d,sp\n", size);
|
||||
else
|
||||
fprintf (file, "\tsubi $%d,sp\n", size);
|
||||
|
||||
/* register save slots are relative to sp, because we have small positive
|
||||
displacements and this works whether we have a frame pointer or not */
|
||||
|
||||
offset = 0;
|
||||
for (i = 16; i < 32; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
if (offset == 0)
|
||||
fprintf (file, "\tstord f%d,(sp)\n", i-16);
|
||||
else
|
||||
fprintf (file, "\tstord f%d,%d(sp)\n", i-16, offset);
|
||||
offset += 8;
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
if (offset == 0)
|
||||
fprintf (file, "\tstorw r%d,(sp)\n", i);
|
||||
else
|
||||
fprintf (file, "\tstorw r%d,%d(sp)\n", i, offset);
|
||||
offset += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
output_function_epilogue (file, size)
|
||||
FILE *file;
|
||||
int size; /* ignored */
|
||||
{
|
||||
int i, offset;
|
||||
|
||||
if (frame_pointer_needed)
|
||||
{
|
||||
offset = -frame_size;
|
||||
|
||||
for (i = 16; i < 32; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
fprintf (file, "\tloadd %d(fp),f%d\n", offset, i-16);
|
||||
offset += 8;
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
fprintf (file, "\tloadw %d(fp),r%d\n", offset, i);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
fputs ("\tmovw fp,sp\n\tpopw sp,fp\n\tret sp\n",
|
||||
file);
|
||||
}
|
||||
|
||||
else /* no frame pointer */
|
||||
{
|
||||
offset = 0;
|
||||
|
||||
for (i = 16; i < 32; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
if (offset == 0)
|
||||
fprintf (file, "\tloadd (sp),f%d\n", i-16);
|
||||
else
|
||||
fprintf (file, "\tloadd %d(sp),f%d\n", offset, i-16);
|
||||
offset += 8;
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
if (regs_ever_live[i] && !call_used_regs[i])
|
||||
{
|
||||
if (offset == 0)
|
||||
fprintf (file, "\tloadw (sp),r%d\n", i);
|
||||
else
|
||||
fprintf (file, "\tloadw %d(sp),r%d\n", offset, i);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
if (frame_size > 0)
|
||||
{
|
||||
if (frame_size < 16)
|
||||
fprintf (file, "\taddq $%d,sp\n", frame_size);
|
||||
else
|
||||
fprintf (file, "\taddi $%d,sp\n", frame_size);
|
||||
}
|
||||
|
||||
fputs ("\tret sp\n", file);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* blockmove
|
||||
*
|
||||
* clipper_movstr ()
|
||||
*/
|
||||
void
|
||||
clipper_movstr (operands)
|
||||
rtx *operands;
|
||||
{
|
||||
rtx dst,src,cnt,tmp,top,bottom,xops[3];
|
||||
int align;
|
||||
int fixed;
|
||||
|
||||
extern FILE *asm_out_file;
|
||||
|
||||
dst = operands[0];
|
||||
src = operands[1];
|
||||
/* don't change this operands[2]; gcc 2.3.3 doesn't honor clobber note */
|
||||
align = INTVAL (operands[3]);
|
||||
tmp = operands[4];
|
||||
cnt = operands[5];
|
||||
|
||||
if (GET_CODE (operands[2]) == CONST_INT) /* fixed size move */
|
||||
{
|
||||
if ((fixed = INTVAL (operands[2])) <= 0)
|
||||
abort ();
|
||||
|
||||
if (fixed <16)
|
||||
output_asm_insn ("loadq %2,%5", operands);
|
||||
else
|
||||
output_asm_insn ("loadi %2,%5", operands);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed = 0;
|
||||
bottom = (rtx)gen_label_rtx (); /* need a bottom label */
|
||||
xops[0] = cnt; xops[1] = bottom;
|
||||
output_asm_insn ("movw %2,%5", operands); /* count is scratch reg 5 */
|
||||
output_asm_insn ("brle %l1", xops);
|
||||
}
|
||||
|
||||
|
||||
top = (rtx)gen_label_rtx (); /* top of loop label */
|
||||
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (top));
|
||||
|
||||
|
||||
xops[0] = src; xops[1] = tmp; xops[2] = dst;
|
||||
|
||||
if (fixed && (align & 0x3) == 0) /* word aligned move with known size */
|
||||
{
|
||||
if (fixed >= 4)
|
||||
{
|
||||
rtx xops1[2];
|
||||
output_asm_insn(
|
||||
"loadw %a0,%1\n\taddq $4,%0\n\tstorw %1,%a2\n\taddq $4,%2",
|
||||
xops);
|
||||
|
||||
xops1[0] = cnt; xops1[1] = top;
|
||||
output_asm_insn ("subq $4,%0\n\tbrgt %l1", xops1);
|
||||
}
|
||||
|
||||
if (fixed & 0x2)
|
||||
{
|
||||
output_asm_insn ("loadh %a0,%1\n\tstorh %1,%a2", xops);
|
||||
if (fixed & 0x1)
|
||||
output_asm_insn ("loadb 2%a0,%1\n\tstorb %1,2%a2", xops);
|
||||
}
|
||||
else
|
||||
if (fixed & 0x1)
|
||||
output_asm_insn ("loadb %a0,%1\n\tstorb %1,%a2", xops);
|
||||
}
|
||||
else
|
||||
{
|
||||
output_asm_insn(
|
||||
"loadb %a0,%1\n\taddq $1,%0\n\tstorb %1,%a2\n\taddq $1,%2",
|
||||
xops);
|
||||
|
||||
xops[0] = cnt; xops[1] = top;
|
||||
output_asm_insn ("subq $1,%0\n\tbrgt %l1", xops);
|
||||
}
|
||||
|
||||
if (fixed == 0)
|
||||
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (bottom));
|
||||
}
|
||||
|
||||
|
||||
print_operand_address (file, addr)
|
||||
FILE *file;
|
||||
register rtx addr;
|
||||
{
|
||||
rtx op0,op1;
|
||||
|
||||
retry:
|
||||
switch (GET_CODE (addr))
|
||||
{
|
||||
case REG:
|
||||
fprintf (file, "(%s)", reg_names[REGNO (addr)]);
|
||||
break;
|
||||
|
||||
case PLUS:
|
||||
/* can be 'symbol + reg' or 'reg + reg' */
|
||||
|
||||
op0 = XEXP (addr, 0);
|
||||
op1 = XEXP (addr, 1);
|
||||
|
||||
if (GET_CODE (op0) == REG && GET_CODE (op1) == REG)
|
||||
{
|
||||
fprintf (file, "[%s](%s)",
|
||||
reg_names[REGNO (op0)], reg_names[REGNO (op1)]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (GET_CODE (op0) == REG && CONSTANT_ADDRESS_P (op1))
|
||||
{
|
||||
output_addr_const (file, op1);
|
||||
fprintf (file, "(%s)", reg_names[REGNO (op0)]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (GET_CODE (op1) == REG && CONSTANT_ADDRESS_P (op0))
|
||||
{
|
||||
output_addr_const (file, op0);
|
||||
fprintf (file, "(%s)", reg_names[REGNO (op1)]);
|
||||
break;
|
||||
}
|
||||
abort (); /* Oh no */
|
||||
|
||||
default:
|
||||
output_addr_const (file, addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
rev_cond_name (op)
|
||||
rtx op;
|
||||
{
|
||||
switch (GET_CODE (op))
|
||||
{
|
||||
case EQ:
|
||||
return "ne";
|
||||
case NE:
|
||||
return "eq";
|
||||
case LT:
|
||||
return "ge";
|
||||
case LE:
|
||||
return "gt";
|
||||
case GT:
|
||||
return "le";
|
||||
case GE:
|
||||
return "lt";
|
||||
case LTU:
|
||||
return "geu";
|
||||
case LEU:
|
||||
return "gtu";
|
||||
case GTU:
|
||||
return "leu";
|
||||
case GEU:
|
||||
return "ltu";
|
||||
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Do what is necessary for `va_start'. The argument is ignored;
|
||||
We fill in an initial va_list. A pointer to this constructor
|
||||
is returned. */
|
||||
|
||||
|
||||
struct rtx_def *
|
||||
clipper_builtin_saveregs (arglist)
|
||||
tree arglist;
|
||||
{
|
||||
extern int current_function_varargs;
|
||||
rtx block, addr, argsize, scratch, r0_addr,r1_addr,f0_addr,f1_addr;
|
||||
|
||||
/* Allocate the va_list constructor + save area for r0,r1,f0,f1 */
|
||||
|
||||
block = assign_stack_local (BLKmode,
|
||||
(6 + 6) * UNITS_PER_WORD, 2 * BITS_PER_WORD);
|
||||
|
||||
RTX_UNCHANGING_P (block) = 1;
|
||||
RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
|
||||
|
||||
addr = copy_to_reg (XEXP (block, 0));
|
||||
|
||||
f0_addr = gen_rtx (PLUS, Pmode, addr, GEN_INT (24));
|
||||
f1_addr = gen_rtx (PLUS, Pmode, addr, GEN_INT (32));
|
||||
r0_addr = gen_rtx (PLUS, Pmode, addr, GEN_INT (40));
|
||||
r1_addr = gen_rtx (PLUS, Pmode, addr, GEN_INT (44));
|
||||
|
||||
|
||||
/* Store float regs */
|
||||
|
||||
emit_move_insn (gen_rtx (MEM, DFmode, f0_addr), gen_rtx (REG, DFmode, 16));
|
||||
emit_move_insn (gen_rtx (MEM, DFmode, f1_addr), gen_rtx (REG, DFmode, 17));
|
||||
|
||||
/* Store int regs */
|
||||
|
||||
emit_move_insn (gen_rtx (MEM, SImode, r0_addr), gen_rtx (REG, SImode, 0));
|
||||
emit_move_insn (gen_rtx (MEM, SImode, r1_addr), gen_rtx (REG, SImode, 1));
|
||||
|
||||
/* Store the arg pointer in the __va_stk member. */
|
||||
|
||||
emit_move_insn (gen_rtx (MEM, SImode, addr),
|
||||
copy_to_reg (virtual_incoming_args_rtx));
|
||||
|
||||
|
||||
/* now move addresses of the saved regs into the pointer array */
|
||||
|
||||
scratch = gen_reg_rtx (Pmode);
|
||||
|
||||
emit_move_insn (scratch, r0_addr);
|
||||
emit_move_insn (gen_rtx (MEM, SImode,
|
||||
gen_rtx (PLUS, Pmode, addr,
|
||||
GEN_INT (4))),
|
||||
scratch);
|
||||
|
||||
emit_move_insn (scratch, f0_addr);
|
||||
emit_move_insn (gen_rtx (MEM, SImode,
|
||||
gen_rtx (PLUS, Pmode, addr,
|
||||
GEN_INT (8))),
|
||||
scratch);
|
||||
|
||||
emit_move_insn (scratch, r1_addr);
|
||||
emit_move_insn (gen_rtx (MEM, SImode,
|
||||
gen_rtx (PLUS, Pmode, addr,
|
||||
GEN_INT (12))),
|
||||
scratch);
|
||||
|
||||
emit_move_insn (scratch, f1_addr);
|
||||
emit_move_insn (gen_rtx (MEM, SImode,
|
||||
gen_rtx (PLUS, Pmode, addr,
|
||||
GEN_INT (16))),
|
||||
scratch);
|
||||
|
||||
|
||||
if (current_function_check_memory_usage)
|
||||
{
|
||||
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
|
||||
addr, ptr_mode,
|
||||
GEN_INT (5 * GET_MODE_SIZE (SImode)),
|
||||
TYPE_MODE (sizetype),
|
||||
GEN_INT (MEMORY_USE_RW),
|
||||
TYPE_MODE (integer_type_node));
|
||||
|
||||
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
|
||||
f0_addr, ptr_mode,
|
||||
GEN_INT (GET_MODE_SIZE (DFmode)),
|
||||
TYPE_MODE (sizetype),
|
||||
GEN_INT (MEMORY_USE_RW),
|
||||
TYPE_MODE (integer_type_node));
|
||||
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
|
||||
f1_addr, ptr_mode,
|
||||
GEN_INT (GET_MODE_SIZE (DFmode)),
|
||||
TYPE_MODE (sizetype),
|
||||
GEN_INT (MEMORY_USE_RW),
|
||||
TYPE_MODE (integer_type_node));
|
||||
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
|
||||
r0_addr, ptr_mode,
|
||||
GEN_INT (GET_MODE_SIZE (SImode)),
|
||||
TYPE_MODE (sizetype),
|
||||
GEN_INT (MEMORY_USE_RW),
|
||||
TYPE_MODE (integer_type_node));
|
||||
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
|
||||
r1_addr, ptr_mode,
|
||||
GEN_INT (GET_MODE_SIZE (SImode)),
|
||||
TYPE_MODE (sizetype),
|
||||
GEN_INT (MEMORY_USE_RW),
|
||||
TYPE_MODE (integer_type_node));
|
||||
}
|
||||
|
||||
/* Return the address of the va_list constructor, but don't put it in a
|
||||
register. This fails when not optimizing and produces worse code when
|
||||
optimizing. */
|
||||
return XEXP (block, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Return truth value of whether OP can be used as an word register
|
||||
operand. Reject (SUBREG:SI (REG:SF )) */
|
||||
|
||||
int
|
||||
int_reg_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
return (register_operand (op, mode) &&
|
||||
(GET_CODE (op) != SUBREG ||
|
||||
GET_MODE_CLASS (GET_MODE (SUBREG_REG (op))) == MODE_INT));
|
||||
}
|
||||
|
||||
/* Return truth value of whether OP can be used as a float register
|
||||
operand. Reject (SUBREG:SF (REG:SI )) )) */
|
||||
|
||||
int
|
||||
fp_reg_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
return (register_operand (op, mode) &&
|
||||
(GET_CODE (op) != SUBREG ||
|
||||
GET_MODE_CLASS (GET_MODE (SUBREG_REG (op))) == MODE_FLOAT));
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,162 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler. Clipper/Clix version.
|
||||
Copyright (C) 1988, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#define CPP_PREDEFINES "-Dclipper -Dunix -Asystem(unix) -Asystem(svr3) -Acpu(clipper) -Amachine(clipper)"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC \
|
||||
"%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
|
||||
|
||||
#undef LIB_SPEC
|
||||
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
#undef HAVE_ATEXIT
|
||||
#define HAVE_ATEXIT
|
||||
|
||||
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
|
||||
do { \
|
||||
unsigned char *s; \
|
||||
int i; \
|
||||
for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
|
||||
{ \
|
||||
if ((i % 8) == 0) \
|
||||
fputs ("\n\t.byte\t", (FILE)); \
|
||||
fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
|
||||
} \
|
||||
fputs ("\n", (FILE)); \
|
||||
} while (0)
|
||||
|
||||
#undef ASM_OUTPUT_DOUBLE
|
||||
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
|
||||
{ \
|
||||
union { int i[2]; double d; } _d_; \
|
||||
_d_.d = VALUE; \
|
||||
fprintf (FILE, "\t.long 0x%08x,0x%08x\n", _d_.i[0],_d_.i[1]); \
|
||||
}
|
||||
|
||||
#undef ASM_OUTPUT_FLOAT
|
||||
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
|
||||
{ \
|
||||
union { int i; float f; } _f_; \
|
||||
_f_.f = VALUE; \
|
||||
fprintf (FILE, "\t.long 0x%08x\n", _f_.i); \
|
||||
}
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
fprintf(FILE, "\t.align %d\n", 1 << (LOG))
|
||||
|
||||
|
||||
#define ASM_LONG ".long"
|
||||
#define BSS_SECTION_ASM_OP ".bss"
|
||||
#undef INIT_SECTION_ASM_OP
|
||||
#define INIT_SECTION_ASM_OP ".section .init,\"x\""
|
||||
|
||||
|
||||
/* Define a few machine-specific details of the implementation of
|
||||
constructors.
|
||||
|
||||
The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
|
||||
and CTOR_LIST_END to contribute to the .init section an instruction to
|
||||
push a word containing 0 (or some equivalent of that).
|
||||
|
||||
ASM_OUTPUT_CONSTRUCTOR should be defined to push the address of the
|
||||
constructor. */
|
||||
|
||||
#define CTOR_LIST_BEGIN \
|
||||
asm (INIT_SECTION_ASM_OP); \
|
||||
asm ("subq $8,sp"); \
|
||||
asm ("loadq $0,r0"); \
|
||||
asm ("storw r0,(sp)")
|
||||
|
||||
/* don't need end marker */
|
||||
|
||||
#undef CTOR_LIST_END
|
||||
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
init_section (); \
|
||||
fputs ("\tloada ", FILE); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputs (",r0\n\tsubq $8,sp\n\tstorw r0,(sp)\n", FILE); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* fini psect is 8 aligned */
|
||||
|
||||
#define DTOR_LIST_BEGIN \
|
||||
asm (DTORS_SECTION_ASM_OP); \
|
||||
func_ptr __DTOR_LIST__[2] = { (func_ptr) (-1), 0 };
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
|
||||
#undef ASM_OUTPUT_DESTRUCTOR
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
fini_section (); \
|
||||
fprintf (FILE, "%s\t ", ASM_LONG); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, ",0\n"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* On clix crt1.o first calls init code and then sets environ and a valid
|
||||
chrclass. Unfortunately stdio routines bomb with unset chrclass.
|
||||
Therefore we set chrclass prior to calling global constructors. */
|
||||
|
||||
#undef DO_GLOBAL_CTORS_BODY
|
||||
#define DO_GLOBAL_CTORS_BODY \
|
||||
do { \
|
||||
func_ptr *p, *beg = alloca (0); \
|
||||
_setchrclass (0); \
|
||||
for (p = beg; *p; p+=2) \
|
||||
; \
|
||||
while (p != beg) \
|
||||
{ p-= 2; (*p) (); } \
|
||||
} while (0)
|
||||
|
||||
|
||||
#undef DO_GLOBAL_DTORS_BODY
|
||||
#define DO_GLOBAL_DTORS_BODY \
|
||||
func_ptr *f = &__DTOR_LIST__[2]; /* 0,1 contains -1,0 */ \
|
||||
int n = 0; \
|
||||
while (*f) \
|
||||
{ \
|
||||
f+= 2; /* skip over alignment 0 */ \
|
||||
n++; \
|
||||
} \
|
||||
f -= 2; \
|
||||
while (--n >= 0) \
|
||||
{ \
|
||||
(*f) (); \
|
||||
f-= 2; /* skip over alignment 0 */ \
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
ALLOCA = alloca.o
|
||||
@@ -1,30 +0,0 @@
|
||||
/* Config file for Clipper running Clix, system V. 3.2 clone */
|
||||
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
|
||||
#include "tm.h"
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* This machine uses IEEE floats. */
|
||||
/* #define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT */
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* isinf isn't there, but finite is. */
|
||||
#define isinf(x) (!finite(x))
|
||||
|
||||
#define USG
|
||||
@@ -1,675 +0,0 @@
|
||||
/* Subroutines for insn-output.c for Convex.
|
||||
Copyright (C) 1988, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include "tree.h"
|
||||
#include "rtl.h"
|
||||
#include "regs.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "real.h"
|
||||
#include "insn-config.h"
|
||||
#include "conditions.h"
|
||||
#include "insn-flags.h"
|
||||
#include "insn-attr.h"
|
||||
#include "output.h"
|
||||
#include "expr.h"
|
||||
|
||||
/* Tables used in convex.h */
|
||||
|
||||
char regno_ok_for_index_p_base[1 + LAST_VIRTUAL_REGISTER + 1];
|
||||
enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
|
||||
enum reg_class reg_class_from_letter[256];
|
||||
|
||||
/* Target cpu index. */
|
||||
|
||||
int target_cpu;
|
||||
|
||||
/* Boolean to keep track of whether the current section is .text or not.
|
||||
Used by .align handler in convex.h. */
|
||||
|
||||
int current_section_is_text;
|
||||
|
||||
/* Communication between output_compare and output_condjump. */
|
||||
|
||||
static rtx cmp_operand0, cmp_operand1;
|
||||
static char cmp_modech;
|
||||
|
||||
/* Forwards */
|
||||
|
||||
static rtx frame_argblock;
|
||||
static int frame_argblock_size;
|
||||
static rtx convert_arg_pushes ();
|
||||
static void expand_movstr_call ();
|
||||
|
||||
/* Here from OVERRIDE_OPTIONS at startup. Initialize constant tables. */
|
||||
|
||||
init_convex ()
|
||||
{
|
||||
int regno;
|
||||
|
||||
/* Set A and S reg classes. */
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (A_REGNO_P (regno))
|
||||
{
|
||||
regno_ok_for_index_p[regno] = 1;
|
||||
regno_reg_class[regno] = INDEX_REGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
regno_ok_for_index_p[regno] = 0;
|
||||
regno_reg_class[regno] = S_REGS;
|
||||
}
|
||||
|
||||
/* Can't index off the stack pointer, register 0. */
|
||||
regno_ok_for_index_p[STACK_POINTER_REGNUM] = 0;
|
||||
regno_reg_class[STACK_POINTER_REGNUM] = SP_REGS;
|
||||
|
||||
/* Can't index off aliases of the stack pointer. */
|
||||
regno_ok_for_index_p[VIRTUAL_INCOMING_ARGS_REGNUM] = 1;
|
||||
regno_ok_for_index_p[VIRTUAL_STACK_VARS_REGNUM] = 1;
|
||||
regno_ok_for_index_p[VIRTUAL_STACK_DYNAMIC_REGNUM] = 0;
|
||||
regno_ok_for_index_p[VIRTUAL_OUTGOING_ARGS_REGNUM] = 0;
|
||||
|
||||
/* Can't index off hard reg -1 == pseudos not assigned */
|
||||
regno_ok_for_index_p[-1] = 0;
|
||||
|
||||
/* Set reg class letters */
|
||||
reg_class_from_letter['a'] = A_REGS;
|
||||
reg_class_from_letter['A'] = INDEX_REGS;
|
||||
reg_class_from_letter['d'] = S_REGS;
|
||||
|
||||
/* Turn off floating point exception enables in the psw. */
|
||||
psw_disable_float ();
|
||||
}
|
||||
|
||||
psw_disable_float ()
|
||||
{
|
||||
#if __convex__ && __GNUC__
|
||||
register int *p;
|
||||
asm ("mov fp,%0" : "=a" (p));
|
||||
while (p)
|
||||
{
|
||||
p[1] &= ~0x1000c400;
|
||||
p = (int *) p[2];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Here to output code for a compare insn. Output nothing, just
|
||||
record the operands and their mode. */
|
||||
|
||||
char *
|
||||
output_cmp (operand0, operand1, modech)
|
||||
rtx operand0, operand1;
|
||||
char modech;
|
||||
{
|
||||
cmp_operand0 = operand0;
|
||||
cmp_operand1 = operand1;
|
||||
cmp_modech = modech;
|
||||
return "";
|
||||
}
|
||||
|
||||
/* Output code for a conditional jump. The preceding instruction
|
||||
is necessarily a compare. Output two instructions, for example
|
||||
eq.w a1,a2
|
||||
jbra.t L5
|
||||
for
|
||||
(cmpsi a1 a2)
|
||||
(beq L5)
|
||||
*/
|
||||
|
||||
char *
|
||||
output_condjump (label, cond, jbr_sense)
|
||||
rtx label;
|
||||
char *cond;
|
||||
char jbr_sense;
|
||||
{
|
||||
rtx operands[3];
|
||||
char cmp_op[4];
|
||||
char buf[80];
|
||||
char jbr_regch;
|
||||
|
||||
strcpy (cmp_op, cond);
|
||||
|
||||
/* [BL] mean the value is being compared against immediate 0.
|
||||
Use neg.x, which produces the same carry that eq.x #0 would if it
|
||||
existed. In this case operands[1] is a scratch register, not a
|
||||
compare operand. */
|
||||
|
||||
if (cmp_modech == 'B' || cmp_modech == 'L')
|
||||
{
|
||||
cmp_modech = cmp_modech - 'A' + 'a';
|
||||
strcpy (cmp_op, "neg");
|
||||
}
|
||||
|
||||
/* [WH] mean the value being compared resulted from "add.[wh] #-1,rk"
|
||||
when rk was nonnegative -- we can omit equality compares against -1
|
||||
or inequality compares against 0. */
|
||||
|
||||
else if (cmp_modech == 'W' || cmp_modech == 'H')
|
||||
{
|
||||
if (! strcmp (cmp_op, "eq") && cmp_operand1 == constm1_rtx)
|
||||
jbr_sense ^= 't' ^ 'f';
|
||||
else if (! strcmp (cmp_op, "lt") && cmp_operand1 == const0_rtx)
|
||||
;
|
||||
else
|
||||
cmp_modech = cmp_modech - 'A' + 'a';
|
||||
}
|
||||
|
||||
/* Constant must be first; swap operands if necessary.
|
||||
If lt, le, ltu, leu are swapped, change to le, lt, leu, ltu
|
||||
and reverse the sense of the jump. */
|
||||
|
||||
if (! REG_P (cmp_operand1))
|
||||
{
|
||||
operands[0] = cmp_operand1;
|
||||
operands[1] = cmp_operand0;
|
||||
if (cmp_op[0] == 'l')
|
||||
{
|
||||
cmp_op[1] ^= 'e' ^ 't';
|
||||
jbr_sense ^= 't' ^ 'f';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
operands[0] = cmp_operand0;
|
||||
operands[1] = cmp_operand1;
|
||||
}
|
||||
|
||||
operands[2] = label;
|
||||
|
||||
if (S_REG_P (operands[1]))
|
||||
jbr_regch = 's';
|
||||
else if (A_REG_P (operands[1]))
|
||||
jbr_regch = 'a';
|
||||
else
|
||||
abort ();
|
||||
|
||||
if (cmp_modech == 'W' || cmp_modech == 'H')
|
||||
sprintf (buf, "jbr%c.%c %%l2", jbr_regch, jbr_sense);
|
||||
else
|
||||
sprintf (buf, "%s.%c %%0,%%1\n\tjbr%c.%c %%l2",
|
||||
cmp_op, cmp_modech, jbr_regch, jbr_sense);
|
||||
output_asm_insn (buf, operands);
|
||||
return "";
|
||||
}
|
||||
|
||||
/* Return 1 if OP is valid for cmpsf.
|
||||
In IEEE mode, +/- zero compares are not handled by
|
||||
the immediate versions of eq.s and on some machines, lt.s, and le.s.
|
||||
So disallow 0.0 as the immediate operand of xx.s compares in IEEE mode. */
|
||||
|
||||
int
|
||||
nonmemory_cmpsf_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
{
|
||||
#if _IEEE_FLOAT_
|
||||
if (op == CONST0_RTX (SFmode))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return nonmemory_operand (op, mode);
|
||||
}
|
||||
|
||||
/* Convex /bin/as does not like unary minus in some contexts.
|
||||
Simplify CONST addresses to remove it. */
|
||||
|
||||
rtx
|
||||
simplify_for_convex (x)
|
||||
rtx x;
|
||||
{
|
||||
switch (GET_CODE (x))
|
||||
{
|
||||
case MINUS:
|
||||
if (GET_CODE (XEXP (x, 1)) == CONST_INT
|
||||
&& INTVAL (XEXP (x, 1)) < 0)
|
||||
{
|
||||
PUT_CODE (x, PLUS);
|
||||
XEXP (x, 1) = GEN_INT (- INTVAL (XEXP (x, 1)));
|
||||
}
|
||||
break;
|
||||
|
||||
case CONST:
|
||||
return simplify_for_convex (XEXP (x, 0));
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
/* Routines to separate CONST_DOUBLEs into component parts. */
|
||||
|
||||
int
|
||||
const_double_high_int (x)
|
||||
rtx x;
|
||||
{
|
||||
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
|
||||
return CONST_DOUBLE_LOW (x);
|
||||
else
|
||||
return CONST_DOUBLE_HIGH (x);
|
||||
}
|
||||
|
||||
int
|
||||
const_double_low_int (x)
|
||||
rtx x;
|
||||
{
|
||||
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
|
||||
return CONST_DOUBLE_HIGH (x);
|
||||
else
|
||||
return CONST_DOUBLE_LOW (x);
|
||||
}
|
||||
|
||||
/* Inline block copy. */
|
||||
|
||||
void
|
||||
expand_movstr (operands)
|
||||
rtx *operands;
|
||||
{
|
||||
rtx dest = operands[0];
|
||||
rtx src = operands[1];
|
||||
int align = INTVAL (operands[3]);
|
||||
int nregs, maxsize;
|
||||
unsigned len;
|
||||
enum machine_mode mode;
|
||||
rtx reg, load, store, prev_store, prev_store_2;
|
||||
int size;
|
||||
|
||||
/* Decide how many regs to use, depending on load latency, and what
|
||||
size pieces to move, depending on whether machine does unaligned
|
||||
loads and stores efficiently. */
|
||||
|
||||
if (TARGET_C1)
|
||||
{
|
||||
/* ld.l latency is 4, no alignment problems. */
|
||||
nregs = 3, maxsize = 8;
|
||||
}
|
||||
else if (TARGET_C2)
|
||||
{
|
||||
/* loads are latency 2 if we avoid ld.l not at least word aligned. */
|
||||
if (align >= 4)
|
||||
nregs = 2, maxsize = 8;
|
||||
else
|
||||
nregs = 2, maxsize = 4;
|
||||
}
|
||||
else if (TARGET_C34)
|
||||
{
|
||||
/* latency is 4 if aligned, horrible if not. */
|
||||
nregs = 3, maxsize = align;
|
||||
}
|
||||
else if (TARGET_C38)
|
||||
{
|
||||
/* latency is 2 if at least word aligned, 3 or 4 if unaligned. */
|
||||
if (align >= 4)
|
||||
nregs = 2, maxsize = 8;
|
||||
else
|
||||
nregs = 3, maxsize = 8;
|
||||
}
|
||||
else
|
||||
abort ();
|
||||
|
||||
/* Caller is not necessarily prepared for us to fail in this
|
||||
expansion. So fall back by generating memcpy call here. */
|
||||
|
||||
if (GET_CODE (operands[2]) != CONST_INT
|
||||
|| (len = INTVAL (operands[2])) > (unsigned) 32 * maxsize)
|
||||
{
|
||||
expand_movstr_call (operands);
|
||||
return;
|
||||
}
|
||||
|
||||
reg = 0;
|
||||
prev_store = prev_store_2 = 0;
|
||||
|
||||
while (len > 0)
|
||||
{
|
||||
if (len >= 8 && maxsize >= 8)
|
||||
mode = DImode;
|
||||
else if (len >= 4 && maxsize >= 4)
|
||||
mode = SImode;
|
||||
else if (len >= 2 && maxsize >= 2)
|
||||
mode = HImode;
|
||||
else
|
||||
mode = QImode;
|
||||
|
||||
/* If no temp pseudo to reuse, or not the right mode, make one */
|
||||
if (! reg || GET_MODE (reg) != mode)
|
||||
reg = gen_reg_rtx (mode);
|
||||
|
||||
/* Get src and dest in the right mode */
|
||||
if (GET_MODE (src) != mode)
|
||||
src = change_address (src, mode, 0),
|
||||
dest = change_address (dest, mode, 0);
|
||||
|
||||
/* Make load and store patterns for this piece */
|
||||
load = gen_rtx (SET, VOIDmode, reg, src);
|
||||
store = gen_rtx (SET, VOIDmode, dest, reg);
|
||||
|
||||
/* Emit the load and the store from last time.
|
||||
When we emit a store, we can reuse its temp reg. */
|
||||
emit_insn (load);
|
||||
if (prev_store)
|
||||
{
|
||||
reg = SET_SRC (prev_store);
|
||||
emit_insn (prev_store);
|
||||
}
|
||||
else
|
||||
reg = 0;
|
||||
|
||||
/* Queue up the store, for next time or the time after that. */
|
||||
if (nregs == 2)
|
||||
prev_store = store;
|
||||
else
|
||||
prev_store = prev_store_2, prev_store_2 = store;
|
||||
|
||||
/* Advance to next piece. */
|
||||
size = GET_MODE_SIZE (mode);
|
||||
src = adj_offsettable_operand (src, size);
|
||||
dest = adj_offsettable_operand (dest, size);
|
||||
len -= size;
|
||||
}
|
||||
|
||||
/* Finally, emit the last stores. */
|
||||
if (prev_store)
|
||||
emit_insn (prev_store);
|
||||
if (prev_store_2)
|
||||
emit_insn (prev_store_2);
|
||||
}
|
||||
|
||||
static void
|
||||
expand_movstr_call (operands)
|
||||
rtx *operands;
|
||||
{
|
||||
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0,
|
||||
VOIDmode, 3,
|
||||
XEXP (operands[0], 0), Pmode,
|
||||
XEXP (operands[1], 0), Pmode,
|
||||
convert_to_mode (TYPE_MODE (sizetype), operands[2],
|
||||
TREE_UNSIGNED (sizetype)),
|
||||
TYPE_MODE (sizetype));
|
||||
}
|
||||
|
||||
#if _IEEE_FLOAT_
|
||||
#define MAX_FLOAT 3.4028234663852886e+38
|
||||
#define MIN_FLOAT 1.1754943508222875e-38
|
||||
#else
|
||||
#define MAX_FLOAT 1.7014117331926443e+38
|
||||
#define MIN_FLOAT 2.9387358770557188e-39
|
||||
#endif
|
||||
|
||||
int
|
||||
check_float_value (mode, dp, overflow)
|
||||
enum machine_mode mode;
|
||||
REAL_VALUE_TYPE *dp;
|
||||
int overflow;
|
||||
{
|
||||
REAL_VALUE_TYPE d = *dp;
|
||||
|
||||
if (overflow)
|
||||
{
|
||||
*dp = MAX_FLOAT;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mode == SFmode)
|
||||
{
|
||||
if (d > MAX_FLOAT)
|
||||
{
|
||||
*dp = MAX_FLOAT;
|
||||
return 1;
|
||||
}
|
||||
else if (d < -MAX_FLOAT)
|
||||
{
|
||||
*dp = -MAX_FLOAT;
|
||||
return 1;
|
||||
}
|
||||
else if ((d > 0 && d < MIN_FLOAT) || (d < 0 && d > -MIN_FLOAT))
|
||||
{
|
||||
*dp = 0.0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Output the label at the start of a function.
|
||||
Precede it with the number of formal args so debuggers will have
|
||||
some idea of how many args to print. */
|
||||
|
||||
void
|
||||
asm_declare_function_name (file, name, decl)
|
||||
FILE *file;
|
||||
char *name;
|
||||
tree decl;
|
||||
{
|
||||
tree parms;
|
||||
int nargs = list_length (DECL_ARGUMENTS (decl));
|
||||
|
||||
char *p, c;
|
||||
extern char *version_string;
|
||||
static char vers[4];
|
||||
int i;
|
||||
|
||||
p = version_string;
|
||||
for (i = 0; i < 3; ) {
|
||||
c = *p;
|
||||
if (c - '0' < (unsigned) 10)
|
||||
vers[i++] = c;
|
||||
if (c == 0 || c == ' ')
|
||||
vers[i++] = '0';
|
||||
else
|
||||
p++;
|
||||
}
|
||||
fprintf (file, "\tds.b \"g%s\"\n", vers);
|
||||
|
||||
if (nargs < 100)
|
||||
fprintf (file, "\tds.b \"+%02d\\0\"\n", nargs);
|
||||
else
|
||||
fprintf (file, "\tds.b \"+00\\0\"\n");
|
||||
|
||||
ASM_OUTPUT_LABEL (file, name);
|
||||
}
|
||||
|
||||
/* Print an instruction operand X on file FILE.
|
||||
CODE is the code from the %-spec that requested printing this operand;
|
||||
if `%z3' was used to print operand 3, then CODE is 'z'. */
|
||||
/* Convex codes:
|
||||
%u prints a CONST_DOUBLE's high word
|
||||
%v prints a CONST_DOUBLE's low word
|
||||
%z prints a CONST_INT shift count as a multiply operand -- viz. 1 << n.
|
||||
*/
|
||||
|
||||
print_operand (file, x, code)
|
||||
FILE *file;
|
||||
rtx x;
|
||||
char code;
|
||||
{
|
||||
long u[2];
|
||||
REAL_VALUE_TYPE d;
|
||||
|
||||
switch (GET_CODE (x))
|
||||
{
|
||||
case REG:
|
||||
fprintf (file, "%s", reg_names[REGNO (x)]);
|
||||
break;
|
||||
|
||||
case MEM:
|
||||
output_address (XEXP (x, 0));
|
||||
break;
|
||||
|
||||
case CONST_DOUBLE:
|
||||
REAL_VALUE_FROM_CONST_DOUBLE (d, x);
|
||||
switch (GET_MODE (x)) {
|
||||
case DFmode:
|
||||
#if 0 /* doesn't work, produces dfloats */
|
||||
REAL_VALUE_TO_TARGET_DOUBLE (d, u);
|
||||
#else
|
||||
{
|
||||
union { double d; int i[2]; } t;
|
||||
t.d = d;
|
||||
u[0] = t.i[0];
|
||||
u[1] = t.i[1];
|
||||
}
|
||||
#endif
|
||||
if (code == 'u')
|
||||
fprintf (file, "#%#x", u[0]);
|
||||
else if (code == 'v')
|
||||
fprintf (file, "#%#x", u[1]);
|
||||
else
|
||||
outfloat (file, d, "%.17e", "#", "");
|
||||
break;
|
||||
case SFmode:
|
||||
outfloat (file, d, "%.9e", "#", "");
|
||||
break;
|
||||
default:
|
||||
if (code == 'u')
|
||||
fprintf (file, "#%d", CONST_DOUBLE_HIGH (x));
|
||||
else
|
||||
fprintf (file, "#%d", CONST_DOUBLE_LOW (x));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (code == 'z')
|
||||
{
|
||||
if (GET_CODE (x) != CONST_INT)
|
||||
abort ();
|
||||
fprintf (file, "#%d", 1 << INTVAL (x));
|
||||
}
|
||||
else
|
||||
{
|
||||
putc ('#', file);
|
||||
output_addr_const (file, x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Print a memory operand whose address is X, on file FILE. */
|
||||
|
||||
print_operand_address (file, addr)
|
||||
FILE *file;
|
||||
rtx addr;
|
||||
{
|
||||
rtx index = 0;
|
||||
rtx offset = 0;
|
||||
|
||||
if (GET_CODE (addr) == MEM)
|
||||
{
|
||||
fprintf (file, "@");
|
||||
addr = XEXP (addr, 0);
|
||||
}
|
||||
|
||||
switch (GET_CODE (addr))
|
||||
{
|
||||
case REG:
|
||||
index = addr;
|
||||
break;
|
||||
|
||||
case PLUS:
|
||||
index = XEXP (addr, 0);
|
||||
if (REG_P (index))
|
||||
offset = XEXP (addr, 1);
|
||||
else
|
||||
{
|
||||
offset = XEXP (addr, 0);
|
||||
index = XEXP (addr, 1);
|
||||
if (! REG_P (index))
|
||||
abort ();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
offset = addr;
|
||||
break;
|
||||
}
|
||||
|
||||
if (offset)
|
||||
output_addr_const (file, offset);
|
||||
|
||||
if (index)
|
||||
fprintf (file, "(%s)", reg_names[REGNO (index)]);
|
||||
}
|
||||
|
||||
/* Output a float to FILE, value VALUE, format FMT, preceded by PFX
|
||||
and followed by SFX. */
|
||||
|
||||
outfloat (file, value, fmt, pfx, sfx)
|
||||
FILE *file;
|
||||
REAL_VALUE_TYPE value;
|
||||
char *fmt, *pfx, *sfx;
|
||||
{
|
||||
char buf[64];
|
||||
fputs (pfx, file);
|
||||
REAL_VALUE_TO_DECIMAL (value, fmt, buf);
|
||||
fputs (buf, file);
|
||||
fputs (sfx, file);
|
||||
}
|
||||
|
||||
/* Here during RTL generation of return. If we are at the final return
|
||||
in a function, go through the function and replace pushes with stores
|
||||
into a frame arg block. This is similar to what ACCUMULATE_OUTGOING_ARGS
|
||||
does, but we must index off the frame pointer, not the stack pointer,
|
||||
and the calling sequence does not require the arg block to be at the
|
||||
top of the stack. */
|
||||
|
||||
replace_arg_pushes ()
|
||||
{
|
||||
/* Doesn't work yet. */
|
||||
}
|
||||
|
||||
/* Output the insns needed to do a call. operands[] are
|
||||
0 - MEM, the place to call
|
||||
1 - CONST_INT, the number of bytes in the arg list
|
||||
2 - CONST_INT, the number of arguments
|
||||
3 - CONST_INT, the number of bytes to pop
|
||||
4 - address of the arg list.
|
||||
*/
|
||||
|
||||
char *
|
||||
output_call (insn, operands)
|
||||
rtx insn, *operands;
|
||||
{
|
||||
if (operands[4] == stack_pointer_rtx)
|
||||
output_asm_insn ("mov sp,ap", operands);
|
||||
else
|
||||
abort ();
|
||||
|
||||
if (TARGET_ARGCOUNT)
|
||||
output_asm_insn ("pshea %a2", operands);
|
||||
|
||||
output_asm_insn ("calls %0", operands);
|
||||
|
||||
output_asm_insn ("ld.w 12(fp),ap", operands);
|
||||
|
||||
if (operands[4] == stack_pointer_rtx && operands[3] != const0_rtx)
|
||||
output_asm_insn ("add.w %3,sp", operands);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/* Here after reloading, before the second scheduling pass. */
|
||||
|
||||
emit_ap_optimizations ()
|
||||
{
|
||||
/* Removed for now. */
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,416 +0,0 @@
|
||||
|
||||
# This is a shell archive. Remove anything before this line,
|
||||
# then unpack it by saving it in a file and typing "sh file".
|
||||
#
|
||||
# Wrapped by on Fri Mar 12 08:41:28 CST 1993
|
||||
# Contents: include/ include/limits.h include/math.h include/stddef.h
|
||||
# include/stdlib.h
|
||||
|
||||
echo mkdir - include
|
||||
mkdir include
|
||||
chmod u=rwx,g=rwx,o=rx include
|
||||
|
||||
echo x - include/limits.h
|
||||
sed 's/^@//' > "include/limits.h" <<'@//E*O*F include/limits.h//'
|
||||
#ifndef _LIMITS_H
|
||||
#define _LIMITS_H
|
||||
|
||||
#include_next <limits.h>
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
#undef CHAR_MIN
|
||||
#define CHAR_MIN 0
|
||||
#undef CHAR_MAX
|
||||
#define CHAR_MAX 255
|
||||
#endif
|
||||
|
||||
#endif /* _LIMITS_H */
|
||||
@//E*O*F include/limits.h//
|
||||
chmod u=rw,g=rw,o=r include/limits.h
|
||||
|
||||
echo x - include/math.h
|
||||
sed 's/^@//' > "include/math.h" <<'@//E*O*F include/math.h//'
|
||||
#ifndef _MATH_H
|
||||
#define _MATH_H
|
||||
|
||||
#include_next <math.h>
|
||||
|
||||
#undef HUGE_VAL
|
||||
|
||||
#if _IEEE_FLOAT_
|
||||
#define HUGE_VAL 1.79769313486231570e+308
|
||||
#else
|
||||
#define HUGE_VAL 8.98846567431157854e+307
|
||||
#endif
|
||||
|
||||
#if __OPTIMIZE__ && ! __NO_INLINE
|
||||
|
||||
#define frexp(x,y) __inline_frexp ((x), (y))
|
||||
#define ldexp(x,y) __inline_ldexp ((x), (y))
|
||||
#define irint(x) __inline_irint (x)
|
||||
#define frexpf(x,y) __inline_frexpf ((x), (y))
|
||||
#define ldexpf(x,y) __inline_ldexpf ((x), (y))
|
||||
#define irintf(x) __inline_irintf (x)
|
||||
|
||||
#if __convex_c2__ || __convex_c32__ || __convex_c34__ || __convex_c38__
|
||||
|
||||
#define atan(x) __inline_atan (x)
|
||||
#define ceil(x) __inline_ceil (x)
|
||||
#define cos(x) __inline_cos (x)
|
||||
#define exp(x) __inline_exp (x)
|
||||
#define floor(x) __inline_floor (x)
|
||||
#define log(x) __inline_log (x)
|
||||
#define log10(x) __inline_log10 (x)
|
||||
#define modf(x,y) __inline_modf ((x), (y))
|
||||
#define rint(x) __inline_rint (x)
|
||||
#define sin(x) __inline_sin (x)
|
||||
#define sqrt(x) __inline_sqrt (x)
|
||||
|
||||
#define atanf(x) __inline_atanf (x)
|
||||
#define ceilf(x) __inline_ceilf (x)
|
||||
#define cosf(x) __inline_cosf (x)
|
||||
#define expf(x) __inline_expf (x)
|
||||
#define floorf(x) __inline_floorf (x)
|
||||
#define logf(x) __inline_logf (x)
|
||||
#define log10f(x) __inline_log10f (x)
|
||||
#define modff(x,y) __inline_modff ((x), (y))
|
||||
#define rintf(x) __inline_rintf (x)
|
||||
#define sinf(x) __inline_sinf (x)
|
||||
#define sqrtf(x) __inline_sqrtf (x)
|
||||
|
||||
#endif /* __convex_c[23*]__ */
|
||||
|
||||
#endif /* __OPTIMIZE__ */
|
||||
|
||||
static __inline__ __const__ double __inline_atan (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("atan.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_atanf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("atan.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_cos (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("cos.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_cosf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("cos.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_exp (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("exp.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_expf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("exp.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_log (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("ln.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_logf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("ln.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_sin (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("sin.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_sinf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("sin.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_sqrt (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("sqrt.d %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_sqrtf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("sqrt.s %0" : "=d" (z) : "0" (x));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_ceil (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x));
|
||||
if (z < x) z += 1.0;
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_ceilf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x));
|
||||
if (z < x) z += 1.0F;
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_floor (double x)
|
||||
{
|
||||
double z;
|
||||
__asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x));
|
||||
if (z > x) z -= 1.0;
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_floorf (float x)
|
||||
{
|
||||
float z;
|
||||
__asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x));
|
||||
if (z > x) z -= 1.0F;
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_log10 (double x)
|
||||
{
|
||||
return 0.43429448190325182765 * __inline_log (x);
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_log10f (float x)
|
||||
{
|
||||
return 0.43429448190325182765F * __inline_logf (x);
|
||||
}
|
||||
|
||||
static __inline__ double __inline_modf (double x, double *np)
|
||||
{
|
||||
double intpart;
|
||||
__asm__ ("frint.d %1,%0" : "=d" (intpart) : "d" (x));
|
||||
*np = intpart;
|
||||
return x - intpart;
|
||||
}
|
||||
|
||||
static __inline__ float __inline_modff (float x, float *np)
|
||||
{
|
||||
float intpart;
|
||||
__asm__ ("frint.s %1,%0" : "=d" (intpart) : "d" (x));
|
||||
*np = intpart;
|
||||
return x - intpart;
|
||||
}
|
||||
|
||||
static __inline__ double __inline_frexp (double x, int *np)
|
||||
{
|
||||
union u { double d; unsigned long long ll; } u;
|
||||
if ((u.d = x) == 0)
|
||||
*np = 0;
|
||||
else
|
||||
{
|
||||
#if _IEEE_FLOAT_
|
||||
*np = ((u.ll >> 52) & 03777) - 01776;
|
||||
u.ll = (u.ll & 0x800fffffffffffffLL) | 0x3fe0000000000000LL;
|
||||
#else
|
||||
*np = ((u.ll >> 52) & 03777) - 02000;
|
||||
u.ll = (u.ll & 0x800fffffffffffffLL) | 0x4000000000000000LL;
|
||||
#endif
|
||||
}
|
||||
return u.d;
|
||||
}
|
||||
|
||||
static __inline__ float __inline_frexpf (float x, int *np)
|
||||
{
|
||||
union u { float f; unsigned int i; } u;
|
||||
if ((u.f = x) == 0)
|
||||
*np = 0;
|
||||
else
|
||||
{
|
||||
#if _IEEE_FLOAT_
|
||||
*np = ((u.i >> 23) & 0377) - 0176;
|
||||
u.i = (u.i & 0x807fffff) | 0x3f000000;
|
||||
#else
|
||||
*np = ((u.i >> 23) & 0377) - 0200;
|
||||
u.i = (u.i & 0x807fffff) | 0x40000000;
|
||||
#endif
|
||||
}
|
||||
return u.f;
|
||||
}
|
||||
|
||||
static __inline__ double __inline_ldexp (double x, int n)
|
||||
{
|
||||
extern int errno;
|
||||
union { double d; long long ll; unsigned sexp : 12; } u;
|
||||
if ((u.d = x) != 0)
|
||||
{
|
||||
int exp = n + (u.sexp & 03777);
|
||||
long long nn = (long long) n << 52;
|
||||
#if _IEEE_FLOAT_
|
||||
if (exp <= 0)
|
||||
u.ll &= 0x8000000000000000LL, errno = 34;
|
||||
else if (exp > 03776)
|
||||
u.ll = u.ll & 0x8000000000000000LL | 0x7fefffffffffffffLL, errno = 34;
|
||||
#else
|
||||
if (exp <= 0)
|
||||
u.ll = 0, errno = 34;
|
||||
else if (exp > 03777)
|
||||
u.ll |= 0x7fffffffffffffffLL, errno = 34;
|
||||
#endif
|
||||
else
|
||||
u.ll += nn;
|
||||
}
|
||||
return u.d;
|
||||
}
|
||||
|
||||
static __inline__ float __inline_ldexpf (float x, int n)
|
||||
{
|
||||
extern int errno;
|
||||
union { float f; int i; unsigned sexp : 9; } u;
|
||||
if ((u.f = x) != 0)
|
||||
{
|
||||
int exp = n + (u.sexp & 0377);
|
||||
int nn = n << 23;
|
||||
#if _IEEE_FLOAT_
|
||||
if (exp <= 0)
|
||||
u.i &= 0x80000000, errno = 34;
|
||||
else if (exp > 0376)
|
||||
u.i = u.i & 0x80000000 | 0x7f7fffff, errno = 34;
|
||||
#else
|
||||
if (exp <= 0)
|
||||
u.i = 0, errno = 34;
|
||||
else if (exp > 0377)
|
||||
u.i |= 0x7fffffff, errno = 34;
|
||||
#endif
|
||||
else
|
||||
u.i += nn;
|
||||
}
|
||||
return u.f;
|
||||
}
|
||||
|
||||
static __inline__ __const__ double __inline_rint (double x)
|
||||
{
|
||||
double z;
|
||||
union { double d; unsigned long long ll; } u;
|
||||
u.d = x;
|
||||
#if _IEEE_FLOAT_
|
||||
u.ll = (u.ll & 0x8000000000000000LL) | 0x3fe0000000000000LL;
|
||||
#else
|
||||
u.ll = (u.ll & 0x8000000000000000LL) | 0x4000000000000000LL;
|
||||
#endif
|
||||
__asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x + u.d));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ float __inline_rintf (float x)
|
||||
{
|
||||
float z;
|
||||
union { float f; unsigned int i; } u;
|
||||
u.f = x;
|
||||
#if _IEEE_FLOAT_
|
||||
u.i = (u.i & 0x80000000) | 0x3f000000;
|
||||
#else
|
||||
u.i = (u.i & 0x80000000) | 0x40000000;
|
||||
#endif
|
||||
__asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x + u.f));
|
||||
return z;
|
||||
}
|
||||
|
||||
static __inline__ __const__ int __inline_irint (double x)
|
||||
{
|
||||
union { double d; unsigned long long ll; } u;
|
||||
u.d = x;
|
||||
#if _IEEE_FLOAT_
|
||||
u.ll = (u.ll & 0x8000000000000000LL) | 0x3fe0000000000000LL;
|
||||
#else
|
||||
u.ll = (u.ll & 0x8000000000000000LL) | 0x4000000000000000LL;
|
||||
#endif
|
||||
return x + u.d;
|
||||
}
|
||||
|
||||
static __inline__ __const__ int __inline_irintf (float x)
|
||||
{
|
||||
union { float f; unsigned int i; } u;
|
||||
u.f = x;
|
||||
#if _IEEE_FLOAT_
|
||||
u.i = (u.i & 0x80000000) | 0x3f000000;
|
||||
#else
|
||||
u.i = (u.i & 0x80000000) | 0x40000000;
|
||||
#endif
|
||||
return x + u.f;
|
||||
}
|
||||
|
||||
#endif /* _MATH_H */
|
||||
@//E*O*F include/math.h//
|
||||
chmod u=rw,g=rw,o=r include/math.h
|
||||
|
||||
echo x - include/stddef.h
|
||||
sed 's/^@//' > "include/stddef.h" <<'@//E*O*F include/stddef.h//'
|
||||
#ifndef _STDDEF_H
|
||||
#define _STDDEF_H
|
||||
|
||||
#ifndef __WCHAR_T
|
||||
#define __WCHAR_T
|
||||
|
||||
#ifdef __GNUG__
|
||||
/* In C++, wchar_t is a distinct basic type,
|
||||
and we can expect __wchar_t to be defined by cc1plus. */
|
||||
typedef __wchar_t wchar_t;
|
||||
#else
|
||||
/* In C, cpp tells us which type to make an alias for. */
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#endif
|
||||
|
||||
#endif /* __WCHAR_T */
|
||||
|
||||
#include_next <stddef.h>
|
||||
|
||||
#endif /* _STDDEF_H */
|
||||
@//E*O*F include/stddef.h//
|
||||
chmod u=rw,g=rw,o=r include/stddef.h
|
||||
|
||||
echo x - include/stdlib.h
|
||||
sed 's/^@//' > "include/stdlib.h" <<'@//E*O*F include/stdlib.h//'
|
||||
#ifndef _STDLIB_H
|
||||
#define _STDLIB_H
|
||||
|
||||
#if _CONVEX_SOURCE
|
||||
|
||||
#define alloca __non_builtin_alloca
|
||||
#include_next <stdlib.h>
|
||||
#undef alloca
|
||||
|
||||
#else
|
||||
|
||||
#include_next <stdlib.h>
|
||||
|
||||
#endif /* _CONVEX_SOURCE */
|
||||
|
||||
#endif /* _STDLIB_H */
|
||||
@//E*O*F include/stdlib.h//
|
||||
chmod u=rw,g=rw,o=r include/stdlib.h
|
||||
|
||||
exit 0
|
||||
@@ -1,5 +0,0 @@
|
||||
# ld can make exe's c2-only if this lib is searched even though not loaded
|
||||
CCLIBFLAGS = -tm c1
|
||||
|
||||
# Use -pcc to avoid surprises.
|
||||
CC = cc -pcc
|
||||
@@ -1,48 +0,0 @@
|
||||
/* Configuration for GNU C-compiler for Convex.
|
||||
Copyright (C) 1989, 1993, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* Convex ships /tmp as a separate file system - thus it
|
||||
usually has more free space than /usr/tmp */
|
||||
|
||||
#define P_tmpdir "/tmp/"
|
||||
|
||||
/* Convex uses Vax or IEEE floats.
|
||||
Both formats have Vax semantics. */
|
||||
|
||||
#define HOST_FLOAT_FORMAT VAX_FLOAT_FORMAT
|
||||
@@ -1,131 +0,0 @@
|
||||
-*- Text -*-
|
||||
|
||||
This document describes the proposed ABI for the d10v.
|
||||
|
||||
The register calling convention is:
|
||||
|
||||
+-------+-----------------------+-----------------------+
|
||||
| Reg. | At prologue | After epilogue |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R0 | Argument #1 | Return value, word 1 |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R1 | Argument #2 | Return value, word 2 |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R2 | Argument #3 | Return value, word 3 |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R3 | Argument #4 | Return value, word 4 |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R4 | Static chain if needed| Don't care |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R5 | Work | Don't care |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R6 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R7 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R8 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R9 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R10 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R11 | Frame ptr if needed | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R12 | Work | Don't care |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R13 | Return address | Don't care |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R14 | memory base (0) | memory base (0) |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| R15 | Stack pointer | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| A0 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
| A1 | Work | Previous value |
|
||||
+-------+-----------------------+-----------------------+
|
||||
|
||||
|
||||
The 'int' type is 16 bits, unless the -mint32 switch is used. The 'long' type
|
||||
is always 32 bits, the 'short' type is always 16 bits, and pointers are 16
|
||||
bits.
|
||||
|
||||
The 'double' type is treated as 'float' and uses 32-bits unless the -mdouble64
|
||||
switch is used. The long double type still uses 64 bits.
|
||||
|
||||
If more than 4 words of arguments are passed, they are passed on the stack.
|
||||
|
||||
The GCC compiler will omit the frame pointer for all functions except those
|
||||
that dynamically grow the stack frame (ie, the GNU extensions of variable sized
|
||||
arrays or calls to alloca). The GCC compiler will always eliminate the
|
||||
pseudo argument pointer the compiler synthesizes in favor of the stack or frame
|
||||
pointer.
|
||||
|
||||
The GCC compiler only passes the static chain when calling nested functions,
|
||||
which is a GNU extension.
|
||||
|
||||
The stack starts at high memory and descends downward. The heap starts at the
|
||||
end of the bss section and ascends upward. The stack is assumed to be aligned
|
||||
to a word boundary.
|
||||
|
||||
Register r14 will be used as the index register in accessing global/static
|
||||
variables if no index register is used. The crt0 that we provide will place a
|
||||
zero in it, and the compiler will expect that.
|
||||
|
||||
The varargs/stdarg support defines the va_list type as follows:
|
||||
|
||||
typedef struct __va_list_tag {
|
||||
short *__va_arg_ptr; /* start of the register save area */
|
||||
int __va_arg_num; /* argument number */
|
||||
} va_list[1];
|
||||
|
||||
It is an array so that passing it to vprintf and friends passes just a pointer
|
||||
to the structure. Calls to varargs/stdarg functions push the four words
|
||||
corresponding to the first four arguments on the stack immediately before
|
||||
adjusting the stack pointer any further.
|
||||
|
||||
The stack frame when a function is called looks like:
|
||||
|
||||
high | .... |
|
||||
+-------------------------------+
|
||||
| Argument word #8 |
|
||||
+-------------------------------+
|
||||
| Argument word #7 |
|
||||
+-------------------------------+
|
||||
| Argument word #6 |
|
||||
+-------------------------------+
|
||||
| Argument word #5 |
|
||||
low SP----> +-------------------------------+
|
||||
|
||||
After the prologue is executed, the stack frame will look like:
|
||||
|
||||
high | .... |
|
||||
+-------------------------------+
|
||||
| Argument word #8 |
|
||||
+-------------------------------+
|
||||
| Argument word #7 |
|
||||
+-------------------------------+
|
||||
| Argument word #6 |
|
||||
+-------------------------------+
|
||||
| Argument word #5 |
|
||||
Prev sp +-------------------------------+
|
||||
| |
|
||||
| Save for arguments 1..4 if |
|
||||
| the func. uses stdarg/varargs |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Local variables |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Save area for preserved regs |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| alloca space if used |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Space for outgoing arguments |
|
||||
| |
|
||||
low SP----> +-------------------------------+
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,556 +0,0 @@
|
||||
/* Assembly support functions for libgcc1.
|
||||
*
|
||||
* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
* Contributed by Cygnus Support
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* In addition to the permissions in the GNU General Public License, the
|
||||
* Free Software Foundation gives you unlimited permission to link the
|
||||
* compiled version of this file with other programs, and to distribute
|
||||
* those programs without any restriction coming from the use of this
|
||||
* file. (The General Public License restrictions do apply in other
|
||||
* respects; for example, they cover modification of the file, and
|
||||
* distribution when not linked into another program.)
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* As a special exception, if you link this library with files
|
||||
* compiled with GCC to produce an executable, this does not cause
|
||||
* the resulting executable to be covered by the GNU General Public License.
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef L_ashlsi3
|
||||
/* Shift of 32 bit int left, r0-r1 == value to be shifted, r2 = shift amount */
|
||||
|
||||
.file "_ashlsi3.s"
|
||||
.text
|
||||
.globl __ashlsi3
|
||||
.type __ashlsi3,@function
|
||||
__ashlsi3:
|
||||
mv2wfac r4,a0 /* preserve accumulator & guard digits */
|
||||
mvfacg r12,a0
|
||||
mv2wtac r0,a0
|
||||
cmpui r2,16
|
||||
and3 r0,r2,15
|
||||
exef0f || slli a0,16
|
||||
sll a0,r0
|
||||
mv2wfac r0,a0
|
||||
mv2wtac r4,a0
|
||||
mvtacg r12,a0
|
||||
jmp r13
|
||||
.size __ashlsi3,.-__ashlsi3
|
||||
#endif
|
||||
|
||||
#ifdef L_ashrsi3
|
||||
/* Shift of 32 bit signed int right, r0-r1 == value to be shifted, r2 = shift amount */
|
||||
|
||||
.file "_ashrsi3.s"
|
||||
.text
|
||||
.globl __ashrsi3
|
||||
.type __ashrsi3,@function
|
||||
__ashrsi3:
|
||||
mv2wfac r4,a0 /* preserve accumulator & guard digits */
|
||||
mvfacg r12,a0
|
||||
mv2wtac r0,a0
|
||||
cmpui r2,16
|
||||
and3 r0,r2,15
|
||||
exef0f || srai a0,16
|
||||
sra a0,r0
|
||||
mv2wfac r0,a0
|
||||
mv2wtac r4,a0
|
||||
mvtacg r12,a0
|
||||
jmp r13
|
||||
.size __ashrsi3,.-__ashrsi3
|
||||
#endif
|
||||
|
||||
#ifdef L_lshrsi3
|
||||
/* Shift of 32 bit unsigned int right, r0-r1 == value to be shifted, r2 = shift amount */
|
||||
|
||||
.file "_lshrsi3.s"
|
||||
.text
|
||||
.globl __lshrsi3
|
||||
.type __lshrsi3,@function
|
||||
__lshrsi3:
|
||||
mv2wfac r4,a0 /* preserve accumulator & guard digits */
|
||||
mvfacg r12,a0
|
||||
mv2wtac r0,a0
|
||||
mvtacg r14,a0 /* zero guard digits */
|
||||
cmpui r2,16
|
||||
and3 r0,r2,15
|
||||
exef0f || srli a0,16
|
||||
srl a0,r0
|
||||
mv2wfac r0,a0
|
||||
mv2wtac r4,a0
|
||||
mvtacg r12,a0
|
||||
jmp r13
|
||||
.size __lshrsi3,.-__lshrsi3
|
||||
#endif
|
||||
|
||||
#ifdef L_mulsi3
|
||||
/* Multiply 2 32-bit signed integers with a 32-bit result, r0-r1 = first number,
|
||||
r2-r3 = second number. */
|
||||
|
||||
.file "_mulsi3.s"
|
||||
.text
|
||||
.globl __mulsi3
|
||||
.type __mulsi3,@function
|
||||
__mulsi3:
|
||||
mv2wfac r4,a0 /* preserve accumulator & guard digits */
|
||||
mvfacg r12,a0
|
||||
mulxu a0,r0,r3
|
||||
macu a0,r1,r2
|
||||
slli a0,16
|
||||
macu a0,r1,r3
|
||||
mv2wfac r0,a0
|
||||
mv2wtac r4,a0
|
||||
mvtacg r12,a0
|
||||
jmp r13
|
||||
.size __mulsi3,.-__mulsi3
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_udivmodhi4
|
||||
/* Unsigned divide 2 16-bit numbers, leaving the remainder in r0, and quotient
|
||||
in r1. */
|
||||
|
||||
.file "_udivmodhi4.s"
|
||||
.text
|
||||
.globl __udivmodhi4
|
||||
.type __udivmodhi4,@function
|
||||
.globl __umodhi3
|
||||
.type __umodhi3,@function
|
||||
__udivmodhi4:
|
||||
__umodhi3:
|
||||
mv r2,r1 -> mv r1,r0 /* move divisor to safe register & create 32-bit value for dividend */
|
||||
ldi r0,0 /* high part of dividend */
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
jmp r13
|
||||
.size __udivmodhi4,.-__udivmodhi4
|
||||
.size __umodhi3,.-__umodhi3
|
||||
|
||||
.globl __udivhi3
|
||||
.type __udivhi3,@function
|
||||
__udivhi3:
|
||||
st r13,@-sp
|
||||
bl __udivmodhi4
|
||||
mv r0,r1
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
.size __udivhi3,.-__udivhi3
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_divmodhi4
|
||||
/* Signed divide 2 16-bit numbers, leaving the remainder in r0, and quotient
|
||||
in r1. */
|
||||
|
||||
.file "_divmodhi4.s"
|
||||
.text
|
||||
.globl __divmodhi4
|
||||
.type __divmodhi4,@function
|
||||
.globl __modhi3
|
||||
.type __modhi3,@function
|
||||
__divmodhi4:
|
||||
__modhi3:
|
||||
mv r2,r1 -> mv r1,r0 /* move divisor to safe register & create 32-bit value for dividend */
|
||||
ldi r0,0 || abs r1 /* high part of dividend */
|
||||
abs r2 || nop /* make sure divisor & dividend are positive (F0/F1 indicate if args were negative) */
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
divs r0,r2
|
||||
exef1t || neg r0
|
||||
exef0t || neg r1
|
||||
exef1t || neg r1
|
||||
jmp r13
|
||||
.size __divmodhi4,.-__divmodhi4
|
||||
.size __modhi3,.-__modhi3
|
||||
|
||||
.globl __divhi3
|
||||
.type __divhi3,@function
|
||||
__divhi3:
|
||||
st r13,@-sp
|
||||
bl __divmodhi4
|
||||
mv r0,r1
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
.size __divhi3,.-__divhi3
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_udivmodsi4
|
||||
/* Unsigned divide 2 32-bit numbers, leaving the remainder in r0-r1, and quotient
|
||||
in r2-r3. */
|
||||
|
||||
.file "_udivmodsi4.s"
|
||||
.text
|
||||
.globl __udivmodsi4
|
||||
.type __udivmodsi4,@function
|
||||
.globl __udivsi3
|
||||
.type __udivsi3,@function
|
||||
/* input: r0-r1 = dividend, r2-r3 = divisor */
|
||||
/* output: r0-r1 = quotient, r2-r3 = remainder */
|
||||
__udivmodsi4:
|
||||
__udivsi3:
|
||||
cmpeqi r0,0 -> brf0f.s .Llong /* if we are doing short/short do it with divs */
|
||||
cmpeqi r2,0 -> brf0f.s .Llong
|
||||
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
divs r0,r3
|
||||
mv r3,r0
|
||||
ldi r0,0
|
||||
jmp r13
|
||||
|
||||
.Llong:
|
||||
st2w r6,@-sp
|
||||
st2w r8,@-sp
|
||||
mv2w r4,r2 /* divisor (b) */
|
||||
ldi r2,0 /* high part of dividend (ah) */
|
||||
ldi r3,0
|
||||
ldi r12,32 /* number of iterations */
|
||||
.Lloop:
|
||||
mv2w r6,r2 /* tmp1 = (ah << 1) | (al >> 31) */
|
||||
add2w r6,r6
|
||||
cmpi r0,0
|
||||
exef0t || addi r7,1
|
||||
|
||||
mv2w r8,r6 /* tmp2 = tmp1 - b */
|
||||
sub2w r8,r4
|
||||
|
||||
cmpeq r6,r4 /* tmpf = (tmp1 >= b), ie f0 = !(tmp1 < b) */
|
||||
cmpu r6,r4
|
||||
exef1t || cmpu r7,r5
|
||||
|
||||
mv2w r2,r6 /* ah = (tmpf) ? tmp1 : tmp2 */
|
||||
exef0f || mv2w r2,r8
|
||||
|
||||
add2w r0,r0 /* al = (al << 1) | tmpf */
|
||||
exef0f || addi r1,1
|
||||
|
||||
subi r12,1 /* decrement and loop */
|
||||
cmpeqi r12,0
|
||||
brf0f.s .Lloop /* work around simulator bug with .s version of brf0f */
|
||||
|
||||
ld2w r8,@sp+
|
||||
ld2w r6,@sp+
|
||||
jmp r13
|
||||
.size __udivmodsi4,.-__udivmodsi4
|
||||
.size __udivsi3,.-__udivsi3
|
||||
|
||||
.globl __umodsi3
|
||||
.type __umodsi3,@function
|
||||
__umodsi3:
|
||||
st r13,@-sp
|
||||
bl __udivmodsi4
|
||||
mv2w r0,r2
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
.size __modvsi3,.-__modvsi3
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_divmodsi4
|
||||
/* Signed divide 2 32-bit numbers, leaving the remainder in r0-r1, and quotient
|
||||
in r2-r3. */
|
||||
|
||||
.file "_divmodsi4.s"
|
||||
.text
|
||||
.globl __divmodsi4
|
||||
.type __divmodsi4,@function
|
||||
.globl __divsi3
|
||||
.type __divsi3,@function
|
||||
__divmodsi4:
|
||||
__divsi3:
|
||||
cmpi r0,0 /* divisor negative? */
|
||||
brf0t.s .Lneg1
|
||||
|
||||
cmpi r2,0 /* dividend negative? */
|
||||
brf0t.s .Lneg3
|
||||
|
||||
bra __udivmodsi4 /* both positive, just do division, __udivmodsi4 will return to caller */
|
||||
|
||||
.Lneg1: /* divisor negative, dividend sign not yet checked */
|
||||
st r13,@-sp
|
||||
not r0 /* negate divisor */
|
||||
neg r1
|
||||
cmpeqi r1,0
|
||||
exef0t || addi r0,1
|
||||
|
||||
cmpi r2,0 /* dividend negative? */
|
||||
brf0t.s .Lneg2
|
||||
|
||||
bl __udivmodsi4 /* do division */
|
||||
|
||||
not r0 /* negate quotient */
|
||||
neg r1
|
||||
cmpeqi r1,0
|
||||
exef0t || addi r0,1
|
||||
|
||||
not r2 /* negate remainder */
|
||||
neg r3
|
||||
cmpeqi r3,0
|
||||
exef0t || addi r2,1
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
|
||||
.Lneg2: /* divisor & dividend negative */
|
||||
not r2 /* negate dividend */
|
||||
neg r3
|
||||
cmpeqi r3,0
|
||||
exef0t || addi r2,1
|
||||
|
||||
bl __udivmodsi4 /* do division */
|
||||
|
||||
not r2 /* negate remainder */
|
||||
neg r3
|
||||
cmpeqi r3,0
|
||||
exef0t || addi r2,1
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
|
||||
.Lneg3: /* divisor positive, dividend negative */
|
||||
st r13,@-sp
|
||||
not r2 /* negate dividend */
|
||||
neg r3
|
||||
cmpeqi r3,0
|
||||
exef0t || addi r2,1
|
||||
|
||||
bl __udivmodsi4 /* do division */
|
||||
|
||||
not r0 /* negate quotient */
|
||||
neg r1
|
||||
cmpeqi r1,0
|
||||
exef0t || addi r0,1
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
.size __divmodsi4,.-__divmodsi4
|
||||
.size __divsi3,.-__divsi3
|
||||
|
||||
.globl __modsi3
|
||||
.type __modsi3,@function
|
||||
__modsi3:
|
||||
st r13,@-sp
|
||||
bl __divmodsi4
|
||||
mv2w r0,r2
|
||||
ld r13,@sp+
|
||||
jmp r13
|
||||
.size __modsi3,.-__modsi3
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_cmpdi
|
||||
/* Signed compare 2 64-bit ints */
|
||||
|
||||
.file "__cmpdi.s"
|
||||
.text
|
||||
.globl __cmpdi
|
||||
.type __cmpdi,@function
|
||||
/* input: r0-r3 is first value to compare, second value to compare on stack */
|
||||
/* output: r0 is 0 if op0 < op1, 1 if op0 == op1, 2 if op0 > op1 */
|
||||
__cmpdi:
|
||||
ld2w r4,@sp /* compare first word */
|
||||
cmp r0,r4
|
||||
brf0t.s .Lneg
|
||||
cmp r4,r0
|
||||
brf0t.s .Lpos
|
||||
|
||||
cmpu r1,r5 /* compare second word */
|
||||
brf0t.s .Lneg
|
||||
cmpu r5,r1
|
||||
brf0t.s .Lpos
|
||||
|
||||
ld2w r4,@(4,sp) /* compare third word */
|
||||
cmpu r2,r4
|
||||
brf0t.s .Lneg
|
||||
cmpu r4,r2
|
||||
brf0t.s .Lpos
|
||||
|
||||
cmpu r3,r5 /* compare fourth word */
|
||||
brf0t.s .Lneg
|
||||
cmpu r5,r3
|
||||
brf0t.s .Lpos
|
||||
|
||||
ldi r0,1 /* op1 == op2 */
|
||||
jmp r13
|
||||
|
||||
.Lneg:
|
||||
ldi r0,0 /* op1 < op2 */
|
||||
jmp r13
|
||||
|
||||
.Lpos:
|
||||
ldi r0,2 /* op1 > op2 */
|
||||
jmp r13
|
||||
.size __cmpdi,.-__cmpdi
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_cmpdi0
|
||||
/* Signed compare 64-bit int against 0 */
|
||||
|
||||
.file "__cmpdi0.s"
|
||||
.text
|
||||
.globl __cmpdi0
|
||||
.type __cmpdi0,@function
|
||||
/* input: r0-r3 is value to compare */
|
||||
/* output: r0 is -1 if op0 < 0, 0 if op0 == 0, 1 if op0 > 0 */
|
||||
__cmpdi0:
|
||||
cmpi r0,0 /* compare first word */
|
||||
brf0t.s .Lneg
|
||||
cmpeqi r0,0
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r1,0 /* compare second word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r2,0 /* compare third word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r3,0 /* compare fourth word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
ldi r0,1 /* op1 == 0 */
|
||||
jmp r13
|
||||
|
||||
.Lneg:
|
||||
ldi r0,0 /* op1 < 0 */
|
||||
jmp r13
|
||||
|
||||
.Lpos:
|
||||
ldi r0,2 /* op1 > 0 */
|
||||
jmp r13
|
||||
.size __cmpdi0,.-__cmpdi0
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_ucmpdi
|
||||
/* Unsigned compare 2 64-bit ints */
|
||||
|
||||
.file "__ucmpdi.s"
|
||||
.text
|
||||
.globl __ucmpdi
|
||||
.type __ucmpdi,@function
|
||||
/* input: r0-r3 is first value to compare, second value to compare on stack */
|
||||
/* output: r0 is -1 if (unsigned)op0 < (unsigned)op1, 0 if op0 == op1, 1 if (unsigned)op0 > (unsigned)op1 */
|
||||
__ucmpdi:
|
||||
ld2w r4,@sp /* compare first word */
|
||||
cmpu r0,r4
|
||||
brf0t.s .Lneg
|
||||
cmpu r4,r0
|
||||
brf0t.s .Lpos
|
||||
|
||||
cmpu r1,r5 /* compare second word */
|
||||
brf0t.s .Lneg
|
||||
cmpu r5,r1
|
||||
brf0t.s .Lpos
|
||||
|
||||
ld2w r4,@(4,sp) /* compare third word */
|
||||
cmpu r2,r4
|
||||
brf0t.s .Lneg
|
||||
cmpu r4,r2
|
||||
brf0t.s .Lpos
|
||||
|
||||
cmpu r3,r5 /* compare fourth word */
|
||||
brf0t.s .Lneg
|
||||
cmpu r5,r3
|
||||
brf0t.s .Lpos
|
||||
|
||||
ldi r0,1 /* op1 == op2 */
|
||||
jmp r13
|
||||
|
||||
.Lneg:
|
||||
ldi r0,0 /* op1 < op2 */
|
||||
jmp r13
|
||||
|
||||
.Lpos:
|
||||
ldi r0,2 /* op1 > op2 */
|
||||
jmp r13
|
||||
.size __ucmpdi,.-__ucmpdi
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef L_ucmpdi0
|
||||
/* Unsigned compare 64-bit int against 0 */
|
||||
|
||||
.file "__ucmpdi0.s"
|
||||
.text
|
||||
.globl __ucmpdi0
|
||||
.type __ucmpdi0,@function
|
||||
/* input: r0-r3 is value to compare */
|
||||
/* output: r0 is 0 if op0 == 0, 1 if op0 > 0 */
|
||||
__ucmpdi0:
|
||||
cmpeqi r0,0 /* compare first word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r1,0 /* compare second word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r2,0 /* compare third word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
cmpeqi r3,0 /* compare fourth word */
|
||||
brf0f.s .Lpos
|
||||
|
||||
ldi r0,1 /* op1 == 0 */
|
||||
jmp r13
|
||||
|
||||
.Lpos:
|
||||
ldi r0,2 /* op1 > 0 */
|
||||
jmp r13
|
||||
.size __ucmpdi0,.-__ucmpdi0
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* special crt0 support for simulator
|
||||
*
|
||||
* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
* Written By Michael Meissner
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* In addition to the permissions in the GNU General Public License, the
|
||||
* Free Software Foundation gives you unlimited permission to link the
|
||||
* compiled version of this file with other programs, and to distribute
|
||||
* those programs without any restriction coming from the use of this
|
||||
* file. (The General Public License restrictions do apply in other
|
||||
* respects; for example, they cover modification of the file, and
|
||||
* distribution when not linked into another program.)
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* As a special exception, if you link this library with files
|
||||
* compiled with GCC to produce an executable, this does not cause
|
||||
* the resulting executable to be covered by the GNU General Public License.
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*/
|
||||
|
||||
.file "scrt0.s"
|
||||
.text
|
||||
.type _start,@function
|
||||
.globl _start
|
||||
_start: ldi r14,0
|
||||
ldi sp, _stack
|
||||
bl main
|
||||
stop
|
||||
.size _start,.-_start
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* special support for simulator
|
||||
*
|
||||
* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
* Written By Michael Meissner
|
||||
*
|
||||
* This file is free software * you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation * either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* In addition to the permissions in the GNU General Public License, the
|
||||
* Free Software Foundation gives you unlimited permission to link the
|
||||
* compiled version of this file with other programs, and to distribute
|
||||
* those programs without any restriction coming from the use of this
|
||||
* file. (The General Public License restrictions do apply in other
|
||||
* respects * for example, they cover modification of the file, and
|
||||
* distribution when not linked into another program.)
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY * without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program * see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* As a special exception, if you link this library with files
|
||||
* compiled with GCC to produce an executable, this does not cause
|
||||
* the resulting executable to be covered by the GNU General Public License.
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*/
|
||||
|
||||
.file "sim.s"
|
||||
.text
|
||||
|
||||
.globl printf
|
||||
.type printf,@function
|
||||
printf:
|
||||
trap 2
|
||||
jmp r13
|
||||
.size printf,.-printf
|
||||
|
||||
.globl putchar
|
||||
.type putchar,@function
|
||||
putchar:
|
||||
trap 3
|
||||
jmp r13
|
||||
.size putchar,.-putchar
|
||||
|
||||
.globl putstr
|
||||
.type putstr,@function
|
||||
putstr:
|
||||
trap 1
|
||||
jmp r13
|
||||
.size putstr,.-putstr
|
||||
|
||||
.globl exit
|
||||
.type exit,@function
|
||||
.globl _exit
|
||||
.type _exit,@function
|
||||
exit:
|
||||
_exit:
|
||||
ldi r6,1 -> trap 0 /* SYS_exit */
|
||||
stop
|
||||
.size exit,.-exit
|
||||
.size _exit,.-_exit
|
||||
|
||||
.globl abort
|
||||
.type aobrt,@function
|
||||
abort:
|
||||
ldi r2,amsg
|
||||
trap 1
|
||||
ldi r6,1 || ldi r2,1 /* SYS_exit & non-zero return code */
|
||||
trap 0 -> stop
|
||||
|
||||
.section .rodata
|
||||
amsg: .ascii "Abort called\n\0"
|
||||
@@ -1,30 +0,0 @@
|
||||
# Build libgcc1 from assembler sources
|
||||
LIBGCC1 = libgcc1-asm.a
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = d10v/libgcc1.asm
|
||||
LIB1ASMFUNCS = _ashlsi3 _ashrsi3 _lshrsi3 _mulsi3 _udivmodhi4 _divmodhi4 _udivmodsi4 _divmodsi4 _cmpdi _cmpdi0 _ucmpdi _ucmpdi0
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define CMPtype HItype' > dp-bit.c
|
||||
echo '#define SMALL_MACHINE' >> dp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#define CMPtype HItype' >> fp-bit.c
|
||||
echo '#define SMALL_MACHINE' >> fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
# Build libgcc.a with different options.
|
||||
|
||||
MULTILIB_OPTIONS = mint16/mint32 mdouble32/mdouble64
|
||||
MULTILIB_DIRNAMES = int16 int32 dbl32 dbl64
|
||||
MULTILIB_MATCHES =
|
||||
MULTILIB_EXCEPTIONS =
|
||||
|
||||
LIBGCC = stmp-multilib
|
||||
INSTALL_LIBGCC = install-multilib
|
||||
@@ -1,77 +0,0 @@
|
||||
/* Configuration for Mitsubishi D10V.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Support.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#if __INT_MAX__==32767
|
||||
#define HOST_BITS_PER_INT 16
|
||||
#else
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#endif
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* Declare all of the functions in string.h and malloc functions when
|
||||
compiling libgcc2 with -mint32 so that we account for size_t being
|
||||
a short. */
|
||||
#ifdef __D10V__
|
||||
#include <stddef.h>
|
||||
|
||||
void *memchr(const void *, int, size_t);
|
||||
int memcmp(const void *, const void *, size_t);
|
||||
void *memcpy(void *, const void *, size_t);
|
||||
void *memmove(void *, const void *, size_t);
|
||||
void *memset(void *, int, size_t);
|
||||
char *strcat(char *, const char *);
|
||||
char *strchr(const char *, int);
|
||||
int strcmp(const char *, const char *);
|
||||
int strcoll(const char *, const char *);
|
||||
char *strcpy(char *, const char *);
|
||||
size_t strcspn(const char *, const char *);
|
||||
char *strerror(int);
|
||||
size_t strlen(const char *);
|
||||
char *strncat(char *, const char *, size_t);
|
||||
int strncmp(const char *, const char *, size_t);
|
||||
char *strncpy(char *, const char *, size_t);
|
||||
char *strpbrk(const char *, const char *);
|
||||
char *strrchr(const char *, int);
|
||||
size_t strspn(const char *, const char *);
|
||||
char *strstr(const char *, const char *);
|
||||
int ffs(int);
|
||||
|
||||
extern void *malloc (size_t);
|
||||
extern void *realloc (void *, size_t);
|
||||
extern void free (void *);
|
||||
#endif
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
|
||||
#include "tm.h"
|
||||
@@ -1,234 +0,0 @@
|
||||
CYGNUS LOCAL -- meissner/d30v
|
||||
-*- Text -*-
|
||||
|
||||
This document describes the proposed ABI for the D30V processor. This is
|
||||
revision 2 of the document.
|
||||
|
||||
Revision history:
|
||||
|
||||
Revision 1:
|
||||
Original revision of this document.
|
||||
|
||||
Revision 2:
|
||||
Done after consultation with Mitsubshi about the calling sequence.
|
||||
This revision now reduces the number of registers the compiler will not
|
||||
touch from 18 registers down to 8.
|
||||
|
||||
Register 1 is now a normal temporary register, since mvfacc rx,ay,32 is
|
||||
legal.
|
||||
|
||||
Arguments greater than 4 bytes must be passed in an even register or at
|
||||
a double word alignment.
|
||||
|
||||
The va_list type is a structure, not a char *.
|
||||
|
||||
The stack must be aligned to 8 byte boundary. Doubles and long longs
|
||||
must also be aligned to 8 byte boundaries.
|
||||
|
||||
System calls are specified via trap 31.
|
||||
|
||||
Revision 3:
|
||||
I added discussion about compiler switches.
|
||||
|
||||
Register usage:
|
||||
===============
|
||||
|
||||
Registers Call Status Usage
|
||||
--------- ----------- -----
|
||||
R0 hardware Hardwired to 0
|
||||
R1 volatile temp
|
||||
R2 volatile Arg 1 and main return value.
|
||||
R3 volatile Arg 2 and low bits of 64 bit returns
|
||||
R4 - R17 volatile Args 3-16
|
||||
R18 volatile Static chain if used
|
||||
R19 - R25 volatile temps
|
||||
R26 - R33 saved Reserved for user use
|
||||
R34 - R60 saved Registers preserved across calls
|
||||
R61 saved Frame pointer if needed.
|
||||
R62 saved Return address pointer (hardware)
|
||||
R63 saved Stack pointer
|
||||
CR0 - CR3 hardware {normal,backup} {psw,pc}
|
||||
CR4 - CR6 hardware Reserved for future use
|
||||
CR7 - CR9 volatile Repeat count, addresses
|
||||
CR10 - CR11 saved Modulo start/end
|
||||
CR12 - CR14 hardware Reserved for future use
|
||||
CR15 - CR17 hardware Interrupt support
|
||||
F0 - F1 volatile Execution flags
|
||||
F2 - F3 volatile General flags
|
||||
F4 - F7 volatile Special purpose flags
|
||||
A0 volatile Accumulator
|
||||
A1 saved Accumulator
|
||||
|
||||
Notes on the register usage:
|
||||
============================
|
||||
|
||||
1) R61 will hold the frame pointer if it is needed. Normally the frame
|
||||
pointer will not be needed, in which case this will become another
|
||||
saved register.
|
||||
|
||||
2) Repeat instructions and delayed branches cannot cross call boundaries.
|
||||
Similarly, all flags are assumed to not be preserved across calls.
|
||||
|
||||
3) Since so many registers are available, I reserved 8 registers (r26-r33)
|
||||
for the user to use for any purpose (global variables, interrupt
|
||||
routines, thread pointer, etc.). These registers will not be used by
|
||||
the compiler for any purpose.
|
||||
|
||||
4) One of the two accumulators is saved across calls.
|
||||
|
||||
5) Doubles and long longs will only be allocated to even/odd register
|
||||
pairs to allow use of the ld2w/st2w instructions.
|
||||
|
||||
Miscellaneous call information:
|
||||
===============================
|
||||
|
||||
1) Structures are passed in registers, rounding them up to word
|
||||
boundaries.
|
||||
|
||||
2) Any argument that is greater than word size (4 bytes) must be aligned
|
||||
to a double word boundary and/or start in an even register. The
|
||||
intention here is to be able to use the ld2w/st2w instructions for
|
||||
moving doubles and long longs.
|
||||
|
||||
3) Variable argument functions are called with the same calling sequence
|
||||
as non-variable argument functions. When called, a variable argument
|
||||
function first saves the 16 registers (R2 - R17) used for passing
|
||||
arguments. The va_list type is a structure. The first element of the
|
||||
structure is a pointer to the first word saved on the stack, and the
|
||||
second element is a number that gives which argument number is being
|
||||
processed.
|
||||
|
||||
4) Word and double word sized structures/unions are returned in registers,
|
||||
other functions returning structures expect a temporary area address to
|
||||
be passed as the first argument.
|
||||
|
||||
|
||||
The stack frame when a function is called looks like:
|
||||
|
||||
high | .... |
|
||||
+-------------------------------+
|
||||
| Argument word #20 |
|
||||
+-------------------------------+
|
||||
| Argument word #19 |
|
||||
+-------------------------------+
|
||||
| Argument word #18 |
|
||||
+-------------------------------+
|
||||
| Argument word #17 |
|
||||
low SP----> +-------------------------------+
|
||||
|
||||
After the prologue is executed, the stack frame will look like:
|
||||
|
||||
high | .... |
|
||||
+-------------------------------+
|
||||
| Argument word #20 |
|
||||
+-------------------------------+
|
||||
| Argument word #19 |
|
||||
+-------------------------------+
|
||||
| Argument word #18 |
|
||||
+-------------------------------+
|
||||
| Argument word #17 |
|
||||
Prev sp +-------------------------------+
|
||||
| |
|
||||
| Save for arguments 1..16 if |
|
||||
| the func. uses stdarg/varargs |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Save area for preserved regs |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Local variables |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| alloca space if used |
|
||||
| |
|
||||
+-------------------------------+
|
||||
| |
|
||||
| Space for outgoing arguments |
|
||||
| |
|
||||
low SP----> +-------------------------------+
|
||||
|
||||
System Calls
|
||||
============
|
||||
|
||||
System calls will be done using "TRAP 31". Input arguments will be in R2 - R5,
|
||||
and the system call number will be in R6. Return values from the system call
|
||||
will be in R2. Negative values of the return indicate the system call failed,
|
||||
and the value is the negative of the error code. Here are the assigned system
|
||||
call numbers (value in R6):
|
||||
|
||||
exit 1
|
||||
open 2
|
||||
close 3
|
||||
read 4
|
||||
write 5
|
||||
lseek 6
|
||||
unlink 7
|
||||
getpid 8
|
||||
kill 9
|
||||
fstat 10
|
||||
(11 is reserved for sbrk)
|
||||
argvlen 12
|
||||
argv 13
|
||||
chdir 14
|
||||
stat 15
|
||||
chmod 16
|
||||
utime 17
|
||||
time 18
|
||||
|
||||
Compiler Switches
|
||||
=================
|
||||
|
||||
The following d30v specific compiler switches are currently supported:
|
||||
|
||||
-mextmem Link .text/.data/.bss/etc in external memory.
|
||||
|
||||
-mextmemory Same as -mextmem.
|
||||
|
||||
-monchip Link .text/.data/.bss/etc in the onchip data/text
|
||||
memory.
|
||||
|
||||
-mno-asm-optimize Do not pass -O to the assembler when optimizing (the -O
|
||||
switch will mark two short instructions that don't
|
||||
interfere with each other as being done parallel
|
||||
instead of sequentially).
|
||||
|
||||
-masm-optimize [default] If optimizing, pass -O to the assembler.
|
||||
|
||||
-mbranch-cost=n Increase the internal costs of branches to n. Higher
|
||||
costs means that the compiler will issue more
|
||||
instructions to avoid doing a branch. The default is
|
||||
2.
|
||||
|
||||
-mcond-exec=n Replace branches around n insns with conditional
|
||||
execution if we can. Default is 4.
|
||||
|
||||
|
||||
Sections
|
||||
========
|
||||
|
||||
You can override the effect of the -mextmem/-monchip options by putting
|
||||
functions into either the ".stext" or ".etext" sections. If you put them into
|
||||
the ".stext" section, the linker will always link the function into the onchip
|
||||
memory area. Similarly, if you put the function in the ".etext" section, the
|
||||
linker will always link the function into the external memory area.
|
||||
|
||||
Data can be controlled as well. If you put the data in the ".sdata" section,
|
||||
the linker will put the data into the onchip data area. Similarly, if you put
|
||||
the data in the ".edata" section, the linker will put the data into the
|
||||
external memory.
|
||||
|
||||
|
||||
Stack pointer
|
||||
=============
|
||||
|
||||
The crt0.o that we ship loads up the stack pointer with the value of the label
|
||||
__stack. If you do not define a value for __stack, the linker will choose the
|
||||
top of the onchip data area (0x20008000) for the stack pointer. You can set a
|
||||
new value via the options:
|
||||
|
||||
-Wl,-defsym,__stack=0x20008000
|
||||
|
||||
END CYGNUS LOCAL -- meissner/d30v
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,193 +0,0 @@
|
||||
/* CYGNUS LOCAL -- meissner/d30v */
|
||||
/* Assembly support functions for libgcc1.
|
||||
*
|
||||
* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
* Contributed by Cygnus Support
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* In addition to the permissions in the GNU General Public License, the
|
||||
* Free Software Foundation gives you unlimited permission to link the
|
||||
* compiled version of this file with other programs, and to distribute
|
||||
* those programs without any restriction coming from the use of this
|
||||
* file. (The General Public License restrictions do apply in other
|
||||
* respects; for example, they cover modification of the file, and
|
||||
* distribution when not linked into another program.)
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* As a special exception, if you link this library with files
|
||||
* compiled with GCC to produce an executable, this does not cause
|
||||
* the resulting executable to be covered by the GNU General Public License.
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef L_udivsi3
|
||||
|
||||
/* For division, we use the following algorithm:
|
||||
*
|
||||
* unsigned
|
||||
* __divsi3 (unsigned a, unsigned b)
|
||||
* {
|
||||
* unsigned al = a;
|
||||
* unsigned ah = 0;
|
||||
* unsigned tmpf;
|
||||
* int i;
|
||||
*
|
||||
* for (i = 32; i > 0; i--)
|
||||
* {
|
||||
* ah = (ah << 1) | (al >> 31);
|
||||
* tmpf = (ah >= b) ? 1 : 0;
|
||||
* ah -= ((tmpf) ? b : 0);
|
||||
* al = (al << 1) | tmpf;
|
||||
* }
|
||||
*
|
||||
* return al; // for __udivsi3
|
||||
* return ah; // for __umodsi3
|
||||
* }
|
||||
*/
|
||||
|
||||
.file "_udivsi3"
|
||||
.text
|
||||
.globl __umodsi3
|
||||
.globl __udivsi3
|
||||
.type __umodsi3,@function
|
||||
.type __udivsi3,@function
|
||||
.stabs "libgcc1.asm",100,0,0,__umodsi3
|
||||
.stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0
|
||||
.stabs "__umodsi3:F(0,1)",36,0,1,__umodsi3
|
||||
.stabs "a:P(0,1)",64,0,1,2
|
||||
.stabs "b:P(0,1)",64,0,1,3
|
||||
|
||||
__umodsi3:
|
||||
bra.s .Lmerge || orfg f1,f1,1 ; indicate this is __umodsi3
|
||||
.Lumod:
|
||||
.size __umodsi3,.Lumod-__umodsi3
|
||||
.stabs "",36,0,0,.Lumod-__umodsi3
|
||||
|
||||
.stabs "__udivsi3:F(0,1)",36,0,1,__udivsi3
|
||||
.stabs "a:P(0,1)",64,0,1,2
|
||||
.stabs "b:P(0,1)",64,0,1,3
|
||||
__udivsi3:
|
||||
andfg f1,f1,0 || nop ; indicate this is __udivsi3
|
||||
|
||||
.Lmerge:
|
||||
; r2 = al
|
||||
; r3 = b
|
||||
; r4 = ah
|
||||
; r5 = loop counter
|
||||
; f0 = tmpf
|
||||
; f1 = 1 if this is mod, 0 if this is div
|
||||
or r4,r0,0 || sub r5,r0,-32 ; ah = 0, loop = 32
|
||||
|
||||
.Lloop:
|
||||
src r4,r2,-1 || sub r5,r5,1 ; ah = (ah << 1) | (al >> 31); decrement loop count
|
||||
cmpuge f0,r4,r3 || sra r2,r2,-1 ; f0 = (ah >= b); al <<= 1
|
||||
sub/tx r4,r4,r3 || or/tx r2,r2,1 ; ah -= (tmpf) ? b : 0; al |= tmpf
|
||||
bratnz.s r5,.Lloop || nop ; loop back if not done
|
||||
jmp link || or/xt r2,r0,r4 ; if mod, update register, then return to user
|
||||
.Ludiv:
|
||||
.size __udivsi3,.Ludiv-__udivsi3
|
||||
.stabs "",36,0,0,.Ludiv-__udivsi3
|
||||
|
||||
#endif /* L_udivsi3 */
|
||||
|
||||
|
||||
#ifdef L_divsi3
|
||||
|
||||
/* For division, we use the following algorithm:
|
||||
*
|
||||
* unsigned
|
||||
* __divsi3 (unsigned a, unsigned b)
|
||||
* {
|
||||
* unsigned al = __builtin_abs (a);
|
||||
* unsigned b2 = __builtin_abs (b);
|
||||
* unsigned ah = 0;
|
||||
* unsigned tmpf;
|
||||
* int i;
|
||||
*
|
||||
* for (i = 32; i > 0; i--)
|
||||
* {
|
||||
* ah = (ah << 1) | (al >> 31);
|
||||
* tmpf = (ah >= b2) ? 1 : 0;
|
||||
* ah -= ((tmpf) ? b2 : 0);
|
||||
* al = (al << 1) | tmpf;
|
||||
* }
|
||||
*
|
||||
* if (a < 0)
|
||||
* ah = -ah, al = -al;
|
||||
*
|
||||
* if (b < 0)
|
||||
* al = -al;
|
||||
*
|
||||
* return al; // for __divsi3
|
||||
* return ah; // for __modsi3
|
||||
* }
|
||||
*/
|
||||
|
||||
.file "_divsi3"
|
||||
.text
|
||||
.globl __modsi3
|
||||
.globl __divsi3
|
||||
.type __modsi3,@function
|
||||
.type __divsi3,@function
|
||||
.stabs "libgcc1.asm",100,0,0,__modsi3
|
||||
.stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0
|
||||
.stabs "__modsi3:F(0,1)",36,0,1,__modsi3
|
||||
.stabs "a:P(0,1)",64,0,1,2
|
||||
.stabs "b:P(0,1)",64,0,1,3
|
||||
|
||||
__modsi3:
|
||||
bra.s .Lmerge || orfg f1,f1,1 ; indicate this is __modsi3
|
||||
.Lmod:
|
||||
.size __modsi3,.Lmod-__modsi3
|
||||
.stabs "",36,0,0,.Lmod-__modsi3
|
||||
|
||||
.stabs "__divsi3:F(0,1)",36,0,1,__divsi3
|
||||
.stabs "a:P(0,1)",64,0,1,2
|
||||
.stabs "b:P(0,1)",64,0,1,3
|
||||
__divsi3:
|
||||
andfg f1,f1,0 || nop ; indicate this is __divsi3
|
||||
|
||||
.Lmerge:
|
||||
; r2 = al
|
||||
; r3 = b2
|
||||
; r4 = ah
|
||||
; r5 = loop counter
|
||||
; r6 = a
|
||||
; r7 = b
|
||||
; f0 = tmpf
|
||||
; f1 = 1 if this is mod, 0 if this is div
|
||||
or r6,r0,r2 || or r7,r0,r3 ; copy original inputs
|
||||
abs r2,r2 || abs r3,r3 ; make both postive
|
||||
or r4,r0,0 || sub r5,r0,-32 ; ah = 0, loop = 32
|
||||
|
||||
.Lloop:
|
||||
src r4,r2,-1 || sub r5,r5,1 ; ah = (ah << 1) | (al >> 31); decrement loop count
|
||||
cmpuge f0,r4,r3 || sra r2,r2,-1 ; f0 = (ah >= b); al <<= 1
|
||||
sub/tx r4,r4,r3 || or/tx r2,r2,1 ; ah -= (tmpf) ? b : 0; al |= tmpf
|
||||
bratnz.s r5,.Lloop || nop ; loop back if not done
|
||||
cmplt f0,r6,0 || nop ; f0 = (a < 0)
|
||||
|
||||
sub/tx r2,r0,r2 || sub/tx r4,r0,r4 ; negate both al, ah if (a < 0)
|
||||
cmplt f0,r7,0 -> sub/tx r2,r0,r2 ; negate al if (b < 0)
|
||||
jmp link || or/xt r2,r0,r4 ; update result if mod; return to user
|
||||
.Ldiv:
|
||||
.size __divsi3,.Ldiv-__divsi3
|
||||
.stabs "",36,0,0,.Ldiv-__divsi3
|
||||
|
||||
#endif /* L_divsi3 */
|
||||
/* END CYGNUS LOCAL -- meissner/d30v */
|
||||
@@ -1,36 +0,0 @@
|
||||
# CYGNUS LOCAL -- meissner/d30v
|
||||
# Build libgcc1 from assembler sources
|
||||
LIBGCC1 = libgcc1-asm.a
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = d30v/libgcc1.asm
|
||||
LIB1ASMFUNCS = _udivsi3 _divsi3
|
||||
|
||||
# Turn on full debug for libgcc.a.
|
||||
LIBGCC2_DEBUG_CFLAGS = -g
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c config.status
|
||||
cat $(srcdir)/config/fp-bit.c > dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c config.status
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#define _fpadd_parts _fpadd_parts_sf' >> fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
# For svr4 we build crtbegin.o and crtend.o which serve to add begin and
|
||||
# end labels to the .ctors and .dtors section when we link using gcc.
|
||||
|
||||
EXTRA_PARTS=crtbegin.o crtend.o
|
||||
|
||||
# We need to use -fPIC when we are using gcc to compile the routines in
|
||||
# crtstuff.c. This is only really needed when we are going to use gcc/g++
|
||||
# to produce a shared library, but since we don't know ahead of time when
|
||||
# we will be doing that, we just always use -fPIC when compiling the
|
||||
# routines in crtstuff.c.
|
||||
|
||||
# Right now, disable, since we don't support shared libraries on d30v yet.
|
||||
#CRTSTUFF_T_CFLAGS = -fPIC
|
||||
# END CYGNUS LOCAL --meissner/d30v
|
||||
@@ -1,199 +0,0 @@
|
||||
/* CYGNUS LOCAL -- meissner/d30v */
|
||||
/* Definitions of target machine for use as an example.
|
||||
Hack to fit.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* Define this macro if the host system is System V. */
|
||||
/* #define USG */
|
||||
|
||||
/* Define this macro if the host system is VMS. */
|
||||
/* #define VMS */
|
||||
|
||||
/* A C expression for the status code to be returned when the compiler exits
|
||||
after serious errors. */
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* A C expression for the status code to be returned when the compiler exits
|
||||
without serious errors. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
|
||||
/* Defined if the host machine stores words of multi-word values in big-endian
|
||||
order. (GNU CC does not depend on the host byte ordering within a word.) */
|
||||
#define HOST_WORDS_BIG_ENDIAN
|
||||
|
||||
/* Define this macro to be 1 if the host machine stores `DFmode', `XFmode' or
|
||||
`TFmode' floating point numbers in memory with the word containing the sign
|
||||
bit at the lowest address; otherwise, define it to be zero.
|
||||
|
||||
This macro need not be defined if the ordering is the same as for multi-word
|
||||
integers. */
|
||||
/* #define HOST_FLOAT_WORDS_BIG_ENDIAN */
|
||||
|
||||
/* A numeric code distinguishing the floating point format for the host
|
||||
machine. See `TARGET_FLOAT_FORMAT' in *Note Storage Layout:: for the
|
||||
alternatives and default. */
|
||||
/* #define HOST_FLOAT_FORMAT */
|
||||
|
||||
/* A C expression for the number of bits in `char' on the host machine. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
|
||||
/* A C expression for the number of bits in `short' on the host machine. */
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
|
||||
/* A C expression for the number of bits in `int' on the host machine. */
|
||||
#define HOST_BITS_PER_INT 32
|
||||
|
||||
/* A C expression for the number of bits in `long' on the host machine. */
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
|
||||
/* Define this macro to indicate that the host compiler only supports `int' bit
|
||||
fields, rather than other integral types, including `enum', as do most C
|
||||
compilers. */
|
||||
/* #define ONLY_INT_FIELDS */
|
||||
|
||||
/* A C expression for the size of ordinary obstack chunks. If you don't define
|
||||
this, a usually-reasonable default is used. */
|
||||
/* #define OBSTACK_CHUNK_SIZE */
|
||||
|
||||
/* The function used to allocate obstack chunks. If you don't define this,
|
||||
`xmalloc' is used. */
|
||||
/* #define OBSTACK_CHUNK_ALLOC */
|
||||
|
||||
/* The function used to free obstack chunks. If you don't define this, `free'
|
||||
is used. */
|
||||
/* #define OBSTACK_CHUNK_FREE */
|
||||
|
||||
/* Define this macro to indicate that the compiler is running with the `alloca'
|
||||
implemented in C. This version of `alloca' can be found in the file
|
||||
`alloca.c'; to use it, you must also alter the `Makefile' variable `ALLOCA'.
|
||||
(This is done automatically for the systems on which we know it is needed.)
|
||||
|
||||
If you do define this macro, you should probably do it as follows:
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define USE_C_ALLOCA
|
||||
#else
|
||||
#define alloca __builtin_alloca
|
||||
#endif
|
||||
|
||||
so that when the compiler is compiled with GNU CC it uses the more efficient
|
||||
built-in `alloca' function. */
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define USE_C_ALLOCA
|
||||
#else
|
||||
#define alloca __builtin_alloca
|
||||
#endif
|
||||
|
||||
/* Define this macro to indicate that the host compiler does not properly
|
||||
handle converting a function value to a pointer-to-function when it is used
|
||||
in an expression. */
|
||||
/* #define FUNCTION_CONVERSION_BUG */
|
||||
|
||||
/* Define this if the library function `vprintf' is available on your system. */
|
||||
/* #define HAVE_VPRINTF */
|
||||
|
||||
/* Define this macro to enable support for multibyte characters in the input to
|
||||
GNU CC. This requires that the host system support the ANSI C library
|
||||
functions for converting multibyte characters to wide characters. */
|
||||
/* #define MULTIBYTE_CHARS */
|
||||
|
||||
/* Define this if the library function `putenv' is available on your system. */
|
||||
/* #define HAVE_PUTENV */
|
||||
|
||||
/* Define this if your system is POSIX.1 compliant. */
|
||||
/* #define POSIX */
|
||||
|
||||
/* Define this if your system *does not* provide the variable `sys_siglist'. */
|
||||
/* #define NO_SYS_SIGLIST */
|
||||
|
||||
/* Define this if your system has the variable `sys_siglist', and there is
|
||||
already a declaration of it in the system header files. */
|
||||
/* #define DONT_DECLARE_SYS_SIGLIST */
|
||||
|
||||
/* Define this to be 1 if you know that the host compiler supports prototypes,
|
||||
even if it doesn't define __STDC__, or define it to be 0 if you do not want
|
||||
any prototypes used in compiling GNU CC. If `USE_PROTOTYPES' is not
|
||||
defined, it will be determined automatically whether your compiler supports
|
||||
prototypes by checking if `__STDC__' is defined. */
|
||||
/* #define USE_PROTOTYPES */
|
||||
|
||||
/* Define this if you wish suppression of prototypes generated from the machine
|
||||
description file, but to use other prototypes within GNU CC. If
|
||||
`USE_PROTOTYPES' is defined to be 0, or the host compiler does not support
|
||||
prototypes, this macro has no effect. */
|
||||
/* #define NO_MD_PROTOTYPES */
|
||||
|
||||
/* Define this if you wish to generate prototypes for the `gen_call' or
|
||||
`gen_call_value' functions generated from the machine description file. If
|
||||
`USE_PROTOTYPES' is defined to be 0, or the host compiler does not support
|
||||
prototypes, or `NO_MD_PROTOTYPES' is defined, this macro has no effect. As
|
||||
soon as all of the machine descriptions are modified to have the appropriate
|
||||
number of arguments, this macro will be removed.
|
||||
|
||||
Some systems do provide this variable, but with a different name such as
|
||||
`_sys_siglist'. On these systems, you can define `sys_siglist' as a macro
|
||||
which expands into the name actually provided. */
|
||||
/* #define MD_CALL_PROTOTYPES */
|
||||
|
||||
/* Define this macro to be a C character constant representing the character
|
||||
used to separate components in paths. The default value is. the colon
|
||||
character */
|
||||
/* #define PATH_SEPARATOR */
|
||||
|
||||
/* If your system uses some character other than slash to separate directory
|
||||
names within a file specification, define this macro to be a C character
|
||||
constant specifying that character. When GNU CC displays file names, the
|
||||
character you specify will be used. GNU CC will test for both slash and the
|
||||
character you specify when parsing filenames. */
|
||||
/* #define DIR_SEPARATOR */
|
||||
|
||||
/* Define this macro to be a C string representing the suffix for object files
|
||||
on your machine. If you do not define this macro, GNU CC will use `.o' as
|
||||
the suffix for object files. */
|
||||
/* #define OBJECT_SUFFIX */
|
||||
|
||||
/* Define this macro to be a C string representing the suffix for executable
|
||||
files on your machine. If you do not define this macro, GNU CC will use the
|
||||
null string as the suffix for object files. */
|
||||
/* #define EXECUTABLE_SUFFIX */
|
||||
|
||||
/* If defined, `collect2' will scan the individual object files specified on
|
||||
its command line and create an export list for the linker. Define this
|
||||
macro for systems like AIX, where the linker discards object files that are
|
||||
not referenced from `main' and uses export lists. */
|
||||
/* #define COLLECT_EXPORT_LIST */
|
||||
|
||||
/* In addition, configuration files for system V define `bcopy', `bzero' and
|
||||
`bcmp' as aliases. Some files define `alloca' as a macro when compiled with
|
||||
GNU CC, in order to take advantage of the benefit of GNU CC's built-in
|
||||
`alloca'. */
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* end of xm-generic.h */
|
||||
/* END CYGNUS LOCAL -- meissner/d30v */
|
||||
@@ -1,30 +0,0 @@
|
||||
/* Prefer DBX (stabs) debugging information.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file causes gcc to prefer using DBX (stabs) debugging
|
||||
information. The configure script will add a #include of this file
|
||||
to tm.h when --with-stabs is used for certain targets. */
|
||||
|
||||
#ifndef DBX_DEBUGGING_INFO
|
||||
#define DBX_DEBUGGING_INFO
|
||||
#endif
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
@@ -1,87 +0,0 @@
|
||||
/* Definitions needed when using stabs embedded in COFF sections.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file may be included by any COFF target which wishes to
|
||||
support -gstabs generating stabs in sections, as produced by gas
|
||||
and understood by gdb. */
|
||||
|
||||
/* Output DBX (stabs) debugging information if doing -gstabs. */
|
||||
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
#define DBX_DEBUGGING_INFO
|
||||
|
||||
/* Generate SDB debugging information by default. */
|
||||
|
||||
#ifndef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
|
||||
#endif
|
||||
|
||||
/* Be function-relative for block and source line stab directives. */
|
||||
|
||||
#undef DBX_BLOCKS_FUNCTION_RELATIVE
|
||||
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
|
||||
|
||||
/* but, to make this work, functions must appear prior to line info. */
|
||||
|
||||
#undef DBX_FUNCTION_FIRST
|
||||
#define DBX_FUNCTION_FIRST
|
||||
|
||||
/* Generate a blank trailing N_SO to mark the end of the .o file, since
|
||||
we can't depend upon the linker to mark .o file boundaries with
|
||||
embedded stabs. */
|
||||
|
||||
#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
|
||||
#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
|
||||
fprintf (FILE, \
|
||||
"\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
|
||||
|
||||
/* Like block addresses, stabs line numbers are relative to the
|
||||
current function. */
|
||||
|
||||
#undef ASM_OUTPUT_SOURCE_LINE
|
||||
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
|
||||
{ if (write_symbols == SDB_DEBUG) { \
|
||||
fprintf ((FILE), "\t.ln\t%d\n", \
|
||||
((sdb_begin_function_line > -1) \
|
||||
? (LINE) - sdb_begin_function_line : 1)); \
|
||||
} else if (write_symbols == DBX_DEBUG) { \
|
||||
static int sym_lineno = 1; \
|
||||
char buffer[256]; \
|
||||
ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
|
||||
fprintf (FILE, ".stabn 68,0,%d,", LINE); \
|
||||
assemble_name (FILE, buffer); \
|
||||
putc ('-', FILE); \
|
||||
assemble_name (FILE, \
|
||||
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
|
||||
putc ('\n', FILE); \
|
||||
ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
|
||||
sym_lineno++; \
|
||||
} }
|
||||
|
||||
/* When generating stabs debugging, use N_BINCL entries. */
|
||||
|
||||
#undef DBX_USE_BINCL
|
||||
#define DBX_USE_BINCL
|
||||
|
||||
/* There is no limit to the length of stabs strings. */
|
||||
|
||||
#ifndef DBX_CONTIN_LENGTH
|
||||
#define DBX_CONTIN_LENGTH 0
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
||||
/* Configuration file for GNU CC for AT&T DSP1600.
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
Contributed by Michael Collison (collison@world.std.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 16
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* If compiled with GNU C, use the built-in alloca */
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else
|
||||
#define USE_C_ALLOCA
|
||||
#endif
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
@@ -1,754 +0,0 @@
|
||||
/* elfos.h -- operating system specific defines to be used when
|
||||
targeting GCC for some generic ELF system
|
||||
Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||
Based on svr4.h contributed by Ron Guilmette (rfg@netcom.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* For the sake of libgcc2.c, indicate target supports atexit. */
|
||||
#define HAVE_ATEXIT
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtend.o%s"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "%{!shared: \
|
||||
%{!symbolic: \
|
||||
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
|
||||
crtbegin.o%s"
|
||||
|
||||
/* Attach a special .ident directive to the end of the file to identify
|
||||
the version of GCC which compiled this code. The format of the
|
||||
.ident string is patterned after the ones produced by native svr4
|
||||
C compilers. */
|
||||
|
||||
#define IDENT_ASM_OP ".ident"
|
||||
|
||||
#define ASM_FILE_END(FILE) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \
|
||||
IDENT_ASM_OP, version_string); \
|
||||
} while (0)
|
||||
|
||||
/* Output #ident as a .ident. */
|
||||
|
||||
#define ASM_OUTPUT_IDENT(FILE, NAME) \
|
||||
fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
|
||||
|
||||
/* Use periods rather than dollar signs in special g++ assembler names. */
|
||||
|
||||
#define NO_DOLLAR_IN_LABEL
|
||||
|
||||
/* Writing `int' for a bitfield forces int alignment for the structure. */
|
||||
|
||||
#define PCC_BITFIELD_TYPE_MATTERS 1
|
||||
|
||||
/* Implicit library calls should use memcpy, not bcopy, etc. */
|
||||
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
/* Handle #pragma weak and #pragma pack. */
|
||||
|
||||
#define HANDLE_SYSV_PRAGMA
|
||||
|
||||
/* System V Release 4 uses DWARF debugging info. */
|
||||
|
||||
#define DWARF_DEBUGGING_INFO
|
||||
|
||||
/* All ELF targets can support DWARF-2. */
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
|
||||
/* gas on SVR4 supports the use of .stabs. Permit -gstabs to be used
|
||||
in general, although it will only work when using gas. */
|
||||
|
||||
#define DBX_DEBUGGING_INFO
|
||||
|
||||
/* The GNU tools operate better with stabs. Since we don't have
|
||||
any native tools to be compatible with, default to stabs. */
|
||||
|
||||
#ifndef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
#endif
|
||||
|
||||
/* Make LBRAC and RBRAC addresses relative to the start of the
|
||||
function. The native Solaris stabs debugging format works this
|
||||
way, gdb expects it, and it reduces the number of relocation
|
||||
entries. */
|
||||
|
||||
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
|
||||
|
||||
/* When using stabs, gcc2_compiled must be a stabs entry, not an
|
||||
ordinary symbol, or gdb won't see it. Furthermore, since gdb reads
|
||||
the input piecemeal, starting with each N_SO, it's a lot easier if
|
||||
the gcc2 flag symbol is *after* the N_SO rather than before it. So
|
||||
we emit an N_OPT stab there. */
|
||||
|
||||
#define ASM_IDENTIFY_GCC(FILE) \
|
||||
do \
|
||||
{ \
|
||||
if (write_symbols != DBX_DEBUG) \
|
||||
fputs ("gcc2_compiled.:\n", FILE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \
|
||||
do \
|
||||
{ \
|
||||
if (write_symbols == DBX_DEBUG) \
|
||||
fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Like block addresses, stabs line numbers are relative to the
|
||||
current function. */
|
||||
|
||||
#undef ASM_OUTPUT_SOURCE_LINE
|
||||
#define ASM_OUTPUT_SOURCE_LINE(file, line) \
|
||||
do \
|
||||
{ \
|
||||
static int sym_lineno = 1; \
|
||||
fprintf (file, "\t.stabn 68,0,%d,.LM%d-", \
|
||||
line, sym_lineno); \
|
||||
assemble_name (file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
|
||||
fprintf (file, "\n.LM%d:\n", sym_lineno); \
|
||||
sym_lineno += 1; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* In order for relative line numbers to work, we must output the
|
||||
stabs entry for the function name first. */
|
||||
|
||||
#define DBX_FUNCTION_FIRST
|
||||
|
||||
#undef ASM_BYTE_OP
|
||||
#define ASM_BYTE_OP ".byte"
|
||||
|
||||
#undef SET_ASM_OP
|
||||
#define SET_ASM_OP ".set"
|
||||
|
||||
/* This is how to begin an assembly language file. Most svr4 assemblers want
|
||||
at least a .file directive to come first, and some want to see a .version
|
||||
directive come right after that. Here we just establish a default
|
||||
which generates only the .file directive. If you need a .version
|
||||
directive for any specific target, you should override this definition
|
||||
in the target-specific file which includes this one. */
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
output_file_directive ((FILE), main_input_filename)
|
||||
|
||||
/* This is how to allocate empty space in some section. The .zero
|
||||
pseudo-op is used for this on most svr4 assemblers. */
|
||||
|
||||
#define SKIP_ASM_OP ".zero"
|
||||
|
||||
#undef ASM_OUTPUT_SKIP
|
||||
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
|
||||
fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
|
||||
|
||||
/* This is how to output a reference to a user-level label named NAME.
|
||||
`assemble_name' uses this.
|
||||
|
||||
For System V Release 4 the convention is *not* to prepend a leading
|
||||
underscore onto user-level symbol names. */
|
||||
|
||||
#undef ASM_OUTPUT_LABELREF
|
||||
#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
|
||||
|
||||
/* This is how to output an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class.
|
||||
|
||||
For most svr4 systems, the convention is that any symbol which begins
|
||||
with a period is not put into the linker symbol table by the assembler. */
|
||||
|
||||
#undef ASM_OUTPUT_INTERNAL_LABEL
|
||||
#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
|
||||
do { \
|
||||
fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
|
||||
} while (0)
|
||||
|
||||
/* This is how to store into the string LABEL
|
||||
the symbol_ref name of an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class.
|
||||
This is suitable for output with `assemble_name'.
|
||||
|
||||
For most svr4 systems, the convention is that any symbol which begins
|
||||
with a period is not put into the linker symbol table by the assembler. */
|
||||
|
||||
#undef ASM_GENERATE_INTERNAL_LABEL
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
|
||||
do { \
|
||||
sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
|
||||
} while (0)
|
||||
|
||||
/* Output the label which precedes a jumptable. Note that for all svr4
|
||||
systems where we actually generate jumptables (which is to say every
|
||||
svr4 target except i386, where we use casesi instead) we put the jump-
|
||||
tables into the .rodata section and since other stuff could have been
|
||||
put into the .rodata section prior to any given jumptable, we have to
|
||||
make sure that the location counter for the .rodata section gets pro-
|
||||
perly re-aligned prior to the actual beginning of the jump table. */
|
||||
|
||||
#define ALIGN_ASM_OP ".align"
|
||||
|
||||
#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
|
||||
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
|
||||
ASM_OUTPUT_ALIGN ((FILE), 2);
|
||||
#endif
|
||||
|
||||
#undef ASM_OUTPUT_CASE_LABEL
|
||||
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
|
||||
do { \
|
||||
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
|
||||
ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
|
||||
} while (0)
|
||||
|
||||
/* The standard SVR4 assembler seems to require that certain builtin
|
||||
library routines (e.g. .udiv) be explicitly declared as .globl
|
||||
in each assembly file where they are referenced. */
|
||||
|
||||
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
|
||||
ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized external linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#define COMMON_ASM_OP ".comm"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
|
||||
} while (0)
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized internal linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#define LOCAL_ASM_OP ".local"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), "\n"); \
|
||||
ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
|
||||
} while (0)
|
||||
|
||||
/* This is the pseudo-op used to generate a 32-bit word of data with a
|
||||
specific value in some section. This is the same for all known svr4
|
||||
assemblers. */
|
||||
|
||||
#define INT_ASM_OP ".long"
|
||||
|
||||
/* This is the pseudo-op used to generate a contiguous sequence of byte
|
||||
values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
|
||||
AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
|
||||
|
||||
#undef ASCII_DATA_ASM_OP
|
||||
#define ASCII_DATA_ASM_OP ".ascii"
|
||||
|
||||
/* Support const sections and the ctors and dtors sections for g++.
|
||||
Note that there appears to be two different ways to support const
|
||||
sections at the moment. You can either #define the symbol
|
||||
READONLY_DATA_SECTION (giving it some code which switches to the
|
||||
readonly data section) or else you can #define the symbols
|
||||
EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
|
||||
SELECT_RTX_SECTION. We do both here just to be on the safe side. */
|
||||
|
||||
#define USE_CONST_SECTION 1
|
||||
|
||||
#define CONST_SECTION_ASM_OP ".section\t.rodata"
|
||||
|
||||
/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
|
||||
|
||||
Note that we want to give these sections the SHF_WRITE attribute
|
||||
because these sections will actually contain data (i.e. tables of
|
||||
addresses of functions in the current root executable or shared library
|
||||
file) and, in the case of a shared library, the relocatable addresses
|
||||
will have to be properly resolved/relocated (and then written into) by
|
||||
the dynamic linker when it actually attaches the given shared library
|
||||
to the executing process. (Note that on SVR4, you may wish to use the
|
||||
`-z text' option to the ELF linker, when building a shared library, as
|
||||
an additional check that you are doing everything right. But if you do
|
||||
use the `-z text' option when building a shared library, you will get
|
||||
errors unless the .ctors and .dtors sections are marked as writable
|
||||
via the SHF_WRITE attribute.) */
|
||||
|
||||
#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
|
||||
#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
|
||||
|
||||
/* On svr4, we *do* have support for the .init and .fini sections, and we
|
||||
can put stuff in there to be executed before and after `main'. We let
|
||||
crtstuff.c and other files know this by defining the following symbols.
|
||||
The definitions say how to change sections to the .init and .fini
|
||||
sections. This is the same for all known svr4 assemblers. */
|
||||
|
||||
#define INIT_SECTION_ASM_OP ".section\t.init"
|
||||
#define FINI_SECTION_ASM_OP ".section\t.fini"
|
||||
|
||||
/* A default list of other sections which we might be "in" at any given
|
||||
time. For targets that use additional sections (e.g. .tdesc) you
|
||||
should override this definition in the target-specific file which
|
||||
includes this file. */
|
||||
|
||||
#undef EXTRA_SECTIONS
|
||||
#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
|
||||
|
||||
/* A default list of extra section function definitions. For targets
|
||||
that use additional sections (e.g. .tdesc) you should override this
|
||||
definition in the target-specific file which includes this file. */
|
||||
|
||||
#undef EXTRA_SECTION_FUNCTIONS
|
||||
#define EXTRA_SECTION_FUNCTIONS \
|
||||
CONST_SECTION_FUNCTION \
|
||||
CTORS_SECTION_FUNCTION \
|
||||
DTORS_SECTION_FUNCTION
|
||||
|
||||
#define READONLY_DATA_SECTION() const_section ()
|
||||
|
||||
extern void text_section ();
|
||||
|
||||
#define CONST_SECTION_FUNCTION \
|
||||
void \
|
||||
const_section () \
|
||||
{ \
|
||||
if (!USE_CONST_SECTION) \
|
||||
text_section(); \
|
||||
else if (in_section != in_const) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
|
||||
in_section = in_const; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CTORS_SECTION_FUNCTION \
|
||||
void \
|
||||
ctors_section () \
|
||||
{ \
|
||||
if (in_section != in_ctors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
|
||||
in_section = in_ctors; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DTORS_SECTION_FUNCTION \
|
||||
void \
|
||||
dtors_section () \
|
||||
{ \
|
||||
if (in_section != in_dtors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
|
||||
in_section = in_dtors; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Switch into a generic section.
|
||||
This is currently only used to support section attributes. */
|
||||
|
||||
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
|
||||
do { \
|
||||
static struct section_info \
|
||||
{ \
|
||||
struct section_info *next; \
|
||||
char *name; \
|
||||
enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
|
||||
} *sections; \
|
||||
struct section_info *s; \
|
||||
char *mode; \
|
||||
enum sect_enum type; \
|
||||
\
|
||||
for (s = sections; s; s = s->next) \
|
||||
if (!strcmp (NAME, s->name)) \
|
||||
break; \
|
||||
\
|
||||
if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
|
||||
type = SECT_EXEC, mode = "ax"; \
|
||||
else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
|
||||
type = SECT_RO, mode = "a"; \
|
||||
else \
|
||||
type = SECT_RW, mode = "aw"; \
|
||||
\
|
||||
if (s == 0) \
|
||||
{ \
|
||||
s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
|
||||
s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
|
||||
strcpy (s->name, NAME); \
|
||||
s->type = type; \
|
||||
s->next = sections; \
|
||||
sections = s; \
|
||||
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (DECL && s->type != type) \
|
||||
error_with_decl (DECL, "%s causes a section type conflict"); \
|
||||
\
|
||||
fprintf (FILE, ".section\t%s\n", NAME); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
|
||||
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
|
||||
#define UNIQUE_SECTION(DECL,RELOC) \
|
||||
do { \
|
||||
int len; \
|
||||
char *name, *string, *prefix; \
|
||||
\
|
||||
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
|
||||
\
|
||||
if (! DECL_ONE_ONLY (DECL)) \
|
||||
{ \
|
||||
if (TREE_CODE (DECL) == FUNCTION_DECL) \
|
||||
prefix = ".text."; \
|
||||
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
|
||||
prefix = ".rodata."; \
|
||||
else \
|
||||
prefix = ".data."; \
|
||||
} \
|
||||
else if (TREE_CODE (DECL) == FUNCTION_DECL) \
|
||||
prefix = ".gnu.linkonce.t."; \
|
||||
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
|
||||
prefix = ".gnu.linkonce.r."; \
|
||||
else \
|
||||
prefix = ".gnu.linkonce.d."; \
|
||||
\
|
||||
len = strlen (name) + strlen (prefix); \
|
||||
string = alloca (len + 1); \
|
||||
sprintf (string, "%s%s", prefix, name); \
|
||||
\
|
||||
DECL_SECTION_NAME (DECL) = build_string (len, string); \
|
||||
} while (0)
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors. */
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
ctors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtors_section (); \
|
||||
fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement or statements to switch to the appropriate
|
||||
section for output of DECL. DECL is either a `VAR_DECL' node
|
||||
or a constant of some sort. RELOC indicates whether forming
|
||||
the initial value of DECL requires link-time relocations. */
|
||||
|
||||
#define SELECT_SECTION(DECL,RELOC) \
|
||||
{ \
|
||||
if (TREE_CODE (DECL) == STRING_CST) \
|
||||
{ \
|
||||
if (! flag_writable_strings) \
|
||||
const_section (); \
|
||||
else \
|
||||
data_section (); \
|
||||
} \
|
||||
else if (TREE_CODE (DECL) == VAR_DECL) \
|
||||
{ \
|
||||
if ((flag_pic && RELOC) \
|
||||
|| !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
|
||||
|| !DECL_INITIAL (DECL) \
|
||||
|| (DECL_INITIAL (DECL) != error_mark_node \
|
||||
&& !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
|
||||
data_section (); \
|
||||
else \
|
||||
const_section (); \
|
||||
} \
|
||||
else \
|
||||
const_section (); \
|
||||
}
|
||||
|
||||
/* A C statement or statements to switch to the appropriate
|
||||
section for output of RTX in mode MODE. RTX is some kind
|
||||
of constant in RTL. The argument MODE is redundant except
|
||||
in the case of a `const_int' rtx. Currently, these always
|
||||
go into the const section. */
|
||||
|
||||
#undef SELECT_RTX_SECTION
|
||||
#define SELECT_RTX_SECTION(MODE,RTX) const_section()
|
||||
|
||||
/* Define the strings used for the special svr4 .type and .size directives.
|
||||
These strings generally do not vary from one system running svr4 to
|
||||
another, but if a given system (e.g. m88k running svr) needs to use
|
||||
different pseudo-op names for these, they may be overridden in the
|
||||
file which includes this one. */
|
||||
|
||||
#define TYPE_ASM_OP ".type"
|
||||
#define SIZE_ASM_OP ".size"
|
||||
|
||||
/* This is how we tell the assembler that a symbol is weak. */
|
||||
|
||||
#define ASM_WEAKEN_LABEL(FILE,NAME) \
|
||||
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); } while (0)
|
||||
|
||||
/* The following macro defines the format used to output the second
|
||||
operand of the .type assembler directive. Different svr4 assemblers
|
||||
expect various different forms for this operand. The one given here
|
||||
is just a default. You may need to override it in your machine-
|
||||
specific tm.h file (depending upon the particulars of your assembler). */
|
||||
|
||||
#define TYPE_OPERAND_FMT "@%s"
|
||||
|
||||
/* Write the extra assembler code needed to declare a function's result.
|
||||
Most svr4 assemblers don't require any special declaration of the
|
||||
result value, but there are exceptions. */
|
||||
|
||||
#ifndef ASM_DECLARE_RESULT
|
||||
#define ASM_DECLARE_RESULT(FILE, RESULT)
|
||||
#endif
|
||||
|
||||
/* These macros generate the special .type and .size directives which
|
||||
are used to set the corresponding fields of the linker symbol table
|
||||
entries in an ELF object file under SVR4. These macros also output
|
||||
the starting labels for the relevant functions/objects. */
|
||||
|
||||
/* Write the extra assembler code needed to declare a function properly.
|
||||
Some svr4 assemblers need to also have something extra said about the
|
||||
function's return value. We allow for that here. */
|
||||
|
||||
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
||||
do { \
|
||||
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
putc (',', FILE); \
|
||||
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
|
||||
putc ('\n', FILE); \
|
||||
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
|
||||
ASM_OUTPUT_LABEL(FILE, NAME); \
|
||||
} while (0)
|
||||
|
||||
/* Write the extra assembler code needed to declare an object properly. */
|
||||
|
||||
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
|
||||
do { \
|
||||
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
putc (',', FILE); \
|
||||
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
|
||||
putc ('\n', FILE); \
|
||||
size_directive_output = 0; \
|
||||
if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
|
||||
} \
|
||||
ASM_OUTPUT_LABEL(FILE, NAME); \
|
||||
} while (0)
|
||||
|
||||
/* Output the size directive for a decl in rest_of_decl_compilation
|
||||
in the case where we did not do so before the initializer.
|
||||
Once we find the error_mark_node, we know that the value of
|
||||
size_directive_output was set
|
||||
by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
|
||||
|
||||
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
|
||||
do { \
|
||||
char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
|
||||
if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
|
||||
&& ! AT_END && TOP_LEVEL \
|
||||
&& DECL_INITIAL (DECL) == error_mark_node \
|
||||
&& !size_directive_output) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, name); \
|
||||
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* This is how to declare the size of a function. */
|
||||
|
||||
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
|
||||
do { \
|
||||
if (!flag_inhibit_size_directive) \
|
||||
{ \
|
||||
char label[256]; \
|
||||
static int labelno; \
|
||||
labelno++; \
|
||||
ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
|
||||
ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
|
||||
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
|
||||
assemble_name (FILE, (FNAME)); \
|
||||
fprintf (FILE, ","); \
|
||||
assemble_name (FILE, label); \
|
||||
fprintf (FILE, "-"); \
|
||||
assemble_name (FILE, (FNAME)); \
|
||||
putc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
|
||||
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
|
||||
corresponds to a particular byte value [0..255]. For any
|
||||
given byte value, if the value in the corresponding table
|
||||
position is zero, the given character can be output directly.
|
||||
If the table value is 1, the byte must be output as a \ooo
|
||||
octal escape. If the tables value is anything else, then the
|
||||
byte value should be output as a \ followed by the value
|
||||
in the table. Note that we can use standard UN*X escape
|
||||
sequences for many control characters, but we don't use
|
||||
\a to represent BEL because some svr4 assemblers (e.g. on
|
||||
the i386) don't know about that. Also, we don't use \v
|
||||
since some versions of gas, such as 2.2 did not accept it. */
|
||||
|
||||
#define ESCAPES \
|
||||
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
|
||||
|
||||
/* Some svr4 assemblers have a limit on the number of characters which
|
||||
can appear in the operand of a .string directive. If your assembler
|
||||
has such a limitation, you should define STRING_LIMIT to reflect that
|
||||
limit. Note that at least some svr4 assemblers have a limit on the
|
||||
actual number of bytes in the double-quoted string, and that they
|
||||
count each character in an escape sequence as one byte. Thus, an
|
||||
escape sequence like \377 would count as four bytes.
|
||||
|
||||
If your target assembler doesn't support the .string directive, you
|
||||
should define this to zero.
|
||||
*/
|
||||
|
||||
#define STRING_LIMIT ((unsigned) 256)
|
||||
|
||||
#define STRING_ASM_OP ".string"
|
||||
|
||||
/* The routine used to output NUL terminated strings. We use a special
|
||||
version of this for most svr4 targets because doing so makes the
|
||||
generated assembly code more compact (and thus faster to assemble)
|
||||
as well as more readable, especially for targets like the i386
|
||||
(where the only alternative is to output character sequences as
|
||||
comma separated lists of numbers). */
|
||||
|
||||
#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
|
||||
do \
|
||||
{ \
|
||||
register unsigned char *_limited_str = (unsigned char *) (STR); \
|
||||
register unsigned ch; \
|
||||
fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP); \
|
||||
for (; ch = *_limited_str; _limited_str++) \
|
||||
{ \
|
||||
register int escape; \
|
||||
switch (escape = ESCAPES[ch]) \
|
||||
{ \
|
||||
case 0: \
|
||||
putc (ch, (FILE)); \
|
||||
break; \
|
||||
case 1: \
|
||||
fprintf ((FILE), "\\%03o", ch); \
|
||||
break; \
|
||||
default: \
|
||||
putc ('\\', (FILE)); \
|
||||
putc (escape, (FILE)); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
fprintf ((FILE), "\"\n"); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* The routine used to output sequences of byte values. We use a special
|
||||
version of this for most svr4 targets because doing so makes the
|
||||
generated assembly code more compact (and thus faster to assemble)
|
||||
as well as more readable. Note that if we find subparts of the
|
||||
character sequence which end with NUL (and which are shorter than
|
||||
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
|
||||
|
||||
#undef ASM_OUTPUT_ASCII
|
||||
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
|
||||
do \
|
||||
{ \
|
||||
register unsigned char *_ascii_bytes = (unsigned char *) (STR); \
|
||||
register unsigned char *limit = _ascii_bytes + (LENGTH); \
|
||||
register unsigned bytes_in_chunk = 0; \
|
||||
for (; _ascii_bytes < limit; _ascii_bytes++) \
|
||||
{ \
|
||||
register unsigned char *p; \
|
||||
if (bytes_in_chunk >= 60) \
|
||||
{ \
|
||||
fprintf ((FILE), "\"\n"); \
|
||||
bytes_in_chunk = 0; \
|
||||
} \
|
||||
for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
|
||||
continue; \
|
||||
if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
|
||||
{ \
|
||||
if (bytes_in_chunk > 0) \
|
||||
{ \
|
||||
fprintf ((FILE), "\"\n"); \
|
||||
bytes_in_chunk = 0; \
|
||||
} \
|
||||
ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
|
||||
_ascii_bytes = p; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
register int escape; \
|
||||
register unsigned ch; \
|
||||
if (bytes_in_chunk == 0) \
|
||||
fprintf ((FILE), "\t%s\t\"", ASCII_DATA_ASM_OP); \
|
||||
switch (escape = ESCAPES[ch = *_ascii_bytes]) \
|
||||
{ \
|
||||
case 0: \
|
||||
putc (ch, (FILE)); \
|
||||
bytes_in_chunk++; \
|
||||
break; \
|
||||
case 1: \
|
||||
fprintf ((FILE), "\\%03o", ch); \
|
||||
bytes_in_chunk += 4; \
|
||||
break; \
|
||||
default: \
|
||||
putc ('\\', (FILE)); \
|
||||
putc (escape, (FILE)); \
|
||||
bytes_in_chunk += 2; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
if (bytes_in_chunk > 0) \
|
||||
fprintf ((FILE), "\"\n"); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* All SVR4 targets use the ELF object file format. */
|
||||
#define OBJECT_FORMAT_ELF
|
||||
@@ -1,127 +0,0 @@
|
||||
/* Subroutines for insn-output.c for GNU compiler. Elxsi version.
|
||||
Copyright (C) 1987, 1992, 1997 Free Software Foundation, Inc
|
||||
This port, done by Mike Stump <mrs@cygnus.com> in 1988, and is the first
|
||||
64 bit port of GNU CC.
|
||||
Based upon the VAX port.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include "rtl.h"
|
||||
|
||||
extern char *reg_names[];
|
||||
rtx cmp_op0=0, cmp_op1=0;
|
||||
|
||||
/* table of relations for compares and branches */
|
||||
char *cmp_tab[] = {
|
||||
"gt", "gt", "eq", "eq", "ge", "ge", "lt", "lt", "ne", "ne",
|
||||
"le", "le" };
|
||||
|
||||
/* type is the index into the above table */
|
||||
/* s is "" for signed, or "u" for unsigned */
|
||||
char *cmp_jmp(s, type, where) char *s; rtx where; {
|
||||
rtx br_ops[3];
|
||||
char template[50];
|
||||
char *f = "";
|
||||
char *bits = "64";
|
||||
if (GET_MODE (cmp_op0) == SFmode) f = "f", bits = "32";
|
||||
if (GET_MODE (cmp_op0) == DFmode) f = "f";
|
||||
br_ops[0] = where;
|
||||
br_ops[1] = cmp_op0;
|
||||
br_ops[2] = cmp_op1;
|
||||
if (cmp_op1)
|
||||
sprintf(template, "%scmp%s.br.%s\t%%1,%%2:j%s\t%%l0",
|
||||
f, s, bits, cmp_tab[type]);
|
||||
else if (*f)
|
||||
sprintf(template, "fcmp.br.%s\t%%1,=0:j%s\t%%l0",
|
||||
bits, cmp_tab[type]);
|
||||
else if (*s) /* can turn the below in to a jmp ... */
|
||||
sprintf(template, "cmpu.br.64\t%%1,=0:j%s\t%%l0", s, cmp_tab[type]);
|
||||
else
|
||||
sprintf(template, "jmp.%s\t%%1,%%l0", cmp_tab[type+1]);
|
||||
output_asm_insn(template, br_ops);
|
||||
return "";
|
||||
}
|
||||
|
||||
char *cmp_set(s, type, reg) char *s, *type; rtx reg; {
|
||||
rtx br_ops[3];
|
||||
char template[50];
|
||||
char *f = "";
|
||||
char *bits = "64";
|
||||
if (GET_MODE (cmp_op0) == SFmode) f = "f", bits = "32";
|
||||
else if (GET_MODE (cmp_op0) == DFmode) f = "f";
|
||||
else if (GET_MODE (cmp_op0) == SImode) bits = "32";
|
||||
else if (GET_MODE (cmp_op0) == HImode) bits = "16";
|
||||
else if (GET_MODE (cmp_op0) == QImode) bits = "8";
|
||||
br_ops[0] = reg;
|
||||
br_ops[1] = cmp_op0;
|
||||
br_ops[2] = cmp_op1;
|
||||
if (cmp_op1)
|
||||
sprintf(template, "%scmp%s.%s\t%%0,%%1,%%2:%s",
|
||||
f, s, bits, type);
|
||||
else
|
||||
sprintf(template, "%scmp%s.%s\t%%0,%%1,=0:%s",
|
||||
f, s, bits, type);
|
||||
output_asm_insn(template, br_ops);
|
||||
return "";
|
||||
}
|
||||
|
||||
print_operand_address (file, addr)
|
||||
FILE *file;
|
||||
register rtx addr;
|
||||
{
|
||||
register rtx reg1, reg2, breg, ireg;
|
||||
rtx offset;
|
||||
|
||||
retry:
|
||||
switch (GET_CODE (addr))
|
||||
{
|
||||
|
||||
case MEM:
|
||||
if (GET_CODE (XEXP (addr, 0)) == REG)
|
||||
fprintf (file, "%s", reg_names[REGNO (addr)]);
|
||||
else abort();
|
||||
break;
|
||||
|
||||
case REG:
|
||||
fprintf (file, "[%s]", reg_names[REGNO (addr)]);
|
||||
break;
|
||||
|
||||
case PLUS:
|
||||
reg1 = 0; reg2 = 0;
|
||||
ireg = 0; breg = 0;
|
||||
offset = 0;
|
||||
if (GET_CODE (XEXP (addr, 0)) == REG)
|
||||
{
|
||||
offset = XEXP (addr, 1);
|
||||
addr = XEXP (addr, 0);
|
||||
}
|
||||
else if (GET_CODE (XEXP (addr, 1)) == REG)
|
||||
{
|
||||
offset = XEXP (addr, 0);
|
||||
addr = XEXP (addr, 1);
|
||||
}
|
||||
fprintf (file, "[%s]", reg_names[REGNO (addr)]);
|
||||
output_address (offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
output_addr_const (file, addr);
|
||||
}
|
||||
}
|
||||
@@ -1,967 +0,0 @@
|
||||
/* Definitions of target machine for GNU compiler. Elxsi version.
|
||||
Copyright (C) 1987, 1988, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
This port, contributed by Mike Stump <mrs@cygnus.com> in 1988, is the first
|
||||
64 bit port of GNU CC.
|
||||
Based upon the VAX port.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#define CPP_PREDEFINES "-Delxsi -Dunix -Asystem(unix) -Acpu(elxsi) -Amachine(elxsi)"
|
||||
|
||||
/* Print subsidiary information on the compiler version in use. */
|
||||
|
||||
#define TARGET_VERSION fprintf (stderr, " (elxsi)");
|
||||
|
||||
/* Run-time compilation parameters selecting different hardware subsets. */
|
||||
|
||||
extern int target_flags;
|
||||
|
||||
/* Macros used in the machine description to test the flags. */
|
||||
|
||||
/* Nonzero if compiling code that Unix assembler can assemble. */
|
||||
#define TARGET_UNIX_ASM (target_flags & 1)
|
||||
|
||||
|
||||
/* Macro to define tables used to set the flags.
|
||||
This is a list in braces of pairs in braces,
|
||||
each pair being { "NAME", VALUE }
|
||||
where VALUE is the bits to set or minus the bits to clear.
|
||||
An empty string NAME is used to identify the default VALUE. */
|
||||
|
||||
#define TARGET_SWITCHES \
|
||||
{ {"unix", 1}, \
|
||||
{"embos", -1}, \
|
||||
{ "", TARGET_DEFAULT}}
|
||||
|
||||
/* Default target_flags if no switches specified. */
|
||||
|
||||
#ifndef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT 1
|
||||
#endif
|
||||
|
||||
/* Target machine storage layout */
|
||||
|
||||
/* Define this if most significant bit is lowest numbered
|
||||
in instructions that operate on numbered bit-fields.
|
||||
This is not true on the vax. */
|
||||
#define BITS_BIG_ENDIAN 0
|
||||
|
||||
/* Define this if most significant byte of a word is the lowest numbered. */
|
||||
#define BYTES_BIG_ENDIAN 1
|
||||
|
||||
/* Define this if most significant word of a multiword number is numbered. */
|
||||
#define WORDS_BIG_ENDIAN 1
|
||||
|
||||
/* Number of bits in an addressable storage unit */
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
/* Width in bits of a "word", which is the contents of a machine register.
|
||||
Note that this is not necessarily the width of data type `int';
|
||||
if using 16-bit ints on a 68000, this would still be 32.
|
||||
But on a machine with 16-bit registers, this would be 16. */
|
||||
#define BITS_PER_WORD 64
|
||||
#define Rmode DImode
|
||||
|
||||
#define INT_TYPE_SIZE 32
|
||||
|
||||
#define LONG_TYPE_SIZE 32
|
||||
|
||||
#define LONG_LONG_TYPE_SIZE 64
|
||||
|
||||
#define FLOAT_TYPE_SIZE 32
|
||||
|
||||
#define DOUBLE_TYPE_SIZE 64
|
||||
|
||||
#define LONG_DOUBLE_TYPE_SIZE 64
|
||||
|
||||
/* Width of a word, in units (bytes). */
|
||||
#define UNITS_PER_WORD 8
|
||||
|
||||
/* Width in bits of a pointer.
|
||||
See also the macro `Pmode' defined below. */
|
||||
#define POINTER_SIZE 32
|
||||
|
||||
/* Allocation boundary (in *bits*) for storing pointers in memory. */
|
||||
#define POINTER_BOUNDARY 32
|
||||
|
||||
/* Allocation boundary (in *bits*) for storing arguments in argument list. */
|
||||
#define PARM_BOUNDARY 32
|
||||
|
||||
/* Allocation boundary (in *bits*) for the code of a function. */
|
||||
#define FUNCTION_BOUNDARY 8
|
||||
|
||||
/* Alignment of field after `int : 0' in a structure. */
|
||||
#define EMPTY_FIELD_BOUNDARY 8
|
||||
|
||||
/* Every structure's size must be a multiple of this. */
|
||||
#define STRUCTURE_SIZE_BOUNDARY 32
|
||||
|
||||
/* A bitfield declared as `int' forces `int' alignment for the struct. */
|
||||
#define PCC_BITFIELD_TYPE_MATTERS 1
|
||||
|
||||
/* No data type wants to be aligned rounder than this. */
|
||||
#define BIGGEST_ALIGNMENT 32
|
||||
|
||||
/* Define this if move instructions will actually fail to work
|
||||
when given unaligned data. */
|
||||
#define STRICT_ALIGNMENT 0
|
||||
|
||||
/* Standard register usage. */
|
||||
|
||||
/* Number of actual hardware registers.
|
||||
The hardware registers are assigned numbers for the compiler
|
||||
from 0 to just below FIRST_PSEUDO_REGISTER.
|
||||
All registers that the compiler knows about must be given numbers,
|
||||
even those that are not normally considered general registers. */
|
||||
#define FIRST_PSEUDO_REGISTER 16
|
||||
|
||||
/* 1 for registers that have pervasive standard uses
|
||||
and are not available for the register allocator.
|
||||
On the elxsi, these is the .r15 (aka .sp). */
|
||||
#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
|
||||
|
||||
/* 1 for registers not available across function calls.
|
||||
These must include the FIXED_REGISTERS and also any
|
||||
registers that can be used without being saved.
|
||||
The latter must include the registers where values are returned
|
||||
and the register where structure-value addresses are passed.
|
||||
Aside from that, you can include as many other registers as you like. */
|
||||
#define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
|
||||
|
||||
/* Return number of consecutive hard regs needed starting at reg REGNO
|
||||
to hold something of mode MODE.
|
||||
This is ordinarily the length in words of a value of mode MODE
|
||||
but can be less for certain modes in special long registers.
|
||||
On the vax, all registers are one word long. */
|
||||
#define HARD_REGNO_NREGS(REGNO, MODE) \
|
||||
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
|
||||
|
||||
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
|
||||
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
|
||||
|
||||
/* Value is 1 if it is a good idea to tie two pseudo registers
|
||||
when one has mode MODE1 and one has mode MODE2.
|
||||
If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
|
||||
for any hard reg, then this must be 0 for correct output. */
|
||||
#define MODES_TIEABLE_P(MODE1, MODE2) 1
|
||||
|
||||
/* Specify the registers used for certain standard purposes.
|
||||
The values of these macros are register numbers. */
|
||||
|
||||
/* Register to use for pushing function arguments. */
|
||||
#define STACK_POINTER_REGNUM 15
|
||||
|
||||
/* Base register for access to local variables of the function. */
|
||||
#define FRAME_POINTER_REGNUM 14
|
||||
|
||||
/* Value should be nonzero if functions must have frame pointers.
|
||||
Zero means the frame pointer need not be set up (and parms
|
||||
may be accessed via the stack pointer) in functions that seem suitable.
|
||||
This is computed in `reload', in reload1.c. */
|
||||
#define FRAME_POINTER_REQUIRED 0
|
||||
|
||||
#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
|
||||
{ int regno; \
|
||||
int offset = 0; \
|
||||
for( regno=0; regno < FIRST_PSEUDO_REGISTER; regno++ ) \
|
||||
if( regs_ever_live[regno] && !call_used_regs[regno] ) \
|
||||
offset += 8; \
|
||||
(DEPTH) = (offset + ((get_frame_size() + 3) & ~3) ); \
|
||||
(DEPTH) = 0; \
|
||||
}
|
||||
|
||||
/* Base register for access to arguments of the function. */
|
||||
#define ARG_POINTER_REGNUM 14
|
||||
|
||||
/* Register in which static-chain is passed to a function. */
|
||||
#define STATIC_CHAIN_REGNUM 0
|
||||
|
||||
/* Register in which address to store a structure value
|
||||
is passed to a function. */
|
||||
#define STRUCT_VALUE_REGNUM 1
|
||||
|
||||
/* Define the classes of registers for register constraints in the
|
||||
machine description. Also define ranges of constants.
|
||||
|
||||
One of the classes must always be named ALL_REGS and include all hard regs.
|
||||
If there is more than one class, another class must be named NO_REGS
|
||||
and contain no registers.
|
||||
|
||||
The name GENERAL_REGS must be the name of a class (or an alias for
|
||||
another name such as ALL_REGS). This is the class of registers
|
||||
that is allowed by "g" or "r" in a register constraint.
|
||||
Also, registers outside this class are allocated only when
|
||||
instructions express preferences for them.
|
||||
|
||||
The classes must be numbered in nondecreasing order; that is,
|
||||
a larger-numbered class must never be contained completely
|
||||
in a smaller-numbered class.
|
||||
|
||||
For any two classes, it is very desirable that there be another
|
||||
class that represents their union. */
|
||||
|
||||
/* The vax has only one kind of registers, so NO_REGS and ALL_REGS
|
||||
are the only classes. */
|
||||
|
||||
enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
|
||||
|
||||
#define N_REG_CLASSES (int) LIM_REG_CLASSES
|
||||
|
||||
/* Give names of register classes as strings for dump file. */
|
||||
|
||||
#define REG_CLASS_NAMES \
|
||||
{"NO_REGS", "GENERAL_REGS", "ALL_REGS" }
|
||||
|
||||
/* Define which registers fit in which classes.
|
||||
This is an initializer for a vector of HARD_REG_SET
|
||||
of length N_REG_CLASSES. */
|
||||
|
||||
#define REG_CLASS_CONTENTS {0, 0x07fff, 0xffff}
|
||||
|
||||
/* The same information, inverted:
|
||||
Return the class number of the smallest class containing
|
||||
reg number REGNO. This could be a conditional expression
|
||||
or could index an array. */
|
||||
|
||||
#define REGNO_REG_CLASS(REGNO) (REGNO == 15 ? ALL_REGS : GENERAL_REGS)
|
||||
|
||||
/* The class value for index registers, and the one for base regs. */
|
||||
|
||||
#define INDEX_REG_CLASS GENERAL_REGS
|
||||
#define BASE_REG_CLASS GENERAL_REGS
|
||||
|
||||
/* Get reg_class from a letter such as appears in the machine description. */
|
||||
|
||||
#define REG_CLASS_FROM_LETTER(C) NO_REGS
|
||||
|
||||
/* The letters I, J, K, L and M in a register constraint string
|
||||
can be used to stand for particular ranges of immediate operands.
|
||||
This macro defines what the ranges are.
|
||||
C is the letter, and VALUE is a constant value.
|
||||
Return 1 if VALUE is in the range specified by C. */
|
||||
|
||||
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
|
||||
((C) == 'I' ? (VALUE) >=-16 && (VALUE) <=15 : 0)
|
||||
|
||||
/* Similar, but for floating constants, and defining letters G and H.
|
||||
Here VALUE is the CONST_DOUBLE rtx itself. */
|
||||
|
||||
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
|
||||
|
||||
/* Given an rtx X being reloaded into a reg required to be
|
||||
in class CLASS, return the class of reg to actually use.
|
||||
In general this is just CLASS; but on some machines
|
||||
in some cases it is preferable to use a more restrictive class. */
|
||||
|
||||
#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
|
||||
|
||||
/* Return the maximum number of consecutive registers
|
||||
needed to represent mode MODE in a register of class CLASS. */
|
||||
/* On the vax, this is always the size of MODE in words,
|
||||
since all registers are the same size. */
|
||||
#define CLASS_MAX_NREGS(CLASS, MODE) \
|
||||
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
|
||||
|
||||
/* Stack layout; function entry, exit and calling. */
|
||||
|
||||
/* Define this if pushing a word on the stack
|
||||
makes the stack pointer a smaller address. */
|
||||
#define STACK_GROWS_DOWNWARD
|
||||
|
||||
/* Define this if the nominal address of the stack frame
|
||||
is at the high-address end of the local variables;
|
||||
that is, each additional local variable allocated
|
||||
goes at a more negative offset in the frame. */
|
||||
#define FRAME_GROWS_DOWNWARD
|
||||
|
||||
/* Offset within stack frame to start allocating local variables at.
|
||||
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
|
||||
first local allocated. Otherwise, it is the offset to the BEGINNING
|
||||
of the first local allocated. */
|
||||
#define STARTING_FRAME_OFFSET -4
|
||||
|
||||
/* Offset of first parameter from the argument pointer register value. */
|
||||
#define FIRST_PARM_OFFSET(FNDECL) 4
|
||||
|
||||
/* Value is 1 if returning from a function call automatically
|
||||
pops the arguments described by the number-of-args field in the call.
|
||||
FUNDECL is the declaration node of the function (as a tree),
|
||||
FUNTYPE is the data type of the function (as a tree),
|
||||
or for a library call it is an identifier node for the subroutine name.
|
||||
|
||||
On the Vax, the RET insn always pops all the args for any function. */
|
||||
|
||||
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
|
||||
|
||||
/* Define how to find the value returned by a function.
|
||||
VALTYPE is the data type of the value (as a tree).
|
||||
If the precise function being called is known, FUNC is its FUNCTION_DECL;
|
||||
otherwise, FUNC is 0. */
|
||||
|
||||
/* On the Vax the return value is in R0 regardless. */
|
||||
|
||||
#define FUNCTION_VALUE(VALTYPE, FUNC) \
|
||||
gen_rtx (REG, TYPE_MODE (VALTYPE), 0)
|
||||
|
||||
/* Define how to find the value returned by a library function
|
||||
assuming the value has mode MODE. */
|
||||
|
||||
/* On the Vax the return value is in R0 regardless. */
|
||||
|
||||
#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)
|
||||
|
||||
/* Define this if PCC uses the nonreentrant convention for returning
|
||||
structure and union values. */
|
||||
|
||||
#define PCC_STATIC_STRUCT_RETURN
|
||||
|
||||
/* 1 if N is a possible register number for a function value.
|
||||
On the Vax, R0 is the only register thus used. */
|
||||
|
||||
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
|
||||
|
||||
/* 1 if N is a possible register number for function argument passing.
|
||||
On the Vax, no registers are used in this way. */
|
||||
|
||||
#define FUNCTION_ARG_REGNO_P(N) 0
|
||||
|
||||
/* Define a data type for recording info about an argument list
|
||||
during the scan of that argument list. This data type should
|
||||
hold all necessary information about the function itself
|
||||
and about the args processed so far, enough to enable macros
|
||||
such as FUNCTION_ARG to determine where the next arg should go.
|
||||
|
||||
On the vax, this is a single integer, which is a number of bytes
|
||||
of arguments scanned so far. */
|
||||
|
||||
#define CUMULATIVE_ARGS int
|
||||
|
||||
/* Initialize a variable CUM of type CUMULATIVE_ARGS
|
||||
for a call to a function whose data type is FNTYPE.
|
||||
For a library call, FNTYPE is 0.
|
||||
|
||||
On the vax, the offset starts at 0. */
|
||||
|
||||
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,x,INDIRECT) \
|
||||
((CUM) = 0)
|
||||
|
||||
/* Update the data in CUM to advance over an argument
|
||||
of mode MODE and data type TYPE.
|
||||
(TYPE is null for libcalls where that information may not be available.) */
|
||||
|
||||
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
||||
((CUM) += ((MODE) != BLKmode \
|
||||
? (GET_MODE_SIZE (MODE) + 3) & ~3 \
|
||||
: (int_size_in_bytes (TYPE) + 3) & ~3))
|
||||
|
||||
/* Define where to put the arguments to a function.
|
||||
Value is zero to push the argument on the stack,
|
||||
or a hard register in which to store the argument.
|
||||
|
||||
MODE is the argument's machine mode.
|
||||
TYPE is the data type of the argument (as a tree).
|
||||
This is null for libcalls where that information may
|
||||
not be available.
|
||||
CUM is a variable of type CUMULATIVE_ARGS which gives info about
|
||||
the preceding args and about the function being called.
|
||||
NAMED is nonzero if this argument is a named parameter
|
||||
(otherwise it is an extra parameter matching an ellipsis). */
|
||||
|
||||
/* On the vax all args are pushed. */
|
||||
|
||||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
|
||||
|
||||
/* This macro generates the assembly code for function entry.
|
||||
FILE is a stdio stream to output the code to.
|
||||
SIZE is an int: how many units of temporary storage to allocate.
|
||||
Refer to the array `regs_ever_live' to determine which registers
|
||||
to save; `regs_ever_live[I]' is nonzero if register number I
|
||||
is ever used in the function. This macro is responsible for
|
||||
knowing which registers should not be saved even if used. */
|
||||
|
||||
#define FUNCTION_PROLOGUE(FILE, SIZE) \
|
||||
{ register int regno; \
|
||||
register int cnt = 0; \
|
||||
extern char call_used_regs[]; \
|
||||
/* the below two lines are a HACK, and should be deleted, but \
|
||||
for now are very much needed (1.35) */ \
|
||||
if (frame_pointer_needed) \
|
||||
regs_ever_live[14]=1, call_used_regs[14]=0; \
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno]) \
|
||||
cnt+=8; \
|
||||
if ((SIZE)+cnt) \
|
||||
fprintf (FILE, "\tadd.64\t.sp,=%d\n", -(SIZE)-cnt); \
|
||||
cnt = 0; \
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno]) \
|
||||
fprintf (FILE, "\tst.64\t.r%d,[.sp]%d\n", regno, (cnt+=8)-12); \
|
||||
if (frame_pointer_needed) \
|
||||
fprintf (FILE, "\tadd.64\t.r14,.sp,=%d\n", (SIZE)+cnt); \
|
||||
}
|
||||
|
||||
/* Output assembler code to FILE to increment profiler label # LABELNO
|
||||
for profiling a function entry. */
|
||||
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fprintf (FILE, "\tld.64\t.r0,.LP%d\n\tcall\tmcount\n", (LABELNO));
|
||||
|
||||
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
|
||||
the stack pointer does not matter. The value is tested only in
|
||||
functions that have frame pointers.
|
||||
No definition is equivalent to always zero. */
|
||||
|
||||
#define EXIT_IGNORE_STACK 0
|
||||
|
||||
/* This macro generates the assembly code for function exit,
|
||||
on machines that need it. If FUNCTION_EPILOGUE is not defined
|
||||
then individual return instructions are generated for each
|
||||
return statement. Args are same as for FUNCTION_PROLOGUE. */
|
||||
|
||||
#define FUNCTION_EPILOGUE(FILE, SIZE) \
|
||||
{ register int regno; \
|
||||
register int cnt = 0; \
|
||||
extern char call_used_regs[]; \
|
||||
extern int current_function_calls_alloca; \
|
||||
/* this conditional is ONLY here because there is a BUG; \
|
||||
EXIT_IGNORE_STACK is ignored itself when the first part of \
|
||||
the condition is true! (at least in version 1.35) */ \
|
||||
/* the 8*10 is for 64 bits of .r5 - .r14 */ \
|
||||
if (current_function_calls_alloca || (SIZE)>=(256-8*10)) { \
|
||||
/* use .r4 as a temporary! Ok for now.... */ \
|
||||
fprintf (FILE, "\tld.64\t.r4,.r14\n"); \
|
||||
for (regno = FIRST_PSEUDO_REGISTER-1; regno >= 0; --regno) \
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno]) \
|
||||
cnt+=8; \
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) \
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno]) \
|
||||
fprintf (FILE, "\tld.64\t.r%d,[.r14]%d\n", regno, \
|
||||
-((cnt-=8) + 8)-4-(SIZE)); \
|
||||
fprintf (FILE, "\tld.64\t.sp,.r4\n\texit\t0\n"); \
|
||||
} else { \
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) \
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno]) \
|
||||
fprintf (FILE, "\tld.64\t.r%d,[.sp]%d\n", regno, (cnt+=8)-12); \
|
||||
fprintf (FILE, "\texit\t%d\n", (SIZE)+cnt); \
|
||||
} }
|
||||
|
||||
/* If the memory address ADDR is relative to the frame pointer,
|
||||
correct it to be relative to the stack pointer instead.
|
||||
This is for when we don't use a frame pointer.
|
||||
ADDR should be a variable name. */
|
||||
|
||||
#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
|
||||
{ int offset = -1; \
|
||||
rtx regs = stack_pointer_rtx; \
|
||||
if (ADDR == frame_pointer_rtx) \
|
||||
offset = 0; \
|
||||
else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx \
|
||||
&& GET_CODE (XEXP (ADDR, 0)) == CONST_INT) \
|
||||
offset = INTVAL (XEXP (ADDR, 0)); \
|
||||
else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \
|
||||
&& GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \
|
||||
offset = INTVAL (XEXP (ADDR, 1)); \
|
||||
else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \
|
||||
{ rtx other_reg = XEXP (ADDR, 1); \
|
||||
offset = 0; \
|
||||
regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \
|
||||
else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \
|
||||
{ rtx other_reg = XEXP (ADDR, 0); \
|
||||
offset = 0; \
|
||||
regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \
|
||||
if (offset >= 0) \
|
||||
{ int regno; \
|
||||
extern char call_used_regs[]; \
|
||||
offset += 4; /* I don't know why??? */ \
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \
|
||||
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
|
||||
offset += 8; \
|
||||
ADDR = plus_constant (regs, offset + (DEPTH)); } }
|
||||
|
||||
|
||||
/* Addressing modes, and classification of registers for them. */
|
||||
|
||||
/* #define HAVE_POST_INCREMENT 0 */
|
||||
/* #define HAVE_POST_DECREMENT 0 */
|
||||
|
||||
/* #define HAVE_PRE_DECREMENT 0 */
|
||||
/* #define HAVE_PRE_INCREMENT 0 */
|
||||
|
||||
/* Macros to check register numbers against specific register classes. */
|
||||
|
||||
/* These assume that REGNO is a hard or pseudo reg number.
|
||||
They give nonzero only if REGNO is a hard reg of the suitable class
|
||||
or a pseudo reg currently allocated to a suitable hard reg.
|
||||
Since they use reg_renumber, they are safe only once reg_renumber
|
||||
has been allocated, which happens in local-alloc.c. */
|
||||
|
||||
#define REGNO_OK_FOR_INDEX_P(regno) \
|
||||
((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
|
||||
#define REGNO_OK_FOR_BASE_P(regno) \
|
||||
((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
|
||||
|
||||
/* Maximum number of registers that can appear in a valid memory address. */
|
||||
|
||||
#define MAX_REGS_PER_ADDRESS 2
|
||||
|
||||
/* 1 if X is an rtx for a constant that is a valid address. */
|
||||
|
||||
#define CONSTANT_ADDRESS_P(X) \
|
||||
(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|
||||
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
|
||||
|| GET_CODE (X) == HIGH)
|
||||
|
||||
/* Nonzero if the constant value X is a legitimate general operand.
|
||||
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
|
||||
|
||||
#define LEGITIMATE_CONSTANT_P(X) \
|
||||
(GET_CODE (X) != CONST_DOUBLE)
|
||||
|
||||
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
|
||||
and check its validity for a certain class.
|
||||
We have two alternate definitions for each of them.
|
||||
The usual definition accepts all pseudo regs; the other rejects
|
||||
them unless they have been allocated suitable hard regs.
|
||||
The symbol REG_OK_STRICT causes the latter definition to be used.
|
||||
|
||||
Most source files want to accept pseudo regs in the hope that
|
||||
they will get allocated to the class that the insn wants them to be in.
|
||||
Source files for reload pass need to be strict.
|
||||
After reload, it makes no difference, since pseudo regs have
|
||||
been eliminated by then. */
|
||||
|
||||
#ifndef REG_OK_STRICT
|
||||
|
||||
/* Nonzero if X is a hard reg that can be used as an index
|
||||
or if it is a pseudo reg. */
|
||||
#define REG_OK_FOR_INDEX_P(X) 1
|
||||
/* Nonzero if X is a hard reg that can be used as a base reg
|
||||
or if it is a pseudo reg. */
|
||||
#define REG_OK_FOR_BASE_P(X) 1
|
||||
|
||||
#else
|
||||
|
||||
/* Nonzero if X is a hard reg that can be used as an index. */
|
||||
#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
|
||||
/* Nonzero if X is a hard reg that can be used as a base reg. */
|
||||
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
|
||||
|
||||
#endif
|
||||
|
||||
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
|
||||
that is a valid memory address for an instruction.
|
||||
The MODE argument is the machine mode for the MEM expression
|
||||
that wants to use this address.
|
||||
|
||||
CONSTANT_ADDRESS_P is actually machine-independent. */
|
||||
|
||||
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
|
||||
{ \
|
||||
if (GET_CODE (X) == REG) goto ADDR; \
|
||||
if (CONSTANT_ADDRESS_P (X)) goto ADDR; \
|
||||
if (GET_CODE (X) == PLUS) \
|
||||
{ \
|
||||
/* Handle [index]<address> represented with index-sum outermost */\
|
||||
if (GET_CODE (XEXP (X, 0)) == REG \
|
||||
&& REG_OK_FOR_BASE_P (XEXP (X, 0)) \
|
||||
&& GET_CODE (XEXP (X, 1)) == CONST_INT) \
|
||||
goto ADDR; \
|
||||
if (GET_CODE (XEXP (X, 1)) == REG \
|
||||
&& REG_OK_FOR_BASE_P (XEXP (X, 0)) \
|
||||
&& GET_CODE (XEXP (X, 0)) == CONST_INT) \
|
||||
goto ADDR; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/* Try machine-dependent ways of modifying an illegitimate address
|
||||
to be legitimate. If we find one, return the new, valid address.
|
||||
This macro is used in only one place: `memory_address' in explow.c.
|
||||
|
||||
OLDX is the address as it was before break_out_memory_refs was called.
|
||||
In some cases it is useful to look at this to decide what needs to be done.
|
||||
|
||||
MODE and WIN are passed so that this macro can use
|
||||
GO_IF_LEGITIMATE_ADDRESS.
|
||||
|
||||
It is always safe for this macro to do nothing. It exists to recognize
|
||||
opportunities to optimize the output.
|
||||
|
||||
For the vax, nothing needs to be done. */
|
||||
|
||||
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
|
||||
|
||||
/* Go to LABEL if ADDR (a legitimate address expression)
|
||||
has an effect that depends on the machine mode it is used for. */
|
||||
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
|
||||
|
||||
|
||||
/* Specify the machine mode that this machine uses
|
||||
for the index in the tablejump instruction. */
|
||||
#define CASE_VECTOR_MODE SImode
|
||||
|
||||
/* Define as C expression which evaluates to nonzero if the tablejump
|
||||
instruction expects the table to contain offsets from the address of the
|
||||
table.
|
||||
Do not define this if the table should contain absolute addresses. */
|
||||
/* #define CASE_VECTOR_PC_RELATIVE 1 */
|
||||
|
||||
/* Specify the tree operation to be used to convert reals to integers. */
|
||||
#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
|
||||
|
||||
/* This is the kind of divide that is easiest to do in the general case. */
|
||||
#define EASY_DIV_EXPR TRUNC_DIV_EXPR
|
||||
|
||||
/* Define this as 1 if `char' should by default be signed; else as 0. */
|
||||
#define DEFAULT_SIGNED_CHAR 1
|
||||
|
||||
/* This flag, if defined, says the same insns that convert to a signed fixnum
|
||||
also convert validly to an unsigned one. */
|
||||
#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
|
||||
|
||||
/* Max number of bytes we can move from memory to memory
|
||||
in one reasonably fast instruction. */
|
||||
#define MOVE_MAX 8
|
||||
|
||||
/* Define this if zero-extension is slow (more than one real instruction). */
|
||||
/* #define SLOW_ZERO_EXTEND */
|
||||
|
||||
/* Nonzero if access to memory by bytes is slow and undesirable. */
|
||||
#define SLOW_BYTE_ACCESS 0
|
||||
|
||||
/* Define if shifts truncate the shift count
|
||||
which implies one can omit a sign-extension or zero-extension
|
||||
of a shift count. */
|
||||
/* #define SHIFT_COUNT_TRUNCATED */
|
||||
|
||||
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
|
||||
is done just by pretending it is already truncated. */
|
||||
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
|
||||
|
||||
/* Specify the machine mode that pointers have.
|
||||
After generation of rtl, the compiler makes no further distinction
|
||||
between pointers and any other objects of this machine mode. */
|
||||
#define Pmode SImode
|
||||
|
||||
/* A function address in a call instruction
|
||||
is a byte address (for indexing purposes)
|
||||
so give the MEM rtx a byte's mode. */
|
||||
#define FUNCTION_MODE QImode
|
||||
|
||||
/* Compute the cost of computing a constant rtl expression RTX
|
||||
whose rtx-code is CODE. The body of this macro is a portion
|
||||
of a switch statement. If the code is computed here,
|
||||
return it with a return statement. Otherwise, break from the switch. */
|
||||
|
||||
#define CONST_COSTS(RTX,CODE,OUTER_CODE) \
|
||||
case CONST_INT: \
|
||||
/* Constant zero is super cheap due to clr instruction. */ \
|
||||
if (RTX == const0_rtx) return 0; \
|
||||
if ((unsigned) INTVAL (RTX) < 077) return 1; \
|
||||
case CONST: \
|
||||
case LABEL_REF: \
|
||||
case SYMBOL_REF: \
|
||||
return 3; \
|
||||
case CONST_DOUBLE: \
|
||||
return 5;
|
||||
|
||||
/*
|
||||
* We can use the BSD C library routines for the gnulib calls that are
|
||||
* still generated, since that's what they boil down to anyways.
|
||||
*/
|
||||
|
||||
/* #define UDIVSI3_LIBCALL "*udiv" */
|
||||
/* #define UMODSI3_LIBCALL "*urem" */
|
||||
|
||||
/* Tell final.c how to eliminate redundant test instructions. */
|
||||
|
||||
/* Here we define machine-dependent flags and fields in cc_status
|
||||
(see `conditions.h'). No extra ones are needed for the vax. */
|
||||
|
||||
/* Store in cc_status the expressions
|
||||
that the condition codes will describe
|
||||
after execution of an instruction whose pattern is EXP.
|
||||
Do not alter them if the instruction would not alter the cc's. */
|
||||
|
||||
#define NOTICE_UPDATE_CC(EXP, INSN) \
|
||||
CC_STATUS_INIT;
|
||||
|
||||
|
||||
/* Control the assembler format that we output. */
|
||||
|
||||
/* Output the name of the file we are compiling. */
|
||||
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
|
||||
do { fprintf (STREAM, "\t.file\t"); \
|
||||
output_quoted_string (STREAM, NAME); \
|
||||
fprintf (STREAM, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* Output at beginning of assembler file. */
|
||||
#define ASM_FILE_START(FILE) fprintf (FILE, "");
|
||||
|
||||
/* Output to assembler file text saying following lines
|
||||
may contain character constants, extra white space, comments, etc. */
|
||||
|
||||
#define ASM_APP_ON ""
|
||||
|
||||
/* Output to assembler file text saying following lines
|
||||
no longer contain unusual constructs. */
|
||||
|
||||
#define ASM_APP_OFF ""
|
||||
|
||||
/* Output before read-only data. */
|
||||
|
||||
#define TEXT_SECTION_ASM_OP "\t.inst"
|
||||
|
||||
/* Output before writable data. */
|
||||
|
||||
#define DATA_SECTION_ASM_OP "\t.var"
|
||||
|
||||
/* How to refer to registers in assembler output.
|
||||
This sequence is indexed by compiler's hard-register-number (see above). */
|
||||
|
||||
#define REGISTER_NAMES \
|
||||
{".r0", ".r1", ".r2", ".r3", ".r4", ".r5", ".r6", ".r7", ".r8", \
|
||||
".r9", ".r10", ".r11", ".r12", ".r13", ".r14", ".sp"}
|
||||
|
||||
/* This is BSD, so it wants DBX format. */
|
||||
|
||||
/* #define DBX_DEBUGGING_INFO */
|
||||
|
||||
/* How to renumber registers for dbx and gdb.
|
||||
Vax needs no change in the numeration. */
|
||||
|
||||
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
|
||||
|
||||
/* Do not break .stabs pseudos into continuations. */
|
||||
|
||||
#define DBX_CONTIN_LENGTH 0
|
||||
|
||||
/* This is the char to use for continuation (in case we need to turn
|
||||
continuation back on). */
|
||||
|
||||
#define DBX_CONTIN_CHAR '?'
|
||||
|
||||
/* Don't use the `xsfoo;' construct in DBX output; this system
|
||||
doesn't support it. */
|
||||
|
||||
#define DBX_NO_XREFS
|
||||
|
||||
/* This is how to output the definition of a user-level label named NAME,
|
||||
such as the label on a static function or variable NAME. */
|
||||
|
||||
#define ASM_OUTPUT_LABEL(FILE,NAME) \
|
||||
do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
|
||||
|
||||
/* This is how to output a command to make the user-level label named NAME
|
||||
defined for reference from other files. */
|
||||
|
||||
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
|
||||
do { fputs ("\t.extdef\t", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
|
||||
|
||||
/* The prefix to add to user-visible assembler symbols. */
|
||||
|
||||
#define USER_LABEL_PREFIX ""
|
||||
|
||||
/* This is how to output an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class. */
|
||||
|
||||
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
|
||||
fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
|
||||
|
||||
/* This is how to store into the string LABEL
|
||||
the symbol_ref name of an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class.
|
||||
This is suitable for output with `assemble_name'. */
|
||||
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
|
||||
sprintf (LABEL, ".%s%d", PREFIX, NUM)
|
||||
|
||||
/* This is how to output an assembler line defining a `double' constant.
|
||||
It is .dfloat or .gfloat, depending. */
|
||||
|
||||
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
|
||||
{ union {double d; int i[2]; } tem; \
|
||||
tem.d = (VALUE); \
|
||||
fprintf (FILE, "\t.data\t%d{32}, %d{32}\n", tem.i[0], tem.i[1]); }
|
||||
|
||||
/* This is how to output an assembler line defining a `float' constant. */
|
||||
|
||||
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
|
||||
{ union {float f; int i; } tem; \
|
||||
tem.f = (VALUE); \
|
||||
fprintf (FILE, "\t.data %d{32}\n", tem.i); }
|
||||
|
||||
/* This is how to output an assembler line defining an `int' constant. */
|
||||
|
||||
#define ASM_OUTPUT_INT(FILE,VALUE) \
|
||||
( \
|
||||
fprintf (FILE, "\t.data\t"), \
|
||||
output_addr_const (FILE, (VALUE)), \
|
||||
fprintf (FILE, "{32}\n"))
|
||||
|
||||
#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
|
||||
{ \
|
||||
fprintf (FILE, "\t.data\t"); \
|
||||
if (GET_CODE (VALUE) == CONST_DOUBLE) \
|
||||
{ \
|
||||
fprintf (FILE, "%d", CONST_DOUBLE_HIGH (VALUE)); \
|
||||
fprintf (FILE, "{32}, "); \
|
||||
fprintf (FILE, "%d", CONST_DOUBLE_LOW (VALUE)); \
|
||||
fprintf (FILE, "{32}\n"); \
|
||||
} else if (GET_CODE (VALUE) == CONST_INT) \
|
||||
{ \
|
||||
int val = INTVAL (VALUE); \
|
||||
fprintf (FILE, "%d", val < 0 ? -1 : 0); \
|
||||
fprintf (FILE, "{32}, "); \
|
||||
fprintf (FILE, "%d", val); \
|
||||
fprintf (FILE, "{32}\n"); \
|
||||
} else abort (); \
|
||||
}
|
||||
|
||||
/* Likewise for `char' and `short' constants. */
|
||||
|
||||
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
|
||||
( fprintf (FILE, "\t.data\t"), \
|
||||
output_addr_const (FILE, (VALUE)), \
|
||||
fprintf (FILE, "{16}\n"))
|
||||
|
||||
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
|
||||
( fprintf (FILE, "\t.data\t"), \
|
||||
output_addr_const (FILE, (VALUE)), \
|
||||
fprintf (FILE, "{8}\n"))
|
||||
|
||||
/* This is how to output an assembler line for a numeric constant byte. */
|
||||
|
||||
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
|
||||
fprintf (FILE, "\t.data\t%d{8}\n", (VALUE))
|
||||
|
||||
/* This is how to output an insn to push a register on the stack.
|
||||
It need not be very fast code. */
|
||||
|
||||
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
|
||||
fprintf (FILE, "\tsubi.64\t4,.sp\n\tst.32\t%s,[.sp]\n", reg_names[REGNO])
|
||||
|
||||
/* This is how to output an insn to pop a register from the stack.
|
||||
It need not be very fast code. */
|
||||
|
||||
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
|
||||
fprintf (FILE, "\tld.32\t%s,[.sp]\n\taddi.64\t4,.sp\n", reg_names[REGNO])
|
||||
|
||||
/* This is how to output an element of a case-vector that is absolute.
|
||||
(The Vax does not use such vectors,
|
||||
but we must define this macro anyway.) */
|
||||
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
|
||||
fprintf (FILE, "\t.data .L%d{32}\n", VALUE)
|
||||
|
||||
/* This is how to output an element of a case-vector that is relative. */
|
||||
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
fprintf (FILE, "\t.data .L%d-.L%d{32}\n", VALUE, REL)
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); else 0
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter by SIZE bytes. */
|
||||
|
||||
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
|
||||
fprintf (FILE, "\t.space %d\n", (SIZE))
|
||||
|
||||
/* This says how to output an assembler line
|
||||
to define a global common symbol. */
|
||||
|
||||
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
|
||||
( fputs (".comm ", (FILE)), \
|
||||
assemble_name ((FILE), (NAME)), \
|
||||
fprintf ((FILE), ",%d\n", (ROUNDED)))
|
||||
|
||||
/* This says how to output an assembler line
|
||||
to define a local common symbol. */
|
||||
|
||||
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
|
||||
( fputs (".bss ", (FILE)), \
|
||||
assemble_name ((FILE), (NAME)), \
|
||||
fprintf ((FILE), ",%d,%d\n", (SIZE),(ROUNDED)))
|
||||
|
||||
/* Store in OUTPUT a string (made with alloca) containing
|
||||
an assembler-name for a local static variable named NAME.
|
||||
LABELNO is an integer which is different for each call. */
|
||||
|
||||
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
||||
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
|
||||
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
|
||||
|
||||
/* Define the parentheses used to group arithmetic operations
|
||||
in assembler code. */
|
||||
|
||||
#define ASM_OPEN_PAREN "("
|
||||
#define ASM_CLOSE_PAREN ")"
|
||||
|
||||
/* Define results of standard character escape sequences. */
|
||||
#define TARGET_BELL 007
|
||||
#define TARGET_BS 010
|
||||
#define TARGET_TAB 011
|
||||
#define TARGET_NEWLINE 012
|
||||
#define TARGET_VT 013
|
||||
#define TARGET_FF 014
|
||||
#define TARGET_CR 015
|
||||
|
||||
/* Print an instruction operand X on file FILE.
|
||||
CODE is the code from the %-spec that requested printing this operand;
|
||||
if `%z3' was used to print operand 3, then CODE is 'z'. */
|
||||
|
||||
#define PRINT_OPERAND(FILE, X, CODE) \
|
||||
{ \
|
||||
if (CODE == 'r' && GET_CODE (X) == MEM && GET_CODE (XEXP (X, 0)) == REG) \
|
||||
fprintf (FILE, "%s", reg_names[REGNO (XEXP (X, 0))]); \
|
||||
else if (GET_CODE (X) == REG) \
|
||||
fprintf (FILE, "%s", reg_names[REGNO (X)]); \
|
||||
else if (GET_CODE (X) == MEM) \
|
||||
output_address (XEXP (X, 0)); \
|
||||
else \
|
||||
{ \
|
||||
/*debug_rtx(X);*/ \
|
||||
putc ('=', FILE); \
|
||||
output_addr_const (FILE, X); } \
|
||||
}
|
||||
|
||||
/* Print a memory operand whose address is X, on file FILE.
|
||||
This uses a function in output-vax.c. */
|
||||
|
||||
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
|
||||
print_operand_address (FILE, ADDR)
|
||||
|
||||
/* Functions used in the md file. */
|
||||
|
||||
extern char *cmp_set();
|
||||
extern char *cmp_jmp();
|
||||
|
||||
/* These are stubs, and have yet to bee written. */
|
||||
|
||||
#define TRAMPOLINE_SIZE 26
|
||||
#define TRAMPOLINE_TEMPLATE(FILE)
|
||||
#define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
||||
# Our make needs a little help...
|
||||
MAKE=make
|
||||
|
||||
# We don't support -g yet, so don't try and use it.
|
||||
CFLAGS =
|
||||
LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS)
|
||||
|
||||
# Hide xmalloc so that it does not conflict with the one in libc.a, Ick!
|
||||
X_CFLAGS = -Dxmalloc=my_xmalloc
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user