This commit is contained in:
Brooke Vibber 2024-12-31 09:02:42 -08:00
parent 2fcb30b76a
commit d2f41f9644

View file

@ -425,14 +425,8 @@ viewport_oy:
round16 arg ; 11-27 cycles round16 arg ; 11-27 cycles
.endmacro .endmacro
.macro imul16_round dest, arg1, arg2, shift ; input: arg1, arg2 as fixed4.12
copy16 FR0, arg1 ; 12 cyc ; output: dest as fixed8.24
copy16 FR1, arg2 ; 12 cyc
jsr imul16_func ; ? cyc
shift_round_16 FR2, shift ; 103-119 cycles for shift=4
copy16 dest, FR2 + 2 ; 12 cyc
.endmacro
.macro imul16 dest, arg1, arg2 .macro imul16 dest, arg1, arg2
copy16 FR0, arg1 ; 12 cyc copy16 FR0, arg1 ; 12 cyc
copy16 FR1, arg2 ; 12 cyc copy16 FR1, arg2 ; 12 cyc
@ -440,20 +434,16 @@ viewport_oy:
copy32 dest, FR2 ; 24 cyc copy32 dest, FR2 ; 24 cyc
.endmacro .endmacro
.macro sqr16_round dest, arg, shift ; input: arg as fixed4.12
;imul16_round dest, arg, arg, shift ; output: dest as fixed8.24
copy16 FR0, arg ; 12 cyc
jsr sqr16_func ; ? cyc
shift_round_16 FR2, shift ; 103-119 cycles for shift=4
copy16 dest, FR2 + 2 ; 12 cyc
.endmacro
.macro sqr16 dest, arg .macro sqr16 dest, arg
copy16 FR0, arg ; 12 cyc copy16 FR0, arg ; 12 cyc
jsr sqr16_func ; ? cyc jsr sqr16_func ; ? cyc
copy32 dest, FR2 ; 24 cyc copy32 dest, FR2 ; 24 cyc
.endmacro .endmacro
; input: arg as u8
; output: dest as u16
; clobbers a, x ; clobbers a, x
.macro sqr8 dest, arg .macro sqr8 dest, arg
ldx arg ldx arg