X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fia64-dis.c;h=146464fecbaacce2e346158b3a732a1589f802ef;hb=32866df75ece22ec1fd88e99e3c5effe9238e072;hp=629a76820d3780304ac68c917991422d210eac1e;hpb=0228082a3c8835e2475666e63c1ee6b4b6d9ac32;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/ia64-dis.c b/opcodes/ia64-dis.c index 629a76820d..146464fecb 100644 --- a/opcodes/ia64-dis.c +++ b/opcodes/ia64-dis.c @@ -1,23 +1,23 @@ /* ia64-dis.c -- Disassemble ia64 instructions - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang - This file is part of GDB, GAS, and the GNU binutils. + This file is part of the GNU opcodes library. - GDB, GAS, and the GNU binutils are free software; you can redistribute - them and/or modify them under the terms of the GNU General Public - License as published by the Free Software Foundation; either version - 2, or (at your option) any later version. + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. - GDB, GAS, and the GNU binutils are distributed in the hope that they - will be useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - the GNU General Public License for more details. + It is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. You should have received a copy of the GNU General Public License along with this file; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include @@ -109,7 +109,7 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) if (slotnum == 0) (*info->fprintf_func) (info->stream, "[%s] ", tname); else - (*info->fprintf_func) (info->stream, " ", tname); + (*info->fprintf_func) (info->stream, " "); unit = ia64_templ_desc[template].exec_unit[slotnum]; @@ -117,7 +117,7 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) { /* skip L slot in MLI template: */ slotnum = 2; - retval = 16 - slot_multiplier; + retval += slot_multiplier; } insn = slot[slotnum]; @@ -167,10 +167,10 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) } else if (odesc - elf64_ia64_operands == IA64_OPND_TGT64) { - /* 60-bit immedate for long branches. */ + /* 60-bit immediate for long branches. */ value = (((insn >> 13) & 0xfffff) | (((insn >> 36) & 1) << 59) - | (slot[1] << 20)) << 4; + | (((slot[1] >> 2) & 0x7fffffffffLL) << 20)) << 4; } else { @@ -237,11 +237,11 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) if (str) (*info->fprintf_func) (info->stream, "%s", str); else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_SIGNED) - (*info->fprintf_func) (info->stream, "%lld", value); + (*info->fprintf_func) (info->stream, "%lld", (long long) value); else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_UNSIGNED) - (*info->fprintf_func) (info->stream, "%llu", value); + (*info->fprintf_func) (info->stream, "%llu", (long long) value); else - (*info->fprintf_func) (info->stream, "0x%llx", value); + (*info->fprintf_func) (info->stream, "0x%llx", (long long) value); break; case IA64_OPND_CLASS_REL: @@ -261,12 +261,13 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) (*info->fprintf_func) (info->stream, ";;"); done: - ia64_free_opcode (idesc); + ia64_free_opcode ((struct ia64_opcode *)idesc); + failed: if (slotnum == 2) retval += 16 - 3*slot_multiplier; return retval; decoding_failed: - (*info->fprintf_func) (info->stream, " data8 %#011llx", insn); - goto done; + (*info->fprintf_func) (info->stream, " data8 %#011llx", (long long) insn); + goto failed; }