This is the mail archive of the binutils@sourceware.cygnus.com 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]

Patch: tests for pa20 fp instructions


This patch adds gas tests for fmpyfadd, fmpynfadd, fneg, and fnegabs.

ChangeLog entry:

Fri Jul 30 11:11:49 EDT 1999  Jerry Quinn <jquinn@nortelnetworks.com>

	  * gas/testsuite/gas/hppa/basic/basic.exp (do_fp_comp2):  New.
	  * gas/testsuite/gas/hppa/basic/fp_comp2.s:  New.

*** pa-prev/gas/testsuite/gas/hppa/basic/basic.exp	Fri Jul 30 09:56:26 1999
--- gas-src/gas/testsuite/gas/hppa/basic/basic.exp	Fri Jul 30 11:03:10 1999
***************
*** 1752,1757 ****
--- 1752,1804 ----
      if [expr $x==55] then { pass $testname } else { fail $testname }
  }
  
+ proc do_fp_comp2 {} {
+     set testname "fp_comp2.s: fp_comp2 tests"
+     set x 0
+ 
+     gas_start "fp_comp2.s" "-al"
+ 
+     # Check the assembled instruction against a table built by the HP assembler
+     # Any differences should be checked by hand -- with the number of problems
+     # I've seen in the HP assembler I don't completely trust it.
+     #
+     # Instead of having a variable for each match string just increment the
+     # total number of matches seen.  That's simpler when testing large numbers
+     # of instructions (as these tests to).
+     while 1 {
+ 	expect {
+ 	    -re "^ +\[0-9\]+ 0000 B8AA638E\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0004 B8AA6A0E\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0008 BA5B2595\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 000c BA5B2C15\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0010 B8AA63AE\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0014 B8AA6A2E\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0018 BA5B25B5\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 001c BA5B2C35\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0020 38A0C04A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0024 30A0C80A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0028 30A0D80A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 002c 3A80C098\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0030 3280C818\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0034 38A0E04A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0038 30A0E80A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 003c 30A0F80A\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0040 3A80E098\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "^ +\[0-9\]+ 0044 3280E818\[^\n\]*\n"	{ set x [expr $x+1] }
+ 	    -re "\[^\n\]*\n"				{ }
+ 	    timeout				{ perror "timeout\n"; break }
+ 	    eof					{ break }
+ 	}
+     }
+ 
+     # This was intended to do any cleanup necessary.  It kinda looks like it
+     # isn't needed, but just in case, please keep it in for now.
+     gas_finish
+ 
+     # Did we find what we were looking for?  If not, flunk it.
+     if [expr $x==18] then { pass $testname } else { fail $testname }
+ }
+ 
  proc do_fp_conv {} {
      set testname "fp_conv.s: fp_conv tests"
      set x 0
diff -cN pa-prev/gas/testsuite/gas/hppa/basic/fp_comp2.s gas-src/gas/testsuite/gas/hppa/basic/fp_comp2.s
*** pa-prev/gas/testsuite/gas/hppa/basic/fp_comp2.s	Wed Dec 31 19:00:00 1969
--- gas-src/gas/testsuite/gas/hppa/basic/fp_comp2.s	Fri Jul 30 10:49:00 1999
***************
*** 0 ****
--- 1,39 ----
+ 	.LEVEL 2.0
+ 	.SPACE $PRIVATE$
+ 	.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+ 	.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+ 	.SPACE $TEXT$
+ 	.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+ 	.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+ 
+ 	.SPACE $TEXT$
+ 	.SUBSPA $CODE$
+ 
+ 	.align 4
+ ; Basic immediate instruction tests.  
+ ;
+ ; We could/should test some of the corner cases for register and 
+ ; immediate fields.  We should also check the assorted field
+ ; selectors to make sure they're handled correctly.
+ 	fmpyfadd,sgl %fr5R,%fr10L,%fr13R,%fr14L
+ 	fmpyfadd,dbl %fr5,%fr10,%fr13,%fr14
+ 	fmpyfadd,sgl %fr18R,%fr27L,%fr6R,%fr21L
+ 	fmpyfadd,dbl %fr18,%fr27,%fr6,%fr21
+ 
+ 	fmpynfadd,sgl %fr5R,%fr10L,%fr13R,%fr14L
+ 	fmpynfadd,dbl %fr5,%fr10,%fr13,%fr14
+ 	fmpynfadd,sgl %fr18R,%fr27L,%fr6R,%fr21L
+ 	fmpynfadd,dbl %fr18,%fr27,%fr6,%fr21
+ 
+ 	fneg,sgl %fr5,%fr10R
+ 	fneg,dbl %fr5,%fr10
+ 	fneg,quad %fr5,%fr10
+ 	fneg,sgl %fr20R,%fr24L
+ 	fneg,dbl %fr20,%fr24
+ 
+ 	fnegabs,sgl %fr5,%fr10R
+ 	fnegabs,dbl %fr5,%fr10
+ 	fnegabs,quad %fr5,%fr10
+ 	fnegabs,sgl %fr20R,%fr24L
+ 	fnegabs,dbl %fr20,%fr24
+ 


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