aboutsummaryrefslogtreecommitdiff
path: root/opcodes/v850-opc.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-31 17:23:49 +0000
committerJeff Law <law@redhat.com>1996-08-31 17:23:49 +0000
commitfb8c25a3e47615965c865fdd252429f2def6c934 (patch)
tree0f63dd2c5995b4c7fa5afe6fb0f1282f7933de6e /opcodes/v850-opc.c
parent237b5c4c9a06de328ad591ef904d73d47f9344d7 (diff)
downloadgdb-fb8c25a3e47615965c865fdd252429f2def6c934.zip
gdb-fb8c25a3e47615965c865fdd252429f2def6c934.tar.gz
gdb-fb8c25a3e47615965c865fdd252429f2def6c934.tar.bz2
* v850-opc.c (insert_d9, insert_d22): Slightly improve error
message. Issue an error if the branch offset is odd.
Diffstat (limited to 'opcodes/v850-opc.c')
-rw-r--r--opcodes/v850-opc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/opcodes/v850-opc.c b/opcodes/v850-opc.c
index 4530231..d7845e3 100644
--- a/opcodes/v850-opc.c
+++ b/opcodes/v850-opc.c
@@ -267,7 +267,10 @@ insert_d9 (insn, value, errmsg)
const char **errmsg;
{
if (value > 255 || value <= -256)
- *errmsg = "value out of range";
+ *errmsg = "branch value out of range";
+
+ if ((value % 2) != 0)
+ *errmsg = "branch to odd offset";
return (insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3));
}
@@ -294,6 +297,9 @@ insert_d22 (insn, value, errmsg)
if (value > 0xfffff || value <= -0x100000)
*errmsg = "value out of range";
+ if ((value % 2) != 0)
+ *errmsg = "branch to odd offset";
+
return (insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16));
}