From ae50416c27c356f907fc3006c88b79751efbbb5a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 4 Dec 2003 11:07:22 +0000 Subject: * openrisc-asm.c: Regenerate. * pj-opc.c: Update copyright date. --- opcodes/ChangeLog | 5 ++++ opcodes/openrisc-asm.c | 65 +++++++++++++++++++++++++++++++------------------- opcodes/pj-opc.c | 2 +- 3 files changed, 47 insertions(+), 25 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index bc76e638c3..c8decc7d22 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2003-12-04 Alan Modra + + * openrisc-asm.c: Regenerate. + * pj-opc.c: Update copyright date. + 2003-12-03 Kazuhiro Inaoka * m32r-asm.c: Regenerate. diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c index 9f6ee32588..ad977907d9 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 68ca05e20f..218496ddbb 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 -- cgit v1.2.1