summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1998-03-06 19:40:53 +0000
committerDoug Evans <dje@google.com>1998-03-06 19:40:53 +0000
commitd030671bfc3affe14cd56137f4f343290942fbb7 (patch)
tree3ce53839cd000ba6d69cdb6b98aa89475eb5223b
parent4aa141721dd8c1a96a87ddda4f6389dbd71e319f (diff)
downloadppe42-binutils-d030671bfc3affe14cd56137f4f343290942fbb7.tar.gz
ppe42-binutils-d030671bfc3affe14cd56137f4f343290942fbb7.zip
* config/tc-dvp.c (s_endgif): Fix nloop calc and test. Warn if
insufficient data present. Fix insertion of computed nloop value.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-dvp.c71
2 files changed, 56 insertions, 22 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d0edb86cd4..76b38975f2 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+start-sanitize-sky
+Fri Mar 6 11:36:37 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * config/tc-dvp.c (s_endgif): Fix nloop calc and test. Warn if
+ insufficient data present. Fix insertion of computed nloop value.
+
+end-sanitize-sky
start-sanitize-vr4320
Tue Mar 3 11:37:26 1998 Gavin Koch <gavin@cygnus.com>
diff --git a/gas/config/tc-dvp.c b/gas/config/tc-dvp.c
index 9c2e4cdc92..7907161df2 100644
--- a/gas/config/tc-dvp.c
+++ b/gas/config/tc-dvp.c
@@ -2113,7 +2113,9 @@ s_endgif (ignore)
int ignore;
{
long count;
- int nloop = gif_nloop ();
+ int specified_nloop = gif_nloop ();
+ int computed_nloop;
+ int nregs = gif_nregs ();
if (CUR_ASM_STATE != ASM_GIF)
{
@@ -2124,10 +2126,7 @@ s_endgif (ignore)
/* The -16 is because the `gif_data_name' label is emitted at the start
of the gif tag. */
- if (gif_insn_type == GIF_REGLIST)
- count = eval_expr (0, 0, "(. - %s - 16) >> 3", gif_data_name);
- else
- count = eval_expr (0, 0, "(. - %s - 16) >> 4", gif_data_name);
+ count = eval_expr (0, 0, ". - %s - 16", gif_data_name);
if (count < 0
|| fixup_count != 0)
@@ -2136,23 +2135,51 @@ s_endgif (ignore)
return;
}
- /* Validate nloop if specified. Otherwise write the computed value into
- the insn. */
- if (nloop != -1)
+ /* Compute a value for nloop.
+ Also check whether we're left on a double/quadword boundary. */
+ switch (gif_insn_type)
{
- int ok_p;
-
- switch (gif_insn_type)
+ case GIF_PACKED :
+ if (count % 16 != 0)
+ as_warn ("data doesn't fill last quadword");
+ if (nregs == 0)
{
- case GIF_PACKED :
- case GIF_REGLIST :
- ok_p = count == nloop * gif_nregs ();
- break;
- case GIF_IMAGE :
- ok_p = count == nloop;
- break;
+ if (count != 0)
+ as_warn ("non-zero amount of data, but no registers specified");
+ computed_nloop = 0;
+ }
+ else
+ computed_nloop = (count >> 4) / nregs;
+ break;
+ case GIF_REGLIST :
+ if (count % 8 != 0)
+ as_warn ("data doesn't fill last doubleword");
+ /* Fill out to quadword if odd number of doublewords. */
+ if (nregs == 0)
+ {
+ if (count != 0)
+ as_warn ("non-zero amount of data, but no registers specified");
+ computed_nloop = 0;
}
- if (! ok_p)
+ else
+ computed_nloop = (count >> 3) / nregs;
+ break;
+ case GIF_IMAGE :
+ if (count % 16 != 0)
+ as_warn ("data doesn't fill last quadword");
+ computed_nloop = count >> 4;
+ break;
+ }
+
+ /* FIXME: How should be handle the case where count is not a proper
+ multiple of 8/16? We could just always emit a .align 16 or some
+ such. */
+
+ /* Validate nloop if specified. Otherwise write the computed value into
+ the insn. */
+ if (specified_nloop != -1)
+ {
+ if (computed_nloop != specified_nloop)
{
as_warn ("nloop value does not match size of data");
return;
@@ -2160,14 +2187,14 @@ s_endgif (ignore)
}
else
{
- DVP_INSN insn = bfd_getl32 (gif_insn_frag + 12);
+ DVP_INSN insn = bfd_getl32 (gif_insn_frag);
char *file;
unsigned int line;
as_where (&file, &line);
insert_operand_final (DVP_GIF, &gif_operands[gif_operand_nloop],
DVP_MOD_THIS_WORD, &insn,
- (offsetT) nloop, file, line);
- bfd_putl32 ((bfd_vma) insn, gif_insn_frag + 12);
+ (offsetT) computed_nloop, file, line);
+ bfd_putl32 ((bfd_vma) insn, gif_insn_frag);
}
gif_data_name = NULL;
OpenPOWER on IntegriCloud