aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Augustine <saugustine@google.com>2009-08-20 18:12:21 +0000
committerSterling Augustine <saugustine@google.com>2009-08-20 18:12:21 +0000
commitd8392fd9d7709174f48de10328a8de1eb7d48cd0 (patch)
treeeea0506800224e079cf447dcee4a5b62e78bd2e9
parent4efc6507960ac76505ebb1be9886f207ceb46c3a (diff)
downloadgdb-d8392fd9d7709174f48de10328a8de1eb7d48cd0.zip
gdb-d8392fd9d7709174f48de10328a8de1eb7d48cd0.tar.gz
gdb-d8392fd9d7709174f48de10328a8de1eb7d48cd0.tar.bz2
2009-08-20 Sterling Augustine <sterling@jaw.hq.tensilica.com>
* config/tc-xtensa.c (xg_copy_vinsn): New function. (finish_vinsn): Call xg_copy_vinsn.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-xtensa.c17
2 files changed, 19 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2292534..624e7c9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-20 Sterling Augustine <sterling@jaw.hq.tensilica.com>
+
+ * config/tc-xtensa.c (xg_copy_vinsn): New function.
+ (finish_vinsn): Call xg_copy_vinsn.
+
2009-08-19 Sterling Augustine <sterling@tensilica.com>
* config/tc-xtensa.h (xtensa_frag_data): Rename unused field fr_prev
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 645af97..fdca232 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -527,6 +527,7 @@ static int get_num_stack_literal_bytes (IStack *);
/* vliw_insn functions. */
static void xg_init_vinsn (vliw_insn *);
+static void xg_copy_vinsn (vliw_insn *, vliw_insn *);
static void xg_clear_vinsn (vliw_insn *);
static bfd_boolean vinsn_has_specific_opcodes (vliw_insn *);
static void xg_free_vinsn (vliw_insn *);
@@ -6653,7 +6654,6 @@ xg_find_narrowest_format (vliw_insn *vinsn)
xtensa_isa isa = xtensa_default_isa;
xtensa_format format;
- vliw_insn v_copy = *vinsn;
xtensa_opcode nop_opcode = xtensa_nop_opcode;
if (vinsn->num_slots == 1)
@@ -6661,7 +6661,8 @@ xg_find_narrowest_format (vliw_insn *vinsn)
for (format = 0; format < xtensa_isa_num_formats (isa); format++)
{
- v_copy = *vinsn;
+ vliw_insn v_copy;
+ xg_copy_vinsn (&v_copy, vinsn);
if (xtensa_format_num_slots (isa, format) == v_copy.num_slots)
{
int slot;
@@ -6696,7 +6697,7 @@ xg_find_narrowest_format (vliw_insn *vinsn)
}
if (fit == v_copy.num_slots)
{
- *vinsn = v_copy;
+ xg_copy_vinsn (vinsn, &v_copy);
xtensa_format_encode (isa, format, vinsn->insnbuf);
vinsn->format = format;
break;
@@ -11702,6 +11703,16 @@ xg_clear_vinsn (vliw_insn *v)
}
+static void
+xg_copy_vinsn (vliw_insn *dst, vliw_insn *src)
+{
+ memcpy (dst, src,
+ offsetof(vliw_insn, slots) + src->num_slots * sizeof(TInsn));
+ dst->insnbuf = src->insnbuf;
+ memcpy (dst->slotbuf, src->slotbuf, src->num_slots * sizeof(xtensa_insnbuf));
+}
+
+
static bfd_boolean
vinsn_has_specific_opcodes (vliw_insn *v)
{