Commit graph

138 commits

Author SHA1 Message Date
Ian Lance Taylor
1748b9d8f0 * config/tc-mips.c (md_apply_fix): If we aren't adjusting this
fixup to be against the section symbol, adjust the value
	accordingly.
1997-02-03 17:56:00 +00:00
Ian Lance Taylor
0d7f9025b9 * config/tc-mips.c (mips_fix_adjustable): New function.
* config/tc-mips.h (tc_fix_adjustable): Call mips_fix_adjustable.
	(mips_fix_adjustable): Declare.
1997-01-30 21:19:36 +00:00
Ian Lance Taylor
39bb58e0ad * config/tc-mips.c (append_insn): Give an error for jumps to a
misaligned address.
1997-01-28 21:14:37 +00:00
Ian Lance Taylor
3b320c48cf * config/tc-mips.c (md_apply_fix): Make a branch to an odd address
an error rather than a warning.
1997-01-28 21:09:52 +00:00
Ian Lance Taylor
31a2c6ffd7 * config/tc-mips.c (md_convert_frag): If the user explicitly
requested an extended opcode, pass warn as true to mips16_immed.
1997-01-28 20:37:27 +00:00
Ian Lance Taylor
645cb4dc28 * config/tc-mips.c (mips16_ip): Handle a missing expression like
an explicit 0, so that explicitly extended instructions work
	correctly.
1997-01-28 20:28:18 +00:00
Ian Lance Taylor
b3a64736a1 * config/tc-mips.c (md_begin): Don't set SEC_ALLOC or SEC_LOAD for
the .reginfo or .MIPS.options section if configured for an
	embedded target.
1997-01-20 19:27:11 +00:00
Ian Lance Taylor
c36a90ef65 * config/tc-mips.c (md_begin): Don't set interlocks for
mips_4650.
PR 11507.
1997-01-20 17:43:43 +00:00
Ian Lance Taylor
b9129c6fcd * config/tc-mips.c: Throughout, check target_big_endian rather
than byte_order.
 	(byte_order): Remove.
	(mips_init_after_args): Remove.
	* config/tc-mips.h (LITTLE_ENDIAN, BIG_ENDIAN): Don't define.
	(mips_init_after_args): Don't declare.
	(tc_init_after_args): Don't define.

	* config/tc-mips.h (tc_frob_after_relocs): Define if
	OBJ_MAYBE_ELF.
	(mips_elf_final_processing): Likewise.
	(ELF_TC_SPECIAL_SECTIONS): Likewise.
1997-01-02 20:13:05 +00:00
Ian Lance Taylor
18e0764dd5 * config/tc-mips.c (mips16_macro): Add case for M_ABS. 1996-12-30 16:36:37 +00:00
Ian Lance Taylor
f5e38044df * config/tc-mips.c: Undo part of last Friday's alignment changes.
(md_begin): Always align the text section to a four byte
	boundary.
	(append_insn): Remove call to record_align.
1996-12-18 01:01:56 +00:00
Ian Lance Taylor
fbcfacb75d * config/tc-mips.c (insn_label): Remove.
(struct insn_label_list): Define.
	(insn_labels, free_insn_labels): New static variables.
	(mips_clear_insn_labels): New static function.
	(append_insn): Mark all mips16 text labels, and make them odd.
	Handle all labels after emitting a nop, not just one.  Call
	mips_clear_insn_labels rather than just clearing insn_label.
	(mips_emit_delays): Add insns parameter, and use it to decide
	whether to mark mips16 labels.  Handle all labels, not just one.
	Force mips16 labels to be odd.  Change all callers.
	(mips16_immed): Don't check for an odd branch target.
	(md_apply_fix): Don't check mips16 mode for a branch reloc.
	(mips16_extended_frag): Ignore the low bit in a branch target.
	(md_convert_frag): Likewise.
	(mips_no_prev_insn): Call mips_clear_insn_labels rather than just
	clearing insn_label.
	(mips_align, mips_flush_pending_output, s_cons): Likewise.
	(s_float_cons, s_gpword): Likewise.
	(s_align): Use insn_labels rather than insn_label.
	(s_cons, s_float_cons, s_gpword): Likewise.
	(mips_frob_file_after_relocs): New function.
	(mips_define_label): Rewrite to add to insn_labels list.
	* config/tc-mips.h (tc_frob_file_after_relocs): Define.
	* ecoff.c (ecoff_build_symbols): If the size of a function comes
	out odd, increment it.
