From e277c00b2d473ff29a3f88204e80839d5b08c5df Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 26 Oct 2005 07:49:05 +0000 Subject: [PATCH] * m32r.opc (parse_hi16): Do not assume a 32-bit host word size. --- cpu/ChangeLog | 4 ++++ cpu/m32r.opc | 8 ++++++-- opcodes/ChangeLog | 4 ++++ opcodes/m32r-asm.c | 8 ++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 48311b21b3f..407b6bf7147 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,7 @@ +2005-10-26 Kazuhiro Inaoka + + * m32r.opc (parse_hi16): Do not assume a 32-bit host word size. + 2005-10-25 DJ Delorie * m32c.cpu (add16-bQ-sp,add16-wQ-sp): Fix to allow either width by diff --git a/cpu/m32r.opc b/cpu/m32r.opc index f2351b106a6..ab69d078c86 100644 --- a/cpu/m32r.opc +++ b/cpu/m32r.opc @@ -127,7 +127,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; } @@ -142,8 +145,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; diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 89ca63d51e7..42c6fe9bf47 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2005-10-26 Kazuhiro Inaoka + + * m32r-asm.c: Regenerate. + 2005-10-25 DJ Delorie * m32c-asm.c: Regenerate. 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; -- 2.30.2