aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tic6x.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2010-10-07 11:28:49 +0000
committerBernd Schmidt <bernds@codesourcery.com>2010-10-07 11:28:49 +0000
commit5d4c71e1273480dd7ced19e193649093b30f1bd1 (patch)
tree80f87c5301c440a4a86b344c4475c2469a0ab2e1 /gas/config/tc-tic6x.c
parent1d2a4540a591685f1d4a126ea54b5b62478de1b5 (diff)
downloadgdb-5d4c71e1273480dd7ced19e193649093b30f1bd1.zip
gdb-5d4c71e1273480dd7ced19e193649093b30f1bd1.tar.gz
gdb-5d4c71e1273480dd7ced19e193649093b30f1bd1.tar.bz2
gas/
* config/tc-tic6x.c (tic6x_try_encode): Correct encoding of fstg field in SPKERNEL instructions. opcodes/ * tic6x-dis.c (print_insn_tic6x): Correct decoding of fstg field in SPKERNEL instructions. gas/testsuite/ * gas/tic6x/insns-c674x-sploop.d: Add two more sploop/spkernel tests. * gas/tic6x/insns-c674x-sploop.s: Likewise.
Diffstat (limited to 'gas/config/tc-tic6x.c')
-rw-r--r--gas/config/tc-tic6x.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index f1c28d0..c706158 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -2503,6 +2503,7 @@ tic6x_try_encode (tic6x_opcode_id id, tic6x_operand *operands,
if (opct->variable_fields[fld].coding_method == tic6x_coding_fstg)
{
+ int i, t;
if (operands[opno].value.exp.X_add_number < 0
|| (operands[opno].value.exp.X_add_number
>= (1 << (fldd->width - fcyc_bits))))
@@ -2513,7 +2514,13 @@ tic6x_try_encode (tic6x_opcode_id id, tic6x_operand *operands,
*ok = FALSE;
return 0;
}
- value = operands[opno].value.exp.X_add_number << fcyc_bits;
+ value = operands[opno].value.exp.X_add_number;
+ for (t = 0, i = fcyc_bits; i < fldd->width; i++)
+ {
+ t = (t << 1) | (value & 1);
+ value >>= 1;
+ }
+ value = t << fcyc_bits;
}
else
{