1996-12-17 20:58:57 +00:00
Ian Lance Taylor
c0dea4956d * config/tc-mips.c (mips16_ip): Check for a missing expression
when using the register indirect addressing mode.
1996-12-17 16:00:55 +00:00
Ian Lance Taylor
a677feeba4 * config/tc-mips.c (prev_insn_reloc_type): New static variable.
(RELAX_MIPS16_ENCODE): Add dslot and jal_dslot arguments, and
	store them.  Adjust other RELAX_MIPS16 macros.
	(RELAX_MIPS16_DSLOT): Define.
	(RELAX_MIPS16_JAL_DSLOT): Define.
	(append_insn): Pass new arguments to RELAX_MIPS16_ENCODE.  Correct
	handling of whether previous instruction has a fixup.  Set
	prev_insn_reloc_type.
	(mips_no_prev_insn): Clear prev_insn_reloc_type.
	(mips16_extended_frag): Use the right base address for a PC
	relative add or load.
	(md_convert_frag): Likewise.  If a PC relative add or load is
	used, record the alignment for the section.
1996-12-15 03:42:36 +00:00
Ian Lance Taylor
8a8121d51b * config/tc-mips.c (mips16_macro): Remove nop instructions after
branch instructions.
1996-12-13 18:13:05 +00:00
Ian Lance Taylor
08e17202ee * config/tc-mips.c (md_begin): If configured for an embedded ELF
system, don't set the section alignment to 2**4.
	(s_change_sec): Likewise.
	(append_insn): Call record_alignment for the section.
	(md_section_align): Don't align the section size for an embedded
	ELF system.
1996-12-13 18:02:35 +00:00
Ian Lance Taylor
41a0ed225b * config/tc-mips.c (mips16_extended_frag): Give an error for an
attempt to use a non absolute symbol in an extending frag.
1996-12-10 16:38:22 +00:00
Ian Lance Taylor
559c664adb * config/tc-mips.c (mips16_extended_frag): Avoid an infinite loop
when extending because the value is exactly maxtiny + 1.
1996-12-09 23:34:20 +00:00
Ian Lance Taylor
8728fa9263 * config/tc-mips.c (RELAX_MIPS16_ENCODE): Add small and ext
arguments, and store them.  Adjust other RELAX_MIPS16 macros.
	(RELAX_MIPS16_USER_SMALL): Define.
	(RELAX_MIPS16_USER_EXT): Define.
	(mips16_small, mips16_ext): New static variables.
	(append_insn): Pass mips16_small and mips16_ext to
	RELAX_MIPS16_ENCODE.
	(mips16_ip): Set mips16_small and mips16_ext.
	(mips16_immed): Don't check mips16_autoextend.
	(mips16_extended_frag): Check USER_SMALL and USER_EXT.
1996-12-09 23:26:15 +00:00
Ian Lance Taylor
f74ba7a3d9 * config/tc-mips.c (mips16_extended_frag): Don't call
S_GET_VALUE.
	(md_convert_frag): Call resolve_symbol_value before calling
	S_GET_VALUE, and don't add in the frag address.
1996-12-07 00:32:05 +00:00
Ian Lance Taylor
15e69f9816 * config/tc-mips.c (mips16_immed): Add file and line parameters,
and use them when reporting errors.  Change all callers.
1996-12-06 23:51:01 +00:00
Ian Lance Taylor
943321c07d * config/tc-mips.c (md_longopts): Rename mips-16 to mips16, and
no-mips-16 to no-mips16.
	(s_mipsset): Accept .set mips16 and .set nomips16.
