* CDFR/CEFR/CXFR test
sysclear
archmode esame
r 1a0=00000001800000000000000000000200 # z/Arch restart PSW
r 1d0=00020001800000000000000000BADBAD # z/Arch pgm new PSW
r 200=B7000310     # LCTL R0,R0,CTLR0  Set CR0 bit 45
* CDFR tests
r 204=41000008     # LA R0,8           R0=Number of test data
r 208=41100320     # LA R1,TEST1       R1=>Test data table
r 20C=41F00400     # LA R15,RES1       R15=>Result table
r 210=58201000     #A L R2,0(,R1)      Load R2=TESTn
r 214=B3B50042     # CDFR F4,R2        Convert to HFP in FPR4
r 218=6040F000     # STD F4,0(,R15)    Store FPR4 in result table
r 21C=41101004     # LA R1,4(,R1)      R1=>next test data
r 220=41F0F008     # LA R15,8(,R15)    R15=>next result table
r 224=46000210     # BCT R0,A          Loop to end of TEST table
r 228=D53F04000380 # CLC RES1(64),EXP1 Compare with expected results
r 22E=477002FC     # BNE DIE           Error if not equal
* CEFR tests
r 232=41000008     # LA R0,8           R0=Number of test data
r 236=41100320     # LA R1,TEST1       R1=>Test data table
r 23A=41F00500     # LA R15,RESS1      R15=>Result table
r 23E=58201000     #B L R2,0(,R1)      Load R2=TESTn
r 242=B3B40042     # CEFR F4,R2        Convert to short HFP in FPR4
r 246=7040F000     # STE F4,0(,R15)    Store FPR4 in result table
r 24A=41101004     # LA R1,4(,R1)      R1=>next test data
r 24E=41F0F004     # LA R15,4(,R15)    R15=>next result table
r 252=4600023E     # BCT R0,B          Loop to end of TEST table
r 256=D51F05000480 # CLC RESS1(32),EXPS1 Compare with expected results
r 25C=477002FC     # BNE DIE           Error if not equal
* CXFR tests
r 260=41000008     # LA R0,8           R0=Number of test data
r 264=41100320     # LA R1,TEST1       R1=>Test data table
r 268=41F00600     # LA R15,RESX1      R15=>Result table
r 26C=58201000     #C L R2,0(,R1)      Load R2=TESTn
r 270=B3B60042     # CXFR F4,R2        Convert to ext HFP in FPR4,FPR6
r 274=6040F000     # STD F4,0(,R15)    Store FPR4 in result table
r 278=6060F008     # STD F6,8(,R15)    Store FPR6 in result table
r 27C=41101004     # LA R1,4(,R1)      R1=>next test data
r 280=41F0F010     # LA R15,16(,R15)   R15=>next result table
r 284=4600026C     # BCT R0,C          Loop to end of TEST table
r 288=D57F06000580 # CLC RESX1(128),EXPX1 Compare with expected results
r 28E=477002FC     # BNE DIE           Error if not equal
r 292=B2B20300     # LPSWE WAITPSW     Load enabled wait PSW
r 2FC=B2B201D0     #DIE LPSWE PGMNPSW  Load disabled wait PSW
r 300=07020001800000000000000000AAAAAA # WAITPSW Enabled wait state PSW
r 310=00040000     # CTLR0             Control register 0 (bit45 AFP control)
r 314=00000000     # FPCREG            Floating point control register
* Test data
r 320=14D44337                         # TEST1
r 324=00000000                         # TEST2
r 328=0000007B                         # TEST3
r 32C=FFFFFF85                         # TEST4
r 330=0FFFFFFF                         # TEST5
r 334=7FFFFFFF                         # TEST6
r 338=80000000                         # TEST7
r 33C=00000000                         # TEST8
* Expected results (long HFP)
r 380=4814D44337000000                 # EXP1
r 388=0000000000000000                 # EXP2
r 390=427B000000000000                 # EXP3
r 398=C27B000000000000                 # EXP4
r 3A0=47FFFFFFF0000000                 # EXP5
r 3A8=487FFFFFFF000000                 # EXP6
r 3B0=C880000000000000                 # EXP7
r 3B8=0000000000000000                 # EXP8
* Expected results (short HFP)
r 480=4814D443                         # EXPS1
r 484=00000000                         # EXPS2
r 488=427B0000                         # EXPS3
r 48C=C27B0000                         # EXPS4
r 490=47FFFFFF                         # EXPS5
r 494=487FFFFF                         # EXPS6
r 498=C8800000                         # EXPS7
r 49C=00000000                         # EXPS8
* Expected results (extended HFP)
r 580=4814D443370000003A00000000000000 # EXPX1
r 590=00000000000000000000000000000000 # EXPX2
r 5A0=427B0000000000003400000000000000 # EXPX3
r 5B0=C27B000000000000B400000000000000 # EXPX4
r 5C0=47FFFFFFF00000003900000000000000 # EXPX5
r 5D0=487FFFFFFF0000003A00000000000000 # EXPX6
r 5E0=C880000000000000BA00000000000000 # EXPX7
r 5F0=00000000000000000000000000000000 # EXPX8
ostailor null
pgmtrace +7
restart
pause 1
* Display test data
r 320.20
* Display expected results (long HFP)
r 380.40
* Display actual results (long HFP)
r 400.40
* Display expected results (short HFP)
r 480.20
* Display actual results (short HFP)
r 500.20
* Display expected results (extended HFP)
r 580.80
* Display actual results (extended HFP)
r 600.80
