register refactor
This commit is contained in:
parent
ae0bb9afed
commit
00bdb689c2
16
math32.tal
16
math32.tal
|
@ -296,16 +296,16 @@
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
@mul32 ( x** y** -> z** )
|
@mul32 ( x** y** -> z** )
|
||||||
,&y2 STR2 ,&y0 STR2 ( save ylo, yhi )
|
;sh/y2 STA2 ;sh/y0 STA2 ( save ylo, yhi )
|
||||||
,&x2 STR2 ,&x0 STR2 ( save xlo, xhi )
|
;sh/x2 STA2 ;sh/x0 STA2 ( save xlo, xhi )
|
||||||
,&y2 LDR2 ,&x2 LDR2 ;mul16 JSR2 ( [x2*y2] )
|
;sh/y2 LDA2 ;sh/x2 LDA2 ;mul16 JSR2 ( [x2*y2] )
|
||||||
,&z2 STR2 ,&z0 STR2 ( sum = x2*y2, save zlo, zhi )
|
;sh/z2 STA2 ;sh/z0 STA2 ( sum = x2*y2, save zlo, zhi )
|
||||||
|
|
||||||
,&y2 LDR2 ,&x0 LDR2 MUL2 ( [x0*y2]<<16 )
|
;sh/y2 LDA2 ;sh/x0 LDA2 MUL2 ( [x0*y2]<<16 )
|
||||||
,&y0 LDR2 ,&x2 LDR2 MUL2 ( [x2*y0]<<16 )
|
;sh/y0 LDA2 ;sh/x2 LDA2 MUL2 ( [x2*y0]<<16 )
|
||||||
( [x0*y0]<<32 will completely overflow )
|
( [x0*y0]<<32 will completely overflow )
|
||||||
ADD2 ,&z0 LDR2 ADD2 ( sum += x0*y2<<16 + x2*y0<<16 )
|
ADD2 ;sh/z0 LDA2 ADD2 ( sum += x0*y2<<16 + x2*y0<<16 )
|
||||||
,&z2 LDR2
|
;sh/z2 LDA2
|
||||||
RTN
|
RTN
|
||||||
[ &x0 $2 &x2 $2 ]
|
[ &x0 $2 &x2 $2 ]
|
||||||
[ &y0 $2 &y2 $2 ]
|
[ &y0 $2 &y2 $2 ]
|
||||||
|
|
Loading…
Reference in New Issue