* tc-txvu.[ch]: New files.

This commit is contained in:
Doug Evans
1997-12-22 17:55:19 +00:00
parent 1eb4e37728
commit 209fb34642
3 changed files with 310 additions and 0 deletions

View File

@ -35,6 +35,14 @@ else
lose_these_too="${tic80_files} ${lose_these_too}"
fi
sky_files="tc-txvu.c tc-txvu.h"
if ( echo $* | grep keep\-sky > /dev/null ) ; then
keep_these_too="${sky_files} ${keep_these_too}"
else
lose_these_too="${sky_files} ${lose_these_too}"
fi
# All files listed between the "Things-to-keep:" line and the
# "Files-to-sed:" line will be kept. All other files will be removed.
# Directories listed in this section will have their own Sanitize

246
gas/config/tc-txvu.c Normal file
View File

@ -0,0 +1,246 @@
/* tc-txvu.c -- Assembler for the TX VU.
Copyright (C) 1997 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
GAS 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.
GAS 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 GAS; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <ctype.h>
#include "as.h"
#include "subsegs.h"
const char comment_chars[] = ";";
const char line_comment_chars[] = "#";
const char line_separator_chars[] = "!";
const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
const char *md_shortopts = "";
struct option md_longopts[] =
{
/* insert options here */
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
int
md_parse_option (c, arg)
int c;
char *arg;
{
return 0;
}
void
md_show_usage (stream)
FILE *stream;
{
#if 0
fprintf (stream, "TX VU options:\n");
#endif
}
/* Set by md_assemble for use by txvu_fill_insn. */
static subsegT prev_subseg;
static segT prev_seg;
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] =
{
{ "word", cons, 4 },
{ NULL, NULL, 0 }
};
void
md_begin ()
{
flagword applicable;
segT seg;
subsegT subseg;
/* Save the current subseg so we can restore it [it's the default one and
we don't want the initial section to be .sbss. */
seg = now_seg;
subseg = now_subseg;
subseg_set (seg, subseg);
}
void
md_assemble (str)
char *str;
{
}
void
md_operand (expressionP)
expressionS *expressionP;
{
}
valueT
md_section_align (segment, size)
segT segment;
valueT size;
{
int align = bfd_get_section_alignment (stdoutput, segment);
return ((size + (1 << align) - 1) & (-1 << align));
}
symbolS *
md_undefined_symbol (name)
char *name;
{
return 0;
}
/* Functions concerning relocs. */
/* The location from which a PC relative jump should be calculated,
given a PC relative reloc. */
long
md_pcrel_from_section (fixP, sec)
fixS *fixP;
segT sec;
{
if (fixP->fx_addsy != (symbolS *) NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
{
/* The symbol is undefined (or is defined but not in this section).
Let the linker figure it out. */
return 0;
}
/* FIXME: `& -16L'? */
return (fixP->fx_frag->fr_address + fixP->fx_where) & -4L;
}
/* Apply a fixup to the object code. This is called for all the
fixups we generated by calls to fix_new_exp. At this point all symbol
values should be fully resolved, and we attempt to completely resolve the
reloc. If we can not do that, we determine the correct reloc code and put
it back in the fixup. */
int
md_apply_fix3 (fixP, valueP, seg)
fixS *fixP;
valueT *valueP;
segT seg;
{
char *where = fixP->fx_frag->fr_literal + fixP->fx_where;
valueT value;
as_fatal ("txvu md_apply_fix3\n");
}
/* Translate internal representation of relocation info to BFD target
format. */
arelent *
tc_gen_reloc (section, fixp)
asection *section;
fixS *fixp;
{
/* relocs not handled yet */
as_fatal ("txvu tc_gen_reloc\n");
}
/* Write a value out to the object file, using the appropriate endianness. */
void
md_number_to_chars (buf, val, n)
char *buf;
valueT val;
int n;
{
if (target_big_endian)
number_to_chars_bigendian (buf, val, n);
else
number_to_chars_littleendian (buf, val, n);
}
/* Turn a string in input_line_pointer into a floating point constant of type
type, and store the appropriate bytes in *litP. The number of LITTLENUMS
emitted is stored in *sizeP . An error message is returned, or NULL on OK.
*/
/* Equal to MAX_PRECISION in atof-ieee.c */
#define MAX_LITTLENUMS 6
char *
md_atof (type, litP, sizeP)
char type;
char *litP;
int *sizeP;
{
int i,prec;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
LITTLENUM_TYPE *wordP;
char *t;
char *atof_ieee ();
switch (type)
{
case 'f':
case 'F':
case 's':
case 'S':
prec = 2;
break;
case 'd':
case 'D':
case 'r':
case 'R':
prec = 4;
break;
/* FIXME: Some targets allow other format chars for bigger sizes here. */
default:
*sizeP = 0;
return "Bad call to md_atof()";
}
t = atof_ieee (input_line_pointer, type, words);
if (t)
input_line_pointer = t;
*sizeP = prec * sizeof (LITTLENUM_TYPE);
if (target_big_endian)
{
for (i = 0; i < prec; i++)
{
md_number_to_chars (litP, (valueT) words[i], sizeof (LITTLENUM_TYPE));
litP += sizeof (LITTLENUM_TYPE);
}
}
else
{
for (i = prec - 1; i >= 0; i--)
{
md_number_to_chars (litP, (valueT) words[i], sizeof (LITTLENUM_TYPE));
litP += sizeof (LITTLENUM_TYPE);
}
}
return 0;
}

56
gas/config/tc-txvu.h Normal file
View File

@ -0,0 +1,56 @@
/* tc-txvu.h -- Header file for tc-txvu.c.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS 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.
GAS 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 GAS; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TC_TXVU
#ifndef BFD_ASSEMBLER
/* leading space so will compile with cc */
#error TXVU support requires BFD_ASSEMBLER
#endif
#define LISTING_HEADER "TXVU GAS "
/* The target BFD architecture. */
#define TARGET_ARCH bfd_arch_txvu
#define TARGET_FORMAT "elf32-txvu"
#define TARGET_BYTES_BIG_ENDIAN 0
/* call md_pcrel_from_section, not md_pcrel_from */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC)
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
#define DIFF_EXPR_OK /* .-foo gets turned into PC relative relocs */
/* We don't need to handle .word strangely. */
#define WORKING_DOT_WORD
#define md_convert_frag(b,s,f) {as_fatal ("txvu convert_frag\n");}
#define md_estimate_size_before_relax(f,s) \
(as_fatal("estimate_size_before_relax called"),1)
#define MD_APPLY_FIX3
extern int txvu_md_apply_fix3 ();
#define md_apply_fix3 txvu_md_apply_fix3
#define TC_HANDLES_FX_DONE