* config/tc-tic80.c (build_insn): Remove "extended" and replace with
"fx" and "fxfrag". Add "ffrag". Change code to initialize and use the right f/ffrag and fx/fxfrag pairs since instruction may be split across frags. PR 12899
This commit is contained in:
parent
3f9382002f
commit
e6e676a501
2 changed files with 31 additions and 13 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
start-sanitize-tic80
|
||||||
|
Thu Jul 24 12:13:19 1997 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
|
* config/tc-tic80.c (build_insn): Remove "extended" and replace with
|
||||||
|
"fx" and "fxfrag". Add "ffrag". Change code to initialize and use
|
||||||
|
the right f/ffrag and fx/fxfrag pairs since instruction may be split
|
||||||
|
across frags.
|
||||||
|
|
||||||
|
end-sanitize-tic80
|
||||||
Tue Jul 22 18:38:56 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
|
Tue Jul 22 18:38:56 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
|
||||||
|
|
||||||
* config/te-go32.h (USE_ALIGN_PTWO): Define.
|
* config/te-go32.h (USE_ALIGN_PTWO): Define.
|
||||||
|
|
|
@ -553,7 +553,11 @@ find_opcode (opcode, myops)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build_insn takes a pointer to the opcode entry in the opcode table
|
/* build_insn takes a pointer to the opcode entry in the opcode table
|
||||||
and the array of operand expressions and writes out the instruction. */
|
and the array of operand expressions and writes out the instruction.
|
||||||
|
|
||||||
|
Note that the opcode word and extended word may be written to different
|
||||||
|
frags, with the opcode at the end of one frag and the extension at the
|
||||||
|
beginning of the next. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
build_insn (opcode, opers)
|
build_insn (opcode, opers)
|
||||||
|
@ -563,8 +567,10 @@ build_insn (opcode, opers)
|
||||||
int expi; /* Index of current expression to match */
|
int expi; /* Index of current expression to match */
|
||||||
int opi; /* Index of current operand to match */
|
int opi; /* Index of current operand to match */
|
||||||
unsigned long insn[2]; /* Instruction and long immediate (if any) */
|
unsigned long insn[2]; /* Instruction and long immediate (if any) */
|
||||||
int extended = 0; /* Nonzero if instruction is 8 bytes */
|
char *f; /* Pointer to frag location for insn[0] */
|
||||||
char *f; /* Temporary pointer to output location */
|
fragS *ffrag; /* Frag containing location f */
|
||||||
|
char *fx = NULL; /* Pointer to frag location for insn[1] */
|
||||||
|
fragS *fxfrag; /* Frag containing location fx */
|
||||||
|
|
||||||
/* Start with the raw opcode bits from the opcode table. */
|
/* Start with the raw opcode bits from the opcode table. */
|
||||||
insn[0] = opcode -> opcode;
|
insn[0] = opcode -> opcode;
|
||||||
|
@ -573,6 +579,7 @@ build_insn (opcode, opers)
|
||||||
frag now. */
|
frag now. */
|
||||||
|
|
||||||
f = frag_more (4);
|
f = frag_more (4);
|
||||||
|
ffrag = frag_now;
|
||||||
|
|
||||||
/* For each operand expression, insert the appropriate bits into the
|
/* For each operand expression, insert the appropriate bits into the
|
||||||
instruction . */
|
instruction . */
|
||||||
|
@ -622,15 +629,16 @@ build_insn (opcode, opers)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
extended++;
|
fx = frag_more (4);
|
||||||
|
fxfrag = frag_now;
|
||||||
insn[1] = num;
|
insn[1] = num;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_symbol:
|
case O_symbol:
|
||||||
if (flags & TIC80_OPERAND_PCREL)
|
if (flags & TIC80_OPERAND_PCREL)
|
||||||
{
|
{
|
||||||
fix_new_exp (frag_now,
|
fix_new_exp (ffrag,
|
||||||
f - (frag_now -> fr_literal),
|
f - (ffrag -> fr_literal),
|
||||||
4, /* FIXME! how is this used? */
|
4, /* FIXME! how is this used? */
|
||||||
&opers[expi],
|
&opers[expi],
|
||||||
1,
|
1,
|
||||||
|
@ -638,10 +646,11 @@ build_insn (opcode, opers)
|
||||||
}
|
}
|
||||||
else if (bits == 32) /* was (flags & TIC80_OPERAND_BASEREL) */
|
else if (bits == 32) /* was (flags & TIC80_OPERAND_BASEREL) */
|
||||||
{
|
{
|
||||||
extended++;
|
fx = frag_more (4);
|
||||||
|
fxfrag = frag_now;
|
||||||
insn[1] = 0;
|
insn[1] = 0;
|
||||||
fix_new_exp (frag_now,
|
fix_new_exp (fxfrag,
|
||||||
(f + 4) - (frag_now -> fr_literal),
|
fx - (fxfrag -> fr_literal),
|
||||||
4,
|
4,
|
||||||
&opers[expi],
|
&opers[expi],
|
||||||
0,
|
0,
|
||||||
|
@ -676,7 +685,8 @@ build_insn (opcode, opers)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_big:
|
case O_big:
|
||||||
extended++;
|
fx = frag_more (4);
|
||||||
|
fxfrag = frag_now;
|
||||||
{
|
{
|
||||||
int precision = 2;
|
int precision = 2;
|
||||||
long exponent_bits = 8L;
|
long exponent_bits = 8L;
|
||||||
|
@ -720,10 +730,9 @@ build_insn (opcode, opers)
|
||||||
/* Write out the instruction, either 4 or 8 bytes. */
|
/* Write out the instruction, either 4 or 8 bytes. */
|
||||||
|
|
||||||
md_number_to_chars (f, insn[0], 4);
|
md_number_to_chars (f, insn[0], 4);
|
||||||
if (extended)
|
if (fx != NULL)
|
||||||
{
|
{
|
||||||
f = frag_more (4);
|
md_number_to_chars (fx, insn[1], 4);
|
||||||
md_number_to_chars (f, insn[1], 4);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue