Commit Graph

105 Commits

Author SHA1 Message Date
Alan Modra 1ae008798a * config/tc-i386.c (parse_register): If not producing code for
x86_64, reject x86_64 register name matches.
	(md_assemble): Remove now redundant check for x86_64 regs.
2001-10-04 18:01:46 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Alan Modra e0890092b6 * expr.c (expr): Move code setting "retval" to the end of the loop,
and rearrange for efficiency.  For "PIC code" subtraction, use
	"rightseg" rather than recalculating.  For "symbol OP symbol"
	subtract, set "retval" to absolute_section if symbols in same
	section.
	* symbols.c (resolve_symbol_value): Resolve "sym +/- expr" to an
	O_symbol.  Simplify a +/- b code.  Allow equality and non-equality
	comparisons on symbols from any section.  Allow other comparison
	operators as for subtraction.
	(symbol_equated_reloc_p): New predicate function.
	* symbols.h (symbol_equated_reloc_p): Declare.
	* write.c (adjust_reloc_syms): Use symbol_equated_reloc_p.
	(write_relocs): Likewise.
	(write_object_file): Likewise.
	(relax_segment <rs_machine_dependent>): Ensure segment for
	expression syms is set correctly.
	* config/tc-mips.c (md_estimate_size_before_relax): Likewise.
	* config/tc-i386.c (md_assemble <Output jumps>): Don't lose part
	of a complex expression when setting up frag_var.
2001-09-09 14:01:17 +00:00
Alan Modra 28f815927f * config/tc-i386.c (lex_got): Match lower case relocation tokens.
Don't allocate more space than necessary for the input line copy.
2001-08-01 02:27:11 +00:00
Alan Modra ac62c3468d * symbols.c (S_GET_VALUE): Don't treat O_constant and local
symbols specially.  Always resolve, adding fr_address to value.
	* write.c (write_object_file): Don't add fr_address to sym values.
	(relax_frag): Likewise.
	(relax_segment): Likewise.
	* config/obj-ieee.c (do_symbols): Likewise.
	* config/tc-cris.c (md_convert_frag): Likewise.
	* config/tc-fr30.c (md_convert_frag): Likewise.
	* config/tc-i386.c (md_convert_frag): Likewise.
	* config/tc-m32r.c (md_convert_frag): Likewise.
	* config/tc-m68hc11.c (md_convert_frag): Likewise.
	* config/tc-mcore.c (md_convert_frag): Likewise.
	* config/tc-mips.c (mips16_extended_frag): Likewise.
	* config/tc-ns32k.c (md_convert_frag): Likewise.
	* config/tc-m68k.c (md_convert_frag_1): Likewise.
	(BRANCHBWL, BRABSJUNC, BRABSJCOND, BRANCHBW, FBRANCH, DBCCLBR,
	DBCCABSJ, PCREL1632, PCINDEX, ABSTOPCREL): Decrement.
	(md_relax_table): Remove first four entries.  Format.
	(md_estimate_size_before_relax): Remove old_fix.  Don't bother
	setting fr_var.  Simplify byte branch checks.
2001-07-23 13:03:40 +00:00
Matthew Green 5bae9b28a0 * config/tc-i386.c (comment_chars): Don't use '/' as comment start if
TE_NetBSD.
	(line_comment_chars): Set to '/' if TE_NetBSD.
2001-07-17 09:57:52 +00:00
Alan Modra b091f402a9 * config/tc-hppa.c (CHECK_FIELD_WHERE): Define.
(md_apply_fix): Use it here.  Replace printf with equivalent
	as_bad_where.
	(tc_gen_reloc): Use as_bad_where instead of as_bad.
	(md_apply_fix): Here too.
	* config/tc-i386.c (tc_gen_reloc): Use as_bad_where instead of as_bad.
	* config/tc-m68k.c (tc_gen_reloc): Likewise.
	(md_convert_frag_1): Likewise.
2001-06-21 06:12:11 +00:00
Alan Modra 5dd0794dca Branch hints for Pentium4 as insn modifiers, and some minor tweaks
to formatting.
2001-06-10 14:07:12 +00:00
Alan Modra cb9401fc47 * config/tc-i386.c (md_assemble): Handle Pentium4 branch hints.
<JumpByte, JumpDword insn output>: Remove dead code.
2001-06-06 10:23:39 +00:00
Alan Modra b58c9faf2f From 2.11 branch 2001-03-30 Richard Henderson <rth@redhat.com>
* config/tc-i386.c (md_convert_frag): Don't die on local symbols
	that have been finalized.
