Add some FP test cases, including some parse errors.

Adjust the parsing a bit, and generate 0 values for bad syntax
like the reference version does.
This commit is contained in:
Olaf Seibert
2022-06-19 16:11:59 +02:00
parent 3109f40bd5
commit 3eb7274625
4 changed files with 239 additions and 87 deletions

View File

@@ -98,6 +98,52 @@
.FLT4 170141183460469230564930741053754966015 ; 2**127-(2**70-2**64+2**62+1)
.FLT4 170141183460469230564930741053754966016 ; 2**127-(2**70-2**64+2**62+2)
.flt4 1.0000000000000000138777878078144567552953958511353 ; 0040200 0000000 0000000 0000000
.flt4 1.0000000000000000416333634234433702658861875534058 ; 0040200 0000000 0000000 0000001
.flt4 0.99999999999999997918331828827831486705690622329712 ; 0040177 0177777 0177777 0177776
.flt4 0.99999999999999999306110609609277162235230207443237 ; 0040177 0177777 0177777 0177777
.flt4 100E-2 ; 040200 000000 000000 000000
.flt4 1.0E5 ; 044303 050000 000000 000000
.flt4 1.0E10 ; 050425 001371 000000 000000
.flt4 1.0E20 ; 060655 074353 142654 061000
.flt4 1.0E30 ; 071111 171311 146404 063517
.flt4 1.0E38 ; 077626 073231 050265 006611
.flt4 1.0E-5 ; 034047 142654 043433 043604
.flt4 1.0E-10 ; 027733 163376 147275 166726
.flt4 1.0E-20 ; 017474 162410 062222 010433
.flt4 1.0E-30 ; 007242 041137 173536 012374
.flt4 1.0E-38 ; 000531 143734 166523 143442
.flt4 3681129745421959167 ; 057514 054000 000000 000000
.flt4 3681129745421959168 ; 0x3316000000000000 057514 054000 000000 000000
.flt4 3681129745421959169 ; 057514 054000 000000 000000
.flt4 3681129745421959170 ; 057514 054000 000000 000000
.flt4 14757170078986272767 ; 060114 146000 000000 000000
.flt4 14757170078986272768 ; 0xCCCC000000000000 060114 146000 000000 000000
.flt4 14757170078986272769 ; 060114 146000 000000 000000
.flt4 14757170078986272780 ; 060114 146000 000000 000000
.flt4 3.1415926535897932384626433 ; 040511 007732 121041 064302
; Try some possibly incomplete numbers
.flt4 + ; bad
.flt4 +1 ; ok
.flt4 +E1 ; bad
.flt4 - ; bad
.flt4 -1 ; ok
.flt4 -1. ; ok
.flt4 -1.. ; bad
.flt4 -E1 ; bad
.flt4 +. ; bad
.flt4 -. ; bad
.flt4 . ; bad
.flt4 .. ; bad
.flt4 .E10 ; bad
; Several ways to define a name for the fpp registers
ac0 = r0