1996-12-04 18:01:48 +00:00
Ian Lance Taylor
cc5703cd74 Add support for mips16 (16 bit MIPS implementation):
* config/tc-mips.c: Extensive additions for mips16 support, not
	listed here.
	(RELAX_OLD, RELAX_NEW): Use only 7 bits each.
	(insn_uses_reg): Change last parameter to an enum.
	* config/tc-mips.h (LOCAL_LABELS_DOLLAR): Define as 0.
	(md_relax_frag): Define as mips_relax_frag.
	(mips_relax_frag): Declare.
	(struct mips_cl_insn): Add use_extend and extend fields.
	(tc_fix_adjustable): Define.
	* config/obj-elf.h (S_GET_OTHER): Define.
	(S_SET_OTHER): Define.
1996-11-26 16:44:22 +00:00
Ian Lance Taylor
bf39474f15 * config/tc-mips.c (cons_fix_new_mips): Only treat 8 byte reloc
specially if not ELF.
	(md_apply_fix): Handle BFD_RELOC_64.
	(tc_gen_reloc): Handle BFD_RELOC_64.
1996-10-22 00:01:33 +00:00
Ian Lance Taylor
538034cfb5 * config/tc-mips.c (mips_ip): Accept an odd floating point
register with l.s or s.s.
1996-10-18 19:33:03 +00:00
Ian Lance Taylor
0267c6c9c2 * config/tc-mips.c (load_register): Add cast to offsetT when using
a constant with &~.
1996-10-14 18:00:19 +00:00
Ian Lance Taylor
5e1e8f23cf * as.h: Include libiberty.h.
(xmalloc, xrealloc): Don't declare.
	* as.c: Don't include libiberty.h.
	* expr.c, read.c, stabs.c, config/obj-coff.c: Likewise.
	* config/tc-mips.c: Likewise.
	* messages.c: Likewise.
	(xstrerror): Don't declare.
	* xmalloc.c: Remove.
1996-10-08 17:15:20 +00:00
Ian Lance Taylor
ca296aab0e Don't set interlocks for r5000. Rely on -mips4 settings. 1996-09-10 01:12:35 +00:00
Ian Lance Taylor
d31a3f5e76 * config/tc-mips.c (append_insn): Don't swap an instruction which
sets a condition code with an instruction which uses a condition
	code.
	(mips_ip): In cases 'N' and 'M', look for $fccN rather than an
	immediate value.
1996-09-09 18:37:10 +00:00
Ian Lance Taylor
517078c1b3 * config/tc-mips.c (md_begin): Recognize r5000 for cpu. If
mips_cpu is 5000, set interlocks and cop_interlocks.
	(mips_ip): Give a better error message if the ISA level is wrong.
	(md_parse_option): Recognize -mcpu=[v][r]5000.
1996-09-09 15:04:59 +00:00
Jackie Smith Cashion
ff8716f58e Sat Sep 7 13:25:55 1996 James G. Smith <jsmith@cygnus.co.uk>
* config/tc-mips.c (COUNT_TOP_ZEROES): Added macro to count
 	leading zeroes.
	(load_register): Ensure hi32 bits are not lost during lo32bit
 	processing. Fix shift offset that was overflowing into the next
 	instruction field. Add code to generate shorter sequences for
 	constants with a single contiguous seqeuence of ones.

Fri Sep  6 18:23:54 1996  James G. Smith  <jsmith@cygnus.co.uk>

	* gas/mips/dli.{s,d}: More test cases added.

NOTE: The COUNT_TOP_ZEROES macro is a bit bulky, and the same result
can be achieved by using a "standard" ffs() routine:
	count = ffs(~v);
	count = count == 0 ? 0 : 33 - count;

