[patch] update mips la-empic (ecoff) testcase for change to opcodes.

Chris G. Demetriou cgd@sibyte.com
Sat Feb 17 19:15:00 GMT 2001


a while ago (a while before i started poking at binutils 8-), a MIPS
"la" opcode variant was added which converts constant offset
load-addrs off base regs into 'addiu' if the offset would fit into a
16-bit immediate.

This breaks the MIPS la-empic test, which assumed that e.g.:

	la	$4, 0($5)

would be converted into:

	li	$4, 0
	addu	$4, $4, $5


there were three instances of this (reg+0, reg+1, and reg-0x8000).

The patch below fixes them, and adds two additional instructions to
test for 16-bit-immediate edge cases.


As far as i'm concerned it's both a trivial patch, and short enough to
commit even without a working assignment on file, but I thought i'd
ask for input.  8-)

(Note that I put one of the additional test insn at the bottom of the
file, to minimize the diff and show how simple it is...  I'd prefer to
move that up to the 'right' place, and mechanically change the
offsets.  That shouldn't affect any of the above, should it?)



in gas/testsuite:

2001-02-17  Chris Demetriou  <cgd@broadcom.com>

	* gas/mips/la-empic.s: Add two additional instructions
	to test 16-bit-immediate edge cases.
	* gas/mips/la-empic.d: Update for the two additional
	instructions, and compensate for the fact that 'la'
	with a 16-bit immediate will generate one instruction.

Index: la-empic.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/la-empic.d,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 la-empic.d
*** la-empic.d	1999/05/03 07:28:51	1.1.1.1
--- la-empic.d	2001/02/18 03:05:45
***************
*** 14,26 ****
  0+0010 <[^>]*> lui	\$a0,0x1
  0+0014 <[^>]*> lui	\$a0,0x1
  0+0018 <[^>]*> ori	\$a0,\$a0,0xa5a5
! 0+001c <[^>]*> li	\$a0,0
! 0+0020 <[^>]*> addu	\$a0,\$a0,\$a1
! 0+0024 <[^>]*> li	\$a0,1
  0+0028 <[^>]*> addu	\$a0,\$a0,\$a1
! 0+002c <[^>]*> li	\$a0,0x8000
! 0+0030 <[^>]*> addu	\$a0,\$a0,\$a1
! 0+0034 <[^>]*> li	\$a0,-32768
  0+0038 <[^>]*> addu	\$a0,\$a0,\$a1
  0+003c <[^>]*> lui	\$a0,0x1
  0+0040 <[^>]*> addu	\$a0,\$a0,\$a1
--- 14,26 ----
  0+0010 <[^>]*> lui	\$a0,0x1
  0+0014 <[^>]*> lui	\$a0,0x1
  0+0018 <[^>]*> ori	\$a0,\$a0,0xa5a5
! 0+001c <[^>]*> addiu	\$a0,\$a1,0
! 0+0020 <[^>]*> addiu	\$a0,\$a1,1
! 0+0024 <[^>]*> li	\$a0,0x8000
  0+0028 <[^>]*> addu	\$a0,\$a0,\$a1
! 0+002c <[^>]*> addiu	\$a0,\$a1,-32768
! 0+0030 <[^>]*> lui	\$a0,0xffff
! 0+0034 <[^>]*> ori	\$a0,\$a0,0x7fff
  0+0038 <[^>]*> addu	\$a0,\$a0,\$a1
  0+003c <[^>]*> lui	\$a0,0x1
  0+0040 <[^>]*> addu	\$a0,\$a0,\$a1
***************
*** 102,105 ****
--- 102,106 ----
  0+00fc <[^>]*> addiu	\$a0,\$a0,252
  [ 	]*fc: RELLO	external_text_label
  0+0100 <[^>]*> li	\$a0,248
+ 0+0104 <[^>]*> addiu	\$a0,\$a1,32767
  	...
Index: la-empic.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/la-empic.s,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 la-empic.s
*** la-empic.s	1999/05/03 07:28:51	1.1.1.1
--- la-empic.s	2001/02/18 03:05:45
***************
*** 21,26 ****
--- 21,28 ----
  	la	$4,1($5)
  	la	$4,0x8000($5)
  	la	$4,-0x8000($5)
+ 	la	$4,-0x8001($5)
+ 	# An additional 16-bit-immediate edge case test is near the end.
  	la	$4,0x10000($5)
  	la	$4,0x1a5a5($5)
  	la	$4,data_label
***************
*** 55,57 ****
--- 57,60 ----
  second_text_label:	
  	la	$4,external_text_label - text_label
  	la	$4,second_text_label - text_label
+ 	la	$4,0x7fff($5)



More information about the Binutils mailing list