From: Jeff Law Date: Sat, 31 Aug 1996 17:23:49 +0000 (+0000) Subject: * v850-opc.c (insert_d9, insert_d22): Slightly improve error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb8c25a3e47615965c865fdd252429f2def6c934;p=binutils-gdb.git * v850-opc.c (insert_d9, insert_d22): Slightly improve error message. Issue an error if the branch offset is odd. --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e84ff627f42..b28d4ebe014 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,6 +1,9 @@ start-sanitize-v850 Sat Aug 31 01:27:26 1996 Jeffrey A Law (law@cygnus.com) + * v850-opc.c (insert_d9, insert_d22): Slightly improve error + message. Issue an error if the branch offset is odd. + * v850-opc.c: Add notes about needing special insert/extract for all the load/store insns, except "ld.b" and "st.b". diff --git a/opcodes/v850-opc.c b/opcodes/v850-opc.c index 4530231160f..d7845e3d9f9 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)); }