Commit 883aa4cd authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Fix for data abort if an array calculation errors with 5-byte FP values

The FPOINT=0 implementations of
  result() = array() [+-*/] constant
  result() = arraya() [+-*/] arrayb()
and FPOINT=0,1,2 implementations of
  result() = arraya() . arrayb()
were all using R8 at the top level loop to iterate the array, not noticing that
R8 is ARGP, so if the operation fails (for example due to overflow) the attempt
to translate the error message via MSG fails because ARGP is left pointing at
the next array element.
Deal with this by spilling a register onto the stack so ARGP is left alone.

The FPOINT=1 and FPOINT=2 implementations of operations [+-*/] both don't
touch R8 and therefore correctly reported any errors during those calculations.

Example faulting program:
  DIM array(2), result(2)
  a() = 1.7E18,1.7E28,1.7E38
  result() = a() + 1E38 : REM Overflow on the last element
  PRINT result(0)'result(1)'result(2)

Version 1.86. Tagged as 'BASIC-1_86'
parent 72ca3ed5
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate GBLS Module_ApplicationDate
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
Module_MajorVersion SETS "1.85" Module_MajorVersion SETS "1.86"
Module_Version SETA 185 Module_Version SETA 186
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "03 Oct 2022" Module_Date SETS "15 Feb 2025"
Module_ApplicationDate SETS "03-Oct-22" Module_ApplicationDate SETS "15-Feb-25"
Module_ComponentName SETS "BASIC" Module_ComponentName SETS "BASIC"
Module_FullVersion SETS "1.85" Module_FullVersion SETS "1.86"
Module_HelpVersion SETS "1.85 (03 Oct 2022)" Module_HelpVersion SETS "1.86 (15 Feb 2025)"
END END
/* (1.85) /* (1.86)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* *
*/ */
#define Module_MajorVersion_CMHG 1.85 #define Module_MajorVersion_CMHG 1.86
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Oct 2022 #define Module_Date_CMHG 15 Feb 2025
#define Module_MajorVersion "1.85" #define Module_MajorVersion "1.86"
#define Module_Version 185 #define Module_Version 186
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "03 Oct 2022" #define Module_Date "15 Feb 2025"
#define Module_ApplicationDate "03-Oct-22" #define Module_ApplicationDate "15-Feb-25"
#define Module_ComponentName "BASIC" #define Module_ComponentName "BASIC"
#define Module_FullVersion "1.85" #define Module_FullVersion "1.86"
#define Module_HelpVersion "1.85 (03 Oct 2022)" #define Module_HelpVersion "1.86 (15 Feb 2025)"
#define Module_LibraryVersionInfo "1:85" #define Module_LibraryVersionInfo "1:86"
...@@ -544,23 +544,22 @@ ARRAYBINARYSIZE ...@@ -544,23 +544,22 @@ ARRAYBINARYSIZE
ARRAYBINARYADDFP ARRAYBINARYADDFP
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} ;save pointers STMFD SP!,{R1,R10} ; R1 -> RHS array
MOV R10,R4 MOV R10,R4 ; R0 -> LHS array, R10 -> dst
MOV R8,R1
MOV TYPE,R0 MOV TYPE,R0
ARRAYBINARYADDFP1 ARRAYBINARYADDFP1
BL F1LDA BL F1LDA ; ADD is commutative, so this alternates LHS/RHS
ADD R7,TYPE,#5 ADD R7,TYPE,#5
MOV TYPE,R8 LDR TYPE,[SP,#0]
MOV R8,R7 STR R7,[SP,#0] ; LHS or RHS pointer + 5
BL F1ADD BL F1ADD
ADD TYPE,TYPE,#5 ADD TYPE,TYPE,#5 ; RHS or LHS pointer + 5
MOV R4,R10 MOV R4,R10
BL F1STABYR4 BL F1STABYR4
ADD R10,R10,#5 ADD R10,R10,#5
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYBINARYADDFP1 BNE ARRAYBINARYADDFP1
LDMFD SP!,{R8,R10} LDMFD SP!,{R1,R10}
ELIF FPOINT=1 ELIF FPOINT=1
LDFD FACC,[IACC],#8 LDFD FACC,[IACC],#8
LDFD F1,[R1],#8 LDFD F1,[R1],#8
...@@ -614,25 +613,24 @@ ARRAYBINARYSUB ...@@ -614,25 +613,24 @@ ARRAYBINARYSUB
ARRAYBINARYSUBFP ARRAYBINARYSUBFP
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} ;save pointers STMFD SP!,{R1,R10} ; R1 -> RHS array
MOV R10,R4 MOV R10,R4 ; R0 -> LHS array, R10 -> dst
MOV R8,R1
MOV TYPE,R0 MOV TYPE,R0
ARRAYBINARYSUBFP1 ARRAYBINARYSUBFP1
BL F1LDA BL F1LDA ; SUB isn't commutative, so this is always F1 := LHS
ADD R4,TYPE,#5 ADD R4,TYPE,#5
MOV TYPE,R8 LDR TYPE,[SP,#0] ; RHS pointer
MOV R8,R4 STR R4,[SP,#0] ; LHS pointer + 5
BL F1XSUB BL F1XSUB
ADD R4,TYPE,#5 ADD R4,TYPE,#5
MOV TYPE,R10 MOV TYPE,R10
BL F1STA BL F1STA
MOV TYPE,R8 LDR TYPE,[SP,#0] ; Restore LHS pointer
MOV R8,R4 STR R4,[SP,#0] ; RHS pointer + 5
ADD R10,R10,#5 ADD R10,R10,#5
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYBINARYSUBFP1 BNE ARRAYBINARYSUBFP1
LDMFD SP!,{R8,R10} LDMFD SP!,{R1,R10}
ELIF FPOINT=1 ELIF FPOINT=1
LDFD FACC,[IACC],#8 LDFD FACC,[IACC],#8
LDFD F1,[R1],#8 LDFD F1,[R1],#8
...@@ -655,23 +653,22 @@ ARRAYBINARYMUL ...@@ -655,23 +653,22 @@ ARRAYBINARYMUL
ARRAYBINARYMULFP ARRAYBINARYMULFP
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} ;save pointers STMFD SP!,{R1,R10} ; R1 -> RHS array
MOV R10,R4 MOV R10,R4 ; R0 -> LHS array, R10 -> dst
MOV R8,R1
MOV TYPE,R0 MOV TYPE,R0
ARRAYBINARYMULFP1 ARRAYBINARYMULFP1
BL F1LDA BL F1LDA ; MUL is commutative, so this alternates LHS/RHS
ADD R7,TYPE,#5 ADD R7,TYPE,#5
MOV TYPE,R8 LDR TYPE,[SP,#0]
MOV R8,R7 STR R7,[SP,#0] ; LHS or RHS pointer + 5
BL F1MUL BL F1MUL
ADD TYPE,TYPE,#5 ADD TYPE,TYPE,#5 ; RHS or LHS pointer + 5
MOV R4,R10 MOV R4,R10
BL F1STABYR4 BL F1STABYR4
ADD R10,R10,#5 ADD R10,R10,#5
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYBINARYMULFP1 BNE ARRAYBINARYMULFP1
LDMFD SP!,{R8,R10} LDMFD SP!,{R1,R10}
ELIF FPOINT=1 ELIF FPOINT=1
LDFD FACC,[IACC],#8 LDFD FACC,[IACC],#8
LDFD F1,[R1],#8 LDFD F1,[R1],#8
...@@ -700,25 +697,24 @@ ARRAYBINARYDIVINT ...@@ -700,25 +697,24 @@ ARRAYBINARYDIVINT
ARRAYBINARYDIVFP ARRAYBINARYDIVFP
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} ;save pointers STMFD SP!,{R1,R10} ; R1 -> RHS array
MOV R10,R4 MOV R10,R4 ; R0 -> LHS array, R10 -> dst
MOV R8,R1
MOV TYPE,R0 MOV TYPE,R0
ARRAYBINARYDIVFP1 ARRAYBINARYDIVFP1
BL F1LDA BL F1LDA ; DIV isn't commutative, so this is always F1 := LHS
ADD R4,TYPE,#5 ADD R4,TYPE,#5
MOV TYPE,R8 LDR TYPE,[SP,#0] ; RHS pointer
MOV R8,R4 STR R4,[SP,#0] ; LHS pointer + 5
BL F1XDIV BL F1XDIV
ADD R4,TYPE,#5 ADD R4,TYPE,#5
MOV TYPE,R10 MOV TYPE,R10
BL F1STA BL F1STA
MOV TYPE,R8 LDR TYPE,[SP,#0] ; Restore LHS pointer
MOV R8,R4 STR R4,[SP,#0] ; RHS pointer + 5
ADD R10,R10,#5 ADD R10,R10,#5
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYBINARYDIVFP1 BNE ARRAYBINARYDIVFP1
LDMFD SP!,{R8,R10} LDMFD SP!,{R1,R10}
ELIF FPOINT=1 ELIF FPOINT=1
LDFD FACC,[IACC],#8 LDFD FACC,[IACC],#8
LDFD F1,[R1],#8 LDFD F1,[R1],#8
...@@ -813,9 +809,8 @@ ARRAYBINARYCONSTDIVINT ...@@ -813,9 +809,8 @@ ARRAYBINARYCONSTDIVINT
ARRAYBINARYCONSTDIVFP ARRAYBINARYCONSTDIVFP
BL PULLTYPE BL PULLTYPE
BL FLOATY BL FLOATY
STMFD SP!,{R8,R10} STMFD SP!,{R6,R10}
MOV R10,R4 ;D MOV R10,R4 ;D
MOV R8,R6 ;S
[ FPOINT=0 [ FPOINT=0
BL FPUSH BL FPUSH
TEQ FACC,#0 TEQ FACC,#0
...@@ -830,8 +825,9 @@ ARRAYBINARYCONSTDIVFP ...@@ -830,8 +825,9 @@ ARRAYBINARYCONSTDIVFP
BEQ ZDIVOR BEQ ZDIVOR
[ FPOINT=0 [ FPOINT=0
ARRAYBINARYCONSTDIVFP1 ARRAYBINARYCONSTDIVFP1
MOV TYPE,R8 LDR TYPE,[SP,#2*4] ;-> S
ADD R8,R8,#5 ADD R14,TYPE,#5
STR R14,[SP,#2*4] ;-> next S
BL F1LDA BL F1LDA
BEQ ARRAYBINARYCONSTDIVFP2 BEQ ARRAYBINARYCONSTDIVFP2
BL FTOW BL FTOW
...@@ -845,20 +841,20 @@ ARRAYBINARYCONSTDIVFP2 ...@@ -845,20 +841,20 @@ ARRAYBINARYCONSTDIVFP2
BNE ARRAYBINARYCONSTDIVFP1 BNE ARRAYBINARYCONSTDIVFP1
ELIF FPOINT=1 ELIF FPOINT=1
ARRAYBINARYCONSTDIVFP1 ARRAYBINARYCONSTDIVFP1
LDFD F1,[R8],#8 LDFD F1,[R6],#8
DVFD F1,F1,FACC DVFD F1,F1,FACC
STFD F1,[R10],#8 STFD F1,[R10],#8
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYBINARYCONSTDIVFP1 BNE ARRAYBINARYCONSTDIVFP1
ELIF FPOINT=2 ELIF FPOINT=2
VFPVectorScalarOp FDIVD,R10,R8,FACC VFPVectorScalarOp FDIVD,R10,R6,FACC
| |
! 1, "Unknown FPOINT setting" ! 1, "Unknown FPOINT setting"
] ]
[ FPOINT=0 [ FPOINT=0
LDMFD SP!,{R0,R1,R8,R10} LDMFD SP!,{R0,R1,R6,R10}
| |
LDMFD SP!,{R8,R10} LDMFD SP!,{R6,R10}
] ]
B NXT B NXT
ARRAYBINARYCONST2 ARRAYBINARYCONST2
...@@ -1088,13 +1084,13 @@ ARRAYCONSTBINARYADDFP ...@@ -1088,13 +1084,13 @@ ARRAYCONSTBINARYADDFP
BL PULLTYPE BL PULLTYPE
BL FLOATY BL FLOATY
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} STMFD SP!,{R6,R10}
MOV R10,R4 ;D MOV R10,R4 ;D
MOV R8,R6 ;S
BL FPUSH BL FPUSH
ARRAYCONSTBINARYADDFP1 ARRAYCONSTBINARYADDFP1
MOV TYPE,R8 LDR TYPE,[SP,#2*4] ;-> S
ADD R8,R8,#5 ADD R14,TYPE,#5
STR R14,[SP,#2*4] ;-> next S
BL F1LDA BL F1LDA
MOV TYPE,SP MOV TYPE,SP
BL FADD BL FADD
...@@ -1103,7 +1099,7 @@ ARRAYCONSTBINARYADDFP1 ...@@ -1103,7 +1099,7 @@ ARRAYCONSTBINARYADDFP1
BL F1STA BL F1STA
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYCONSTBINARYADDFP1 BNE ARRAYCONSTBINARYADDFP1
LDMFD SP!,{R0,R1,R8,R10} LDMFD SP!,{R0,R1,R6,R10}
ELIF FPOINT=1 ELIF FPOINT=1
ARRAYCONSTBINARYADDFP1 ARRAYCONSTBINARYADDFP1
LDFD F1,[R6],#8 LDFD F1,[R6],#8
...@@ -1157,13 +1153,13 @@ ARRAYCONSTBINARYMINUSFP ...@@ -1157,13 +1153,13 @@ ARRAYCONSTBINARYMINUSFP
BL PULLTYPE BL PULLTYPE
BL FLOATY BL FLOATY
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} STMFD SP!,{R6,R10}
MOV R10,R4 ;D MOV R10,R4 ;D
MOV R8,R6 ;S
BL FPUSH BL FPUSH
ARRAYCONSTBINARYMINUSFP1 ARRAYCONSTBINARYMINUSFP1
MOV TYPE,R8 LDR TYPE,[SP,#2*4] ;-> S
ADD R8,R8,#5 ADD R14,TYPE,#5
STR R14,[SP,#2*4] ;-> next S
BL F1LDA BL F1LDA
MOV TYPE,SP MOV TYPE,SP
BL FXSUB BL FXSUB
...@@ -1172,7 +1168,7 @@ ARRAYCONSTBINARYMINUSFP1 ...@@ -1172,7 +1168,7 @@ ARRAYCONSTBINARYMINUSFP1
BL F1STA BL F1STA
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYCONSTBINARYMINUSFP1 BNE ARRAYCONSTBINARYMINUSFP1
LDMFD SP!,{R0,R1,R8,R10} LDMFD SP!,{R0,R1,R6,R10}
ELIF FPOINT=1 ELIF FPOINT=1
ARRAYCONSTBINARYMINUSFP1 ARRAYCONSTBINARYMINUSFP1
LDFD F1,[R6],#8 LDFD F1,[R6],#8
...@@ -1198,13 +1194,13 @@ ARRAYCONSTBINARYMULFP ...@@ -1198,13 +1194,13 @@ ARRAYCONSTBINARYMULFP
BL PULLTYPE BL PULLTYPE
BL FLOATY BL FLOATY
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} STMFD SP!,{R6,R10}
MOV R10,R4 ;D MOV R10,R4 ;D
MOV R8,R6 ;S
BL FPUSH BL FPUSH
ARRAYCONSTBINARYMULFP1 ARRAYCONSTBINARYMULFP1
MOV TYPE,R8 LDR TYPE,[SP,#2*4] ;-> S
ADD R8,R8,#5 ADD R14,TYPE,#5
STR R14,[SP,#2*4] ;-> next S
BL F1LDA BL F1LDA
MOV TYPE,SP MOV TYPE,SP
BL FMUL BL FMUL
...@@ -1213,7 +1209,7 @@ ARRAYCONSTBINARYMULFP1 ...@@ -1213,7 +1209,7 @@ ARRAYCONSTBINARYMULFP1
BL F1STA BL F1STA
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYCONSTBINARYMULFP1 BNE ARRAYCONSTBINARYMULFP1
LDMFD SP!,{R0,R1,R8,R10} LDMFD SP!,{R0,R1,R6,R10}
ELIF FPOINT=1 ELIF FPOINT=1
ARRAYCONSTBINARYMULFP1 ARRAYCONSTBINARYMULFP1
LDFD F1,[R6],#8 LDFD F1,[R6],#8
...@@ -1245,13 +1241,13 @@ ARRAYCONSTBINARYDIVFP ...@@ -1245,13 +1241,13 @@ ARRAYCONSTBINARYDIVFP
BL PULLTYPE BL PULLTYPE
BL FLOATY BL FLOATY
[ FPOINT=0 [ FPOINT=0
STMFD SP!,{R8,R10} STMFD SP!,{R6,R10}
MOV R10,R4 ;D MOV R10,R4 ;D
MOV R8,R6 ;S
BL FPUSH BL FPUSH
ARRAYCONSTBINARYDIVFP1 ARRAYCONSTBINARYDIVFP1
MOV TYPE,R8 LDR TYPE,[SP,#2*4] ;-> S
ADD R8,R8,#5 ADD R14,TYPE,#5
STR R14,[SP,#2*4] ;-> next S
BL F1LDA BL F1LDA
MOV TYPE,SP MOV TYPE,SP
BL FXDIV BL FXDIV
...@@ -1260,7 +1256,7 @@ ARRAYCONSTBINARYDIVFP1 ...@@ -1260,7 +1256,7 @@ ARRAYCONSTBINARYDIVFP1
BL F1STA BL F1STA
SUBS AELINE,AELINE,#1 SUBS AELINE,AELINE,#1
BNE ARRAYCONSTBINARYDIVFP1 BNE ARRAYCONSTBINARYDIVFP1
LDMFD SP!,{R0,R1,R8,R10} LDMFD SP!,{R0,R1,R6,R10}
ELIF FPOINT=1 ELIF FPOINT=1
ARRAYCONSTBINARYDIVFP1 ARRAYCONSTBINARYDIVFP1
LDFD F1,[R6],#8 LDFD F1,[R6],#8
...@@ -1396,10 +1392,12 @@ MATRIXMULTIPLYINT3 ...@@ -1396,10 +1392,12 @@ MATRIXMULTIPLYINT3
LDMFD SP!,{R0,R8,R10} LDMFD SP!,{R0,R8,R10}
B NXT B NXT
MATRIXMULTIPLYFP MATRIXMULTIPLYFP
;at this instant r3,r7,r9,r10,r11,r14 are free
;r8=ARGP now in case of calculation error
[ FPOINT=0 [ FPOINT=0
ADD R5,R5,R5,LSL #2 ;LIMJ'=LIMJ*5 ADD R5,R5,R5,LSL #2 ;LIMJ'=LIMJ*5
STMFD SP!,{R0,R1,R2,R4,R5} ADD R11,R6,R6,LSL #2 ;LIMK'=LIMK*5
STMFD SP!,{R0,R1,R2,R4,R5,R11}
SUB SP,SP,#8 SUB SP,SP,#8
;SP+0 = r source base ;SP+0 = r source base
;SP+4 = outer loop counter ;SP+4 = outer loop counter
...@@ -1408,18 +1406,19 @@ MATRIXMULTIPLYFP ...@@ -1408,18 +1406,19 @@ MATRIXMULTIPLYFP
;SP+16= LIMI ;SP+16= LIMI
;SP+20= dest base ;SP+20= dest base
;SP+24= LIMJ*5 ;SP+24= LIMJ*5
ADD R11,R6,R6,LSL #2 ;LIMK'=LIMK*5 ;SP+28= LIMK*5
;main loop over i ;main loop over i
MATRIXMULTIPLYFP1 MATRIXMULTIPLYFP1
LDR R0,[SP,#8] ;reload r source base LDR R0,[SP,#8] ;reload r source base
STR R0,[SP] STR R0,[SP]
STR R11,[SP,#4] ;loop count: LIMK*5 LDR R14,[SP,#28]
STR R14,[SP,#4] ;loop count: LIMK*5
;outer loop over k ;outer loop over k
MATRIXMULTIPLYFP2 MATRIXMULTIPLYFP2
BL FCLR ;result BL FCLR ;result
LDR R10,[SP,#12] ;l source LDR R10,[SP,#12] ;l source
LDR TYPE,[SP] ;r source LDR TYPE,[SP] ;r source
LDR R8,[SP,#24] ;loop count: LIMJ*5 LDR R11,[SP,#24] ;loop count: LIMJ*5
;inner loop over j ;inner loop over j
MATRIXMULTIPLYFP3 MATRIXMULTIPLYFP3
STMFD SP!,{R0-R3} ;save accumulated value STMFD SP!,{R0-R3} ;save accumulated value
...@@ -1429,10 +1428,11 @@ MATRIXMULTIPLYFP3 ...@@ -1429,10 +1428,11 @@ MATRIXMULTIPLYFP3
BL F1LDA BL F1LDA
MOV TYPE,R4 MOV TYPE,R4
BL F1MUL BL F1MUL
ADD TYPE,TYPE,R11 ;step inner copy of r source by LIMK*5 LDR R14,[SP,#28+4*4]
ADD TYPE,TYPE,R14 ;step inner copy of r source by LIMK*5
LDMFD SP!,{R4-R7} LDMFD SP!,{R4-R7}
BL FADDW BL FADDW
SUBS R8,R8,#5 SUBS R11,R11,#5
BNE MATRIXMULTIPLYFP3 BNE MATRIXMULTIPLYFP3
LDR TYPE,[SP,#20] LDR TYPE,[SP,#20]
BL F1STA BL F1STA
...@@ -1453,7 +1453,7 @@ MATRIXMULTIPLYFP3 ...@@ -1453,7 +1453,7 @@ MATRIXMULTIPLYFP3
SUBS R0,R0,#1 SUBS R0,R0,#1
STRNE R0,[SP,#16] ;decrement LIMI directly in main loop STRNE R0,[SP,#16] ;decrement LIMI directly in main loop
BNE MATRIXMULTIPLYFP1 BNE MATRIXMULTIPLYFP1
ADD SP,SP,#7*4 ADD SP,SP,#8*4
ELIF FPOINT=1 ELIF FPOINT=1
MOV R6,R6,LSL #3 ;LIMK=LIMK*8 MOV R6,R6,LSL #3 ;LIMK=LIMK*8
;main loop over i ;main loop over i
...@@ -1465,14 +1465,14 @@ MATRIXMULTIPLYFP2 ...@@ -1465,14 +1465,14 @@ MATRIXMULTIPLYFP2
MVFD FACC,#0 ;result MVFD FACC,#0 ;result
MOV R14,R1 ;l source MOV R14,R1 ;l source
MOV R7,R10 ;r source MOV R7,R10 ;r source
MOV R8,R5 ;loop count: LIMJ MOV R3,R5 ;loop count: LIMJ
;inner loop over j ;inner loop over j
MATRIXMULTIPLYFP3 MATRIXMULTIPLYFP3
LDFD F1,[R14],#8 ;inner copy of l source LDFD F1,[R14],#8 ;inner copy of l source
LDFD F2,[R7] LDFD F2,[R7]
MUFD F1,F1,F2 MUFD F1,F1,F2
ADD R7,R7,R6 ;step inner copy of r source by LIMK*8 ADD R7,R7,R6 ;step inner copy of r source by LIMK*8
SUBS R8,R8,#1 SUBS R3,R3,#1
ADFD FACC,FACC,F1 ADFD FACC,FACC,F1
BNE MATRIXMULTIPLYFP3 BNE MATRIXMULTIPLYFP3
STFD FACC,[R4],#8 ;step destination STFD FACC,[R4],#8 ;step destination
...@@ -1494,13 +1494,13 @@ MATRIXMULTIPLYFP2 ...@@ -1494,13 +1494,13 @@ MATRIXMULTIPLYFP2
FLDD FACC,=0 ;result FLDD FACC,=0 ;result
MOV R14,R1 ;l source MOV R14,R1 ;l source
MOV R7,R10 ;r source MOV R7,R10 ;r source
MOV R8,R5 ;loop count: LIMJ MOV R3,R5 ;loop count: LIMJ
;inner loop over j ;inner loop over j
MATRIXMULTIPLYFP3 MATRIXMULTIPLYFP3
FLDD D1,[R14],#8 ;inner copy of l source FLDD D1,[R14],#8 ;inner copy of l source
FLDD D2,[R7] FLDD D2,[R7]
ADD R7,R7,R6 ;step inner copy of r source by LIMK*8 ADD R7,R7,R6 ;step inner copy of r source by LIMK*8
SUBS R8,R8,#1 SUBS R3,R3,#1
FMACD FACC,D1,D2 FMACD FACC,D1,D2
BNE MATRIXMULTIPLYFP3 BNE MATRIXMULTIPLYFP3
FSTD FACC,[R4],#8 ;step destination FSTD FACC,[R4],#8 ;step destination
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment