aboutsummaryrefslogtreecommitdiff
path: root/opcodes/csky-dis.c
diff options
context:
space:
mode:
authorCooper Qu <cooper.qu@linux.alibaba.com>2020-10-12 22:29:09 +0800
committerLifang Xia <xlf194833_xia@alibaba-inc.com>2020-10-26 16:13:55 +0800
commit039dac293d5df5d933808aa5d946b80fd0a84794 (patch)
tree333b7a4b677577707bcb11c8042bf7a4e2945eda /opcodes/csky-dis.c
parent069ef164801ff68e2ce5d24a2601b1fb6d3acedb (diff)
downloadgdb-039dac293d5df5d933808aa5d946b80fd0a84794.zip
gdb-039dac293d5df5d933808aa5d946b80fd0a84794.tar.gz
gdb-039dac293d5df5d933808aa5d946b80fd0a84794.tar.bz2
CSKY: Fix and add some instructions for VDSPV1.
gas/ * config/tc-csky.c (get_operand_value): Add handler for OPRND_TYPE_IMM5b_VSH and OPRND_TYPE_VREG_WITH_INDEX. * testsuite/gas/csky/csky_vdsp.d : Fix the disassembling for vector register. opcodes/ * csky-dis.c (csky_output_operand): Add handler for OPRND_TYPE_IMM5b_VSH and OPRND_TYPE_VREG_WITH_INDEX. * csky-opc.h (OPRND_TYPE_VREG_WITH_INDEX): New enum. (OPRND_TYPE_IMM5b_VSH): New enum. (csky_v2_opcodes): Fix and add some instructions for VDSPV1. Change-Id: Ia5675d7b716fe5c331e6121ad8f83061ef6454bb
Diffstat (limited to 'opcodes/csky-dis.c')
-rw-r--r--opcodes/csky-dis.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/opcodes/csky-dis.c b/opcodes/csky-dis.c
index b31b685..4916bb6 100644
--- a/opcodes/csky-dis.c
+++ b/opcodes/csky-dis.c
@@ -415,6 +415,15 @@ csky_output_operand (char *str, struct operand const *oprnd,
strcat (str, buf);
ret = 0;
break;
+ case OPRND_TYPE_IMM5b_VSH:
+ {
+ char num[128];
+ value = ((value & 0x1) << 4) | (value >> 1);
+ sprintf (num, "%d", (int)value);
+ strcat (str, num);
+ ret = 0;
+ break;
+ }
case OPRND_TYPE_MSB2SIZE:
case OPRND_TYPE_LSB2SIZE:
{
@@ -837,7 +846,7 @@ csky_output_operand (char *str, struct operand const *oprnd,
else if ((value & 0x3) == 0x3)
strcat (str, "3");
break;
- case OPRND_TYPE_FREG_WITH_INDEX:
+ case OPRND_TYPE_VREG_WITH_INDEX:
{
unsigned freg_val = value & 0xf;
unsigned index_val = (value >> 4) & 0xf;
@@ -845,6 +854,14 @@ csky_output_operand (char *str, struct operand const *oprnd,
strcat(str, buf);
break;
}
+ case OPRND_TYPE_FREG_WITH_INDEX:
+ {
+ unsigned freg_val = value & 0xf;
+ unsigned index_val = (value >> 4) & 0xf;
+ sprintf (buf, "fr%d[%d]", freg_val, index_val);
+ strcat(str, buf);
+ break;
+ }
case OPRND_TYPE_REGr4_r7:
if (IS_CSKY_V1 (mach_flag))
{