However the following timings (VR4300 CPU clock ticks on a CMA101
board) show the performance gain.

Number of	ffs()		for loop	if/then/else	conditional
leading								   ?:
zeroes
-------------------------------------------------------------------------------
  0		 167		 179		266		251
  1		1718		 283		263		259
  2		1670		 379		287		295
  3		1622		 475		311		311
  4		1574		 571		295		287
  5		1534		 667		311		319
  6		1478		 763		307		299
  7		1430		 859		323		323
  8		1382		 962		287		295
  9		1334		1051		319		311
 10		1286		1154		299		307
 11		1238		1250		323		331
 12		1183		1346		299		307
 13		1135		1442		331		323
 14		1087		1546		311		319
 15		1039		1642		335		343
 16		 991		1730		295		287
 17		 950		1834		311		319
 18		 895		1922		307		299
 19		 847		2026		331		323
 20		 799		2122		307		299
 21		 751		2218		323		323
 22		 703		2314		311		311
 23		 655		2417		343		335
 24		 599		2506		307		299
 25		 559		2602		331		331
 26		 511		2705		311		319
 27		 463		2801		343		335
 28		 407		2897		311		319
 29		 367		2993		343		335
 30		 311		3097		323		331
 31		 271		3185		355		355
 32		 215		3233		379		371
1996-09-07 12:45:19 +00:00
Ian Lance Taylor
711254da6c * config/tc-mips.c (load_register): Remove unused variable tmp. 1996-09-04 14:26:20 +00:00
Jackie Smith Cashion
1b68deb599 Wed Sep 4 11:24:29 1996 James G. Smith <jsmith@cygnus.co.uk>
* config/tc-mips.c (load_register): Remove unnecessary code that
 	was causing the high 32bits of 64bit constants to be lost.

Fixes PR10503. The compiler was producing the assembler code:
	dli $3,0xfffffffffffff
when constructing the softfloat library. Unfortunately it was being
incorrectly assembled.
1996-09-04 13:15:28 +00:00
Ian Lance Taylor
cf32394d07 * config/tc-mips.c (md_section_align): Do align if OBJ_ELF, but
not to more than a 16 byte boundary.
1996-08-07 17:17:33 +00:00
Ian Lance Taylor
10a14e3639 * config/tc-mips.c (md_section_align): Don't change addr if
OBJ_ELF.
PR 10181.
1996-08-02 15:30:09 +00:00
Ian Lance Taylor
97aca1bcdf * config/tc-mips.c (tc_gen_reloc): BFD_RELOC_PCREL_HI16_S and
BFD_RELOC_PCREL_LO16 are expected to be PC relative.
1996-07-22 18:03:41 +00:00
Ian Lance Taylor
a8aed9ddfb * config/tc-mips.c (mips_regmask_frag): Only define if OBJ_ELF or
OBJ_MAYBE_ELF.
	(tc_gen_reloc): If fixup was changed to be PC relative, change
 	reloc type accordingly.  Use name of reloc in error message.
1996-07-08 23:16:00 +00:00
Ian Lance Taylor
5af96dce32 Based on patches from Tom Quiggle <quiggle@sgi.com>:
* ecoff.c (last_lineno): New static variable.
	(add_procedure): Set last_lineno.
	(ecoff_directive_loc): Likewise.
	(ecoff_generate_asm_lineno): Likewise.
	(ecoff_fix_loc): New function.
	* ecoff.h (ecoff_fix_loc): Declare.
	* config/tc-mips.c (append_insn): When inserting nops, and using
	ECOFF debugging, call ecoff_fix_loc.
1996-07-03 20:15:38 +00:00
Ian Lance Taylor
0b916ef7a6 remove debugging code 1996-06-27 16:12:22 +00:00
Jackie Smith Cashion
344a8d61a1 Wed Jun 26 16:23:08 1996 James G. Smith <jsmith@cygnus.co.uk>
* config/tc-mips.c: Added cop_interlocks, to avoid NOP insertion
 	between co-processor comparisons and branches for the VR4300.

The preliminary documentation was slightly unclear on this issue, but
NEC have confirmed that there is an interlock within the CPU.
1996-06-26 15:28:00 +00:00
Ian Lance Taylor
9753202d00 * config/tc-mips.c (mips_ip): In cases 'I', 'i', and 'j', set
insn_error rather than calling check_absolute_expr.
1996-06-19 18:34:30 +00:00
Ian Lance Taylor
9c44af609b * config/tc-mips.c (md_parse_option): Check for a 64 bit format
before permitting -64.
	* output-file.c (output_file_create): Remove duplicate
	bfd_perror.
1996-06-02 01:55:28 +00:00
Ian Lance Taylor
871781804f * config/tc-mips.c (md_begin): If -64, create a .MIPS.options
section rather than a .reginfo section.
	(mips_elf_final_processing): If -64, write out 64 bit RegInfo
	information.
1996-05-31 21:46:14 +00:00
Ian Lance Taylor
98bfd087ca * config/tc-mips.c (load_register): If mips_isa < 3, permit a 32
bit value with the high bit set.
1996-05-31 05:10:20 +00:00
Ian Lance Taylor
7f9880e5de * config/tc-mips.c (mips_64): New static variable.
(mips_target_format): If mips_64, return elf64 targets rather than
	elf32 ones.
	(md_longopts): Add "32" and "64".
	(md_parse_option): Handle -32 and -64.
	(md_show_usage): Mention -32 and -64.
	(cons_fix_new_mips): If mips_64, don't convert an 8 byte reloc to
	a 4 byte one.
1996-05-30 23:08:47 +00:00
Ian Lance Taylor
a40aee3822 * config/tc-mips.c (macro): When passing X_add_number to
macro_build, cast it to int first.
1996-05-29 20:46:07 +00:00
Ian Lance Taylor
9b61d62b9f * config/tc-mips.c (mips_ip): Mark sections created to hold
floating point information as read only.
1996-05-25 01:25:27 +00:00
Ian Lance Taylor
7a15a226ad * config/tc-mips.c (load_address): Cast X_add_number to valueT
before comparing against MAX_GPREL_OFFSET, so that negative
	numbers are handled correctly.
	(macro): Likewise.
1996-04-15 16:28:19 +00:00
Ian Lance Taylor
867a58b368 * config/tc-mips.h (tc_frob_file): Define.
(mips_frob_file): Declare.
	* config/tc-mips.c (struct mips_hi_fixup): Define.
	(mips_hi_fixup_list): New static variable.
	(imm_unmatched_hi): New static variable.
	(md_assemble): Clear imm_reloc, imm_unmatched_hi, and
	offset_reloc.  Pass imm_unmatched_hi to append_insn.
	(append_insn): Add unmatched_hi parameter.  If it is set, add the
	new fixup to mips_hi_fixup_list.  Change all callers.
	(mips_ip): Set imm_unmatched_hi when appropriate.
	(mips_frob_file): New function.
1996-03-28 20:37:02 +00:00
Ian Lance Taylor
fb251650e9 * config/tc-mips.c (mips_big_got): New static variable.
(s_extern): Don't declare.
	(reg_needs_delay): New static function.
	(macro_build): Permit GOT/CALL_HI/LO relocs.
	(macro_build_lui): If place is not NULL, use the number in the
	expression.
	(load_address): Handle mips_big_got case.
	(macro): Handle mips_big_got for M_LA_AB, M_JAL_A, and load and
	store macros.
	(OPTION_XGOT): Define.
	(md_longopts): Add "xgot" if OBJ_ELF.
	(md_parse_option): Handle -xgot.
	(md_show_usage): Mention -xgot.
	(md_apply_fix): Permit GOT/CALL_HI/LO relocs.
	(tc_gen_reloc): Handle GOT/CALL_HI/LO relocs.
1996-02-14 18:49:27 +00:00