X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-ppc.c;h=fc2a0458288d5228ad0598cd3e6ae7b8e1826293;hb=024425668d120663a73913352df701c8f0aea316;hp=1d2c57f0293b1debaca194a7cfbe7ec5a6a9c933;hpb=325801bda4678d100721414300eb1170bfbc2e24;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 1d2c57f029..fc2a045828 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -206,11 +206,13 @@ ppc_cpu_t sticky = 0; /* Value for ELF e_flags EF_PPC64_ABI. */ unsigned int ppc_abiversion = 0; +#ifdef OBJ_ELF /* Flags set on encountering toc relocs. */ -enum { +static enum { has_large_toc_reloc = 1, has_small_toc_reloc = 2 } toc_reloc_types; +#endif /* Warn on emitting data to code sections. */ int warn_476; @@ -1046,18 +1048,6 @@ static segT ppc_current_section; #ifdef OBJ_ELF symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE" */ -#define PPC_APUINFO_ISEL 0x40 -#define PPC_APUINFO_PMR 0x41 -#define PPC_APUINFO_RFMCI 0x42 -#define PPC_APUINFO_CACHELCK 0x43 -#define PPC_APUINFO_SPE 0x100 -#define PPC_APUINFO_EFS 0x101 -#define PPC_APUINFO_BRLOCK 0x102 -#define PPC_APUINFO_VLE 0x104 - -/* - * We keep a list of APUinfo - */ unsigned long *ppc_apuinfo_list; unsigned int ppc_apuinfo_num; unsigned int ppc_apuinfo_num_alloc; @@ -1561,6 +1551,18 @@ ppc_setup_opcodes (void) bad_insn = TRUE; } } + if ((op->flags & PPC_OPCODE_VLE) != 0) + { + as_bad (_("%s is enabled by vle flag"), op->name); + bad_insn = TRUE; + } + if (PPC_OP (op->opcode) != 4 + && PPC_OP (op->opcode) != 31 + && (op->deprecated & PPC_OPCODE_VLE) == 0) + { + as_bad (_("%s not disabled by vle flag"), op->name); + bad_insn = TRUE; + } bad_insn |= insn_validate (op); } @@ -1632,10 +1634,6 @@ ppc_setup_opcodes (void) } } - if ((ppc_cpu & PPC_OPCODE_VLE) != 0) - for (op = vle_opcodes; op < op_end; op++) - hash_insert (ppc_hash, op->name, (void *) op); - /* Insert the macros into a hash table. */ ppc_macro_hash = hash_new (); @@ -1734,7 +1732,7 @@ ppc_cleanup (void) unsigned int i; /* Create the .PPC.EMB.apuinfo section. */ - apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0); + apuinfo_secp = subseg_new (APUINFO_SECTION_NAME, 0); bfd_set_section_flags (stdoutput, apuinfo_secp, SEC_HAS_CONTENTS | SEC_READONLY); @@ -1749,7 +1747,7 @@ ppc_cleanup (void) md_number_to_chars (p, (valueT) 2, 4); p = frag_more (8); - strcpy (p, "APUinfo"); + strcpy (p, APUINFO_LABEL); for (i = 0; i < ppc_apuinfo_num; i++) { @@ -1785,17 +1783,15 @@ ppc_insert_operand (unsigned long insn, if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0) { - /* Extend the allowed range for addis to [-65536, 65535]. - Similarly for some VLE high part insns. For 64-bit it - would be good to disable this for signed fields since the + /* Extend the allowed range for addis to [-32768, 65535]. + Similarly for cmpli and some VLE high part insns. For 64-bit + it would be good to disable this for signed fields since the value is sign extended into the high 32 bits of the register. If the value is, say, an address, then we might care about the high bits. However, gcc as of 2014-06 uses unsigned values when loading the high part of 64-bit constants using - lis. - Use the same extended range for cmpli, to allow at least - [-32768, 65535]. */ - min = ~max & -right; + lis. */ + min = ~(max >> 1) & -right; } else if ((operand->flags & PPC_OPERAND_SIGNED) != 0) {