This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Xtensa] fix corner case in GAS


I've committed this patch to fix an obscure corner case in the Xtensa port of GAS. If a particular opcode can be encoded in multiple instructions formats that are the same size but have different numbers of slots, treat the format with the fewest slots as the "narrowest" one. This is not very likely to come up in practice but the assembler should handle it anyway.

2006-04-03 Sterling Augustine <sterling@tensilica.com>

	* config/tc-xtensa.c (init_op_placement_info_table): Check for formats
	of the same length but different numbers of slots.


Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.60
diff -u -p -r1.60 tc-xtensa.c
--- config/tc-xtensa.c	21 Mar 2006 20:34:38 -0000	1.60
+++ config/tc-xtensa.c	3 Apr 2006 19:01:15 -0000
@@ -10852,8 +10852,11 @@ init_op_placement_info_table (void)
 		  opi->issuef++;
 		  set_bit (fmt, opi->formats);
 		  set_bit (slot, opi->slots[fmt]);
-		  /* opi->slot_count[fmt]++; */
-		  if (fmt_length < opi->narrowest_size)
+		  if (fmt_length < opi->narrowest_size
+		      || (fmt_length == opi->narrowest_size
+			  && (xtensa_format_num_slots (isa, fmt)
+			      < xtensa_format_num_slots (isa,
+							 opi->narrowest))))
 		    {
 		      opi->narrowest = fmt;
 		      opi->narrowest_size = fmt_length;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]