summaryrefslogtreecommitdiff
path: root/opcodes/m32r-asm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-10-26 07:49:05 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-10-26 07:49:05 +0000
commitbdd63628d707748c2e719cd0de16501be0049971 (patch)
tree50f6a31737b3d25739dd967155deec287ba81c24 /opcodes/m32r-asm.c
parent12b58d79d8858df9900c6070cfc83ca01897dcae (diff)
downloadgdb-bdd63628d707748c2e719cd0de16501be0049971.tar.gz
* m32r.opc (parse_hi16): Do not assume a 32-bit host word size.
Diffstat (limited to 'opcodes/m32r-asm.c')
-rw-r--r--opcodes/m32r-asm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c
index 50f1363e777..a5bd3633168 100644
--- a/opcodes/m32r-asm.c
+++ b/opcodes/m32r-asm.c
@@ -89,7 +89,10 @@ parse_hi16 (CGEN_CPU_DESC cd,
++*strp;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- value >>= 16;
+ {
+ value >>= 16;
+ value &= 0xffff;
+ }
*valuep = value;
return errmsg;
}
@@ -104,8 +107,9 @@ parse_hi16 (CGEN_CPU_DESC cd,
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
{
- value = value + (value & 0x8000 ? 0x10000 : 0);
+ value += 0x8000;
value >>= 16;
+ value &= 0xffff;
}
*valuep = value;
return errmsg;