diff options
author | Alan Modra <amodra@gmail.com> | 2003-12-04 11:07:22 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-12-04 11:07:22 +0000 |
commit | 8f8077465d4315c8f9e7a3572e7bb46d42c31188 (patch) | |
tree | 833de61b90422f938afa2b0e738250be7f6015f6 /opcodes | |
parent | ccfa34023338390c8f4becd23a377e36e5f30d3c (diff) | |
download | gdb-8f8077465d4315c8f9e7a3572e7bb46d42c31188.zip gdb-8f8077465d4315c8f9e7a3572e7bb46d42c31188.tar.gz gdb-8f8077465d4315c8f9e7a3572e7bb46d42c31188.tar.bz2 |
* openrisc-asm.c: Regenerate.
* pj-opc.c: Update copyright date.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/openrisc-asm.c | 65 | ||||
-rw-r--r-- | opcodes/pj-opc.c | 2 |
3 files changed, 47 insertions, 25 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index bc76e63..c8decc7 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2003-12-04 Alan Modra <amodra@bigpond.net.au> + + * openrisc-asm.c: Regenerate. + * pj-opc.c: Update copyright date. + 2003-12-03 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> * m32r-asm.c: Regenerate. diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c index 9f6ee32..ad97790 100644 --- a/opcodes/openrisc-asm.c +++ b/opcodes/openrisc-asm.c @@ -60,7 +60,7 @@ long openrisc_sign_extend_16bit (value) long value; { - return (long) (short) value; + return ((value & 0xffff) ^ 0x8000) - 0x8000; } /* Handle hi(). */ @@ -74,15 +74,16 @@ parse_hi16 (cd, strp, opindex, valuep) { const char *errmsg; enum cgen_parse_operand_result result_type; - bfd_vma value; + unsigned long ret; if (**strp == '#') ++*strp; if (strncasecmp (*strp, "hi(", 3) == 0) { - *strp += 3; + bfd_vma value; + *strp += 3; #if 0 errmsg = cgen_parse_signed_integer (cd, strp, opindex, valuep); if (errmsg != NULL) @@ -92,23 +93,31 @@ parse_hi16 (cd, strp, opindex, valuep) errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, &result_type, &value); if (**strp != ')') - return "missing `)'"; + return _("missing `)'"); + ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) value >>= 16; - *valuep = (long) (short) value; - - return errmsg; + ret = value; } else { if (**strp == '-') - errmsg = cgen_parse_signed_integer (cd, strp, opindex, (long *) &value); + { + long value; + errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); + ret = value; + } else - errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, (unsigned long *) &value); + { + unsigned long value; + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); + ret = value; + } } - *valuep = (long) (short) (value & 0xffff); + + *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; return errmsg; } @@ -123,15 +132,16 @@ parse_lo16 (cd, strp, opindex, valuep) { const char *errmsg; enum cgen_parse_operand_result result_type; - bfd_vma value; + unsigned long ret; if (**strp == '#') ++*strp; if (strncasecmp (*strp, "lo(", 3) == 0) { - *strp += 3; + bfd_vma value; + *strp += 3; #if 0 errmsg = cgen_parse_signed_integer (cd, strp, opindex, valuep); if (errmsg != NULL) @@ -142,21 +152,28 @@ parse_lo16 (cd, strp, opindex, valuep) errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, &result_type, &value); if (**strp != ')') - return "missing `)'"; - ++*strp; - if (errmsg == NULL - && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - value &= 0xffff; - *valuep = (long) (short) value; + return _("missing `)'"); - return errmsg; + ++*strp; + ret = value; } - - if (**strp == '-') - errmsg = cgen_parse_signed_integer (cd, strp, opindex, (long *) &value); else - errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, (unsigned long *) &value); - *valuep = (long) (short) (value & 0xffff); + { + if (**strp == '-') + { + long value; + errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); + ret = value; + } + else + { + unsigned long value; + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); + ret = value; + } + } + + *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; return errmsg; } diff --git a/opcodes/pj-opc.c b/opcodes/pj-opc.c index 68ca05e..218496d 100644 --- a/opcodes/pj-opc.c +++ b/opcodes/pj-opc.c @@ -1,5 +1,5 @@ /* pj-opc.c -- Definitions for picoJava opcodes. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. Contributed by Steve Chamberlain of Transmeta (sac@pobox.com). This program is free software; you can redistribute it and/or modify |