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]

RE: [PATCH][MIPS] Fix ext, dextm, dextu size checking


Richard Sandiford wrote:
> > A possible fix is as follows.  We just need to check if the 
> lower bound of "size" is correct, instead of checking it against 0.
> > (Note that there is no issue at the upper bound of "size".)
> > Ex:
> > 2013-04-22  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>
> >
> > 	* config/tc-mips.c (mips_ip): Add sizelo.
> > 	For "+C", "+G", and "+H", set sizelo and compare against it.
> 
> Looks good, but please add a run_list_test_arches to mips.exp
> to check for the errors.
> 
> Thanks,
> Richard
> 
Hi Richard,

  Here is the patch to add new tests for mips64r2.  Although "ext" can be tested
for mips32r2, I just put "ext" into the same test for convenience.

gas/testsuite/ChangeLog
2013-04-30  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

	* gas/mips/ext-ill.s: New file.
	* gas/mips/ext-ill.l: New file.
	* gas/mips/mips.exp: Run new tests.

Index: mips.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/mips.exp,v
retrieving revision 1.212
diff -u -p -r1.212 mips.exp
--- mips.exp	9 Feb 2013 10:24:19 -0000	1.212
+++ mips.exp	30 Apr 2013 20:32:37 -0000
@@ -1169,4 +1169,6 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "r5900"
     run_dump_test "r5900-full"
     if $elf { run_list_test "r5900-nollsc" "-mabi=o64 -march=r5900" }
+
+    run_list_test_arches "ext-ill"	[mips_arch_list_matching mips64r2]
 }

(Somehow my account at chaoyingfu@sources.redhat.com doesn't work,
so I cannot add these two files to CVS.)

1. ext-ill.s
# source file to test illegal ext, dext, dextm, dextu instructions

	.text
text_label:
	ext	$2, $3, 1, 0
	dext	$2, $3, 1, 0
	dextm	$2, $3, 31, 2
	dextm	$2, $3, 1, 32
	dextu	$2, $3, 33, 0

2. ext-ill.l
.*: Assembler messages:
.*:5: Error: Improper extract size \(0, position 1\)
.*:6: Error: Improper extract size \(0, position 1\)
.*:7: Error: Improper extract size \(2, position 31\)
.*:8: Error: Improper extract size \(32, position 1\)
.*:9: Error: Improper extract size \(0, position 33\)

  The new test result:
                === gas Summary ===

# of expected passes            2624
# of expected failures          1
../as-new 2.23.52.20130422

  Ok to commit?  
  Probably I will need to apply for a new account to get write permission.
Could you sponsor me again?  Thanks a lot!

Regards,
Chao-ying


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