2001-05-24 23:52:22 +00:00
Alan Modra 9fcc94b611 Fix dwarf2_emit_insn calls when frag_var breaks things.
Put back an old entry in ChangeLog-9899, deleted when ChangeLog split.
2001-05-16 01:08:21 +00:00
Alan Modra 636c26b044 * config/tc-i386.c (i386_displacement): Call as_bad for bad GOTOFF
expressions rather than triggering an assert.
2001-05-03 01:08:44 +00:00
Alan Modra 93c2a809af Prepare for multi-pass relaxation. 2001-03-30 00:06:10 +00:00
Alan Modra 551c1ca176 Accept an absolute expression for index scale factor. 2001-03-25 05:57:09 +00:00
Alan Modra 2e98d2de04 Fix register name printed in warning message. 2001-03-19 11:28:20 +00:00
Alan Modra f3c180aedc Support for @GOTOFF in .long expressions. 2001-03-13 04:37:13 +00:00
Nick Clifton f7e42eb4af Fix copyright notices 2001-03-08 23:24:26 +00:00
Alan Modra 1ae12ab72a * config/tc-i386.c (struct _i386_insn): Rename disp_reloc to reloc.
(md_assemble [smallest displacement]): Use correct field of i.op[] union.
(md_assemble [JumpInterSegment output]): Use correct i.disp_reloc[].
(md_assemble [immediate output]): Likewise.
2001-03-07 02:52:26 +00:00
Andreas Jaeger 7c44d1d360 2001-02-28 Andreas Jaeger <aj@suse.de>, Bo Thorsen <bo@suse.de>
* config/tc-i386.c (tc_gen_reloc): Remove ugly hack which is not needed
	anymore since we use bfd_elf_generic_reloc now.
	(md_apply_fix3): Only apply hack for partial_inplace if not using RELA.
2001-02-28 12:49:40 +00:00
Andreas Jaeger 80b3ee89ae 2001-02-20 Bo Thorsen <bo@suse.de>
* config/tc-i386.c (tc_i386_fix_adjustable): Fix GOTPCREL GOT
	  entry.
2001-02-20 09:48:45 +00:00
Alan Modra fddf5b5bc2 Handle long jumps for .code16 and .arch < 386 by using a two
instruction sequence consisting of a conditional jump of the
opposite sense around an unconditional jump to the target.
Add jumps/nojumps .arch modifier.
2001-02-13 12:44:19 +00:00
Jan Hubicka 23df107806 * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL.
* tc-i386.c (i386_displacement): Fix handling of
	BFD_RELOC_X86_64_GOTPCREL.
	(i386_validate_fix): Likewise.
2001-02-12 16:47:15 +00:00
Kazu Hirata e5cb08ac57 2001-01-16 Kazu Hirata <kazu@hxi.com>
* config/tc-i386.c: Fix formatting.
2001-01-17 23:41:35 +00:00
Kazu Hirata bfb32b5207 2001-01-14 Kazu Hirata <kazu@hxi.com>
* config/tc-alpha.c: Fix formatting.
	* config/tc-arc.c: Likewise.
	* config/tc-arc.h: Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-i370.c: Likewise.
	* config/tc-i386.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-ppc.c: Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-tahoe.c: Likewise.
	* config/tc-vax.c: Likewise.
2001-01-14 18:54:06 +00:00
Jan Hubicka b9d79e0379 * tc-i386.h (TARGET_MACH): New macro.
(i386_mach): Declare.
	* tc-i386.c (i386_mach): New function.
2001-01-13 23:37:57 +00:00
Jan Hubicka e2914f484e * i386.c (md_assemble): Check cpu_flags even for nullary instructions.
* i386.h (i386_optab): Fix pusha and ret templates.

	* i386-dis.c (dis386_att, disx86_64_att): Fix ret, lret and iret
	templates.
2001-01-13 09:05:55 +00:00
Alan Modra 6e0b89ee6c Cure recent x86 warts. 2001-01-12 03:34:49 +00:00
Andreas Jaeger b77a7acd1b 2001-01-08 Bo Thorsen <bo@suse.de>
* config/tc-i386.c (i386_immediate, i386_displacement):
        GOTPCREL check fix.
2001-01-08 09:37:43 +00:00
Jan Hubicka b96d3a207a * configure.in: Define DEFAULT_ARCH for i386.
* tc-i386.c (md_assemble): Return after the error message;
	move testing for 64bit operands to proper place.

	* i386.exp: Add tests for presence of 32bit versus 64bit output
	format; run both 64bit and 32bit tests when format is available;
	add x86_64 test.
	* x86_64.s: New file.
	* x86_64.d: New file.
2001-01-06 12:36:04 +00:00
Jan Hubicka 7bc70a8e57 * tc-i386.c (md_assemble): Handle third byte of the opcode as prefix.
* i386.h (i386_optab): Make [sml]fence template to use immext field.
2001-01-05 12:30:12 +00:00
Jan Hubicka a167610dd0 * tc-i386.c (cpu_arch): Add Pentium4 and modify sledgehammer entry.
* NEWS: Add note about Pentium4 support.
2001-01-04 21:27:56 +00:00
Jan Hubicka 09f131f2b6 * tc-i387.c (pi, pte, pt): Update.
(type_names): Add new types.
2001-01-03 16:27:41 +00:00
H.J. Lu ec56dfb4b0 2000-12-22 H.J. Lu <hjl@gnu.org>
* config/tc-i386.c (reloc): Update the macro for non-bfd
	assembler.
	(BFD_RELOC_X86_64_GOTPCREL): Set to 0 for non-bfd assembler.
2000-12-22 20:53:35 +00:00
Jan Hubicka 3e73aa7c95 * tc-i386.h (i386_target_format): Define even for ELFs.
(QWORD_MNEM_SUFFIX): New macro.
	(CpuK6,CpuAthlon,CpuSledgehammer, Cpu64, CpuNo64, CpuUnknownFlags):
	New macros
	(CpuMMX,CpuSSE,Cpu3dnow, CpuUnknown): Renumber.
	(IgnoreSize, DefaultSize, No_?Suf, FWait, IsString, regKludge, IsPrefix,
	ImmExt): Renumber.
	(Size64, No_qSuf, NoRex64, Rex64): New macros.
	(Reg64, Imm32S, Imm64, Disp32S, Disp64): New macros.
	(Imm8, Imm8S, Imm16, Imm32, Imm1, BaseIndex, Disp8, Disp16, Disp32,
	InOutPortReg,ShiftCount, Control, Debug, Test, FloatReg, FloatAcc,
	SReg2, SReg3, Acc, JumpAbsolute, RegMMX, RegXMM, EsSeg, InvMem): Renumber.
	(Reg, WordReg): Add Reg64.
	(Imm): Add Imm32S and Imm64.
	(EncImm): New.
	(Disp): Add Disp64 and Disp32S.
	(AnyMem): Add Disp32S.
	(RegRex, RegRex64): New macros.
	(rex_byte): New type.
	* tc-i386.c (set_16bit_code_flag): Kill.
	(fits_in_unsigned_long, fits_in_signed_long): New functions.
	(reloc): New parameter "signed"; support x86_64.
	(set_code_flag): New.
	(DEFAULT_ARCH): New macro; default to "i386".
	(default_arch): New static variable.
	(struct _i386_insn): New fields Operand_PCrel; rex.
	(flag_16bit_code): Kill; All tests replaced to "flag_code == CODE_64BIT";
	(flag_code): New enum and static variable.
	(use_rela_relocations): New static variable.
	(flag_code_names): New static variable.
	(cpu_arch_flags): Default to CpuUnknownFlags|CpuNo64.
	(cpu_arch): Add "sledgehammer"; Add CPUAthlon to Athlon and CpuK6 to
	K6 and Athlon.
	(i386_align_code): Return plain "nop" for x86_64.
	(mode_from_disp_size): Support Disp32S.
	(smallest_imm_type): Support Imm32S and Imm64.
	(offset_in_range): Support size of 8.
	(set_cpu_arch): Do not clobber to Cpu64/CpuNo64.
	(md_pseudo_table): Add "code64"; use set_code_flat.
	(md_begin): Emit sane error message on hash failure.
	(tc_i386_fix_adjustable): Support x86_64 relocations.
	(md_assemble): Support QWORD_MNEM_SUFFIX, REX registers,
	instructions supported on particular arch just partially,
	output of 64bit immediates, handling of Imm32S and Disp32S type.
	(i386_immedaite): Support x86_64 relocations; support 64bit constants.
	(i386_displacement): Likewise.
	(i386_index_check): Cleanup; support 64bit addresses.
	(md_apply_fix3): Support x86_64 relocation and rela.
	(md_longopts): Add "32" and "64".
	(md_parse_option): Add OPTION_32 and OPTION_64.
	(i386_target_format): Call even for ELFs; choose between
	elf64-x86-64 and elf32-i386.
	(i386_validate_fix): Refuse GOTOFF in 64bit mode.
	(tc_gen_reloc): Support rela relocations and x86_64.
	(intel_e09_1): Support QWORD.

	* i386.h (i386_optab): Replace "Imm" with "EncImm".
	(i386_regtab): Add flags field.
2000-12-20 13:24:13 +00:00
Diego Novillo 21d6c4af5d 2000-12-15 Diego Novillo <dnovillo@redhat.com>
* config/tc-i386.c (intel_e09_1): Only flag as a memory operand if
	it's not an offset expression.
	(intel_e10_1): Ditto. Also, if the operand is an offset expression,
	keep the braces '[' and ']' in the output string.
	(intel_e11): Ditto. Also remove comparison intel_parser.op_modifier
	!= FLAT. There is no such op_modifier.
2000-12-16 05:45:08 +00:00
Jan Hubicka f16b83dfe5 * tc-i386.c (md_assemble): Refuse 's' and 'l' suffixes in the intel
mode; convert 'd' suffix to 's' or 'l'; remove all DWORD_MNEM_SUFFIX
	references.
	(intel_e09_1): Convert QWORD to 'l' suffix for FP operations; refuse
	otherwise.
	* tc-i386.h (DWORD_MNEM_SUFFIX): Kill.
	(No_dSuf): Kill.

	* i386.h (*_Suf): Remove No_dSuf.
	(d_suf, wld_Suf,sld_Suf, sldx_Suf, bwld_Suf, d_FP, sld_FP, sldx_FP)
	Remove.
	(i386_optab): Remove 'd' in the suffixes.
2000-12-11 14:01:46 +00:00
Alan Modra 50705ef487 Fix T_SHORT macro conflict. 2000-12-06 02:40:55 +00:00
Kazu Hirata bc80588841 2000-12-03 Kazu Hirata <kazu@hxi.com>
* tc-a29k.c: Fix formatting.
	* tc-alpha.c: Likewise.
	* tc-arm.c: Likewise.
	* tc-cris.c: Likewise.
	* tc-hppa.c: Likewise.
	* tc-i370.c: Likewise.
	* tc-i386.c: Likewise.
	* tc-i860.c: Likewise.
	* tc-i960.c: Likewise.
	* tc-ia64.c: Likewise.
	* tc-m68hc11.c: Likewise.
	* tc-m68k.c: Likewise.
	* tc-m88k.c: Likewise.
	* tc-pj.c: Likewise.
	* tc-ppc.c: Likewise.
	* tc-sh.c: Likewise.
	* tc-sparc.c: Likewise.
	* tc-tahoe.c: Likewise.
	* tc-vax.c: Likewise.
2000-12-03 06:49:23 +00:00
Diego Novillo 76a0ddacc0 2000-11-30 Diego Novillo <dnovillo@redhat.com>
* tc-i386.c (md_assemble): Swap i.disp_relocs when using intel
	syntax.

2000-11-30  Diego Novillo  <dnovillo@redhat.com>

	* intel.s, intel.d: New test for @GOT references.
2000-12-01 03:08:32 +00:00
Richard Henderson 316e2c0578 * config/tc-i386.c (md_pseudo_table): Add .file and .loc. 2000-11-17 18:15:53 +00:00
Richard Henderson e346e481c2 * config/tc-i386.c (md_assemble): Call dwarf2_emit_insn. 2000-11-17 09:28:04 +00:00
Kazu Hirata 4a1805b14d 2000-11-14 Kazu Hirata <kazu@hxi.com>
* config/aout_gnu.h: Fix formatting.
	* config/atof-vax.c: Likewise.
	* config/m68k-parse.h: Likewise.
	* config/m88k-opcode.h: Likewise.
	* config/obj-elf.c: Likewise.
	* config/tc-arm.c: Likewise.
	* config/tc-cris.c: Likewise.
	* config/tc-i386.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/te-386bsd.h: Likewise.
	* config/te-hppa.h: Likewise.
	* config/te-nbsd.h: Likewise.
	* config/te-ppcnw.h: Likewise.
	* config/te-sparcaout.h: Likewise.
	* config/te-tmips.h: Likewise.
	* config/vax-inst.h: Likewise.
	* config/vms-conf.h: Likewise.
2000-11-14 20:57:30 +00:00
Diego Novillo cce0cbdcd7 2000-10-25 Diego Novillo <dnovillo@cygnus.com>
* tc-i386.c: Fix prototype declarations for functions taking no
	arguments.
2000-10-25 11:42:51 +00:00
Diego Novillo 64a0c77978 2000-10-24 Diego Novillo <dnovillo@cygnus.com>
* tc-i386.c (i386_operand_modifier): Remove.
	(build_displacement_string): Remove.
	(i386_parse_seg): Remove.
	(i386_intel_memory_operand): Remove.
	(i386_intel_operand): Re-write using recursive descent parser based
	on MASM documentation.
	(struct intel_parser_s): New structure.
	(intel_parser): New static variable.
	(struct intel_token): New structure.
	(cur_token, prev_token): New static variables.
	(T_NIL): Define.
	(T_CONST): Define.
	(T_REG): Define.
	(T_BYTE): Define.
	(T_WORD): Define.
	(T_DWORD): Define.
	(T_QWORD): Define.
	(T_XWORD): Define.
	(T_SHORT): Define.
	(T_OFFSET): Define.
	(T_PTR): Define.
	(T_ID): Define.
	(intel_match_token): New function.
	(intel_get_token): New function.
	(intel_putback_token): New function.
	(intel_expr): New function.
	(intel_e05): New function.
	(intel_e05_1): New function.
	(intel_e06): New function.
	(intel_e06_1): New function.
	(intel_e09): New function.
	(intel_e09_1): New function.
	(intel_e10): New function.
	(intel_e10_1): New function.
	(intel_e11): New function.

2000-10-24  Diego Novillo  <dnovillo@cygnus.com>

	* intel.s, intel.d: Add new tests for intel syntax.
2000-10-25 01:39:11 +00:00
Diego Novillo 6588847e4f gas:
2000-10-15  Diego Novillo  <dnovillo@cygnus.com>

	* config/tc-i386.c (i386_operand_modifier): Only match
	modifiers SHORT and FLAT if they are followed by a space.
	(parse_register): When `allow_naked_reg' is set, do not confuse
	identifiers that start with a register name with a register.

gas/testsuite:

2000-10-15  Diego Novillo  <dnovillo@cygnus.com>

	* intel.s, intel.d: Add new tests for naked registers using intel
	syntax.
2000-10-15 06:17:36 +00:00
Alan Modra ce8a8b2f62 Correct handling of non-global syms in linkonce sections.
Tidy a few comments.
2000-10-05 01:49:36 +00:00
Diego Novillo fa2255cb6b * tc-i386.c (md_assemble): Skip suffix check if the opcode modifier
has the IgnoreSize bit set.
2000-08-14 21:12:47 +00:00
Kazu Hirata 47926f603c 2000-08-05 Kazu Hirata <kazu@hxi.com>
* config/tc-cris.c: Fix formatting.
	* config/tc-i386.c: Likewise.
	* config/tc-sparc.c (sparc_ip): Simplify the code.
2000-08-04 18:43:45 +00:00
DJ Delorie 6d249963bc 386.c (md_estimate_size_before_relax): Revert
more changes from Sept 1999
(tc_i386_fix_adjustable): ditto
(md_apply_fix3): ditto
2000-06-25 01:33:31 +00:00
Alan Modra 45288df104 Fix a problem with 32-bit displacements in .code16gcc mode. 2000-06-22 10:49:13 +00:00