no this seems right
but it's still coming out different. wtf am i doing wrong it's gotta be a brainfart
This commit is contained in:
parent
76715a6151
commit
b55015ff87
1 changed files with 17 additions and 16 deletions
33
mandel.s
33
mandel.s
|
@ -361,32 +361,33 @@ positive_result:
|
|||
; Round top 16 bits of 32-bit fixed-point number in-place
|
||||
.local positive
|
||||
.local negative
|
||||
.local increment
|
||||
.local no_carry
|
||||
.local next
|
||||
|
||||
; positive input:
|
||||
; 0 rounds down, no change - 10 cyc
|
||||
; 1 rounds up, add one - 17-22 cyc
|
||||
; 0 rounds down, no change - 5 cyc
|
||||
; 1 rounds up, add one - 15-20 cyc
|
||||
; negative input:
|
||||
; 0 rounds up, add one - 19-24 cyc
|
||||
; 1 rounds down, no change - 10 cyc
|
||||
; 0 rounds up, no change - 5 cyc
|
||||
; 1 rounds down, sub one - 23-28 cyc
|
||||
|
||||
; check 16th bit down
|
||||
lda arg + 1 ; 3 cyc
|
||||
bpl next ; 2 cyc
|
||||
|
||||
; check sign bit
|
||||
lda arg + 3 ; 3 cyc
|
||||
bpl positive ; 2 cyc
|
||||
|
||||
negative:
|
||||
; check 16th bit down
|
||||
lda arg + 1 ; 3 cyc
|
||||
bmi next ; 2 cyc
|
||||
bpl increment ; 2 cyc
|
||||
negative: ; 13-18 cyc
|
||||
lda arg + 2 ; 3 cyc
|
||||
bne no_carry ; 2 cyc
|
||||
dec arg + 3 ; 5 cyc
|
||||
no_carry:
|
||||
dec arg + 2 ; 5 cyc
|
||||
jmp next ; 3 cyc
|
||||
|
||||
positive:
|
||||
; check 16th bit down
|
||||
lda arg + 1 ; 3 cyc
|
||||
bpl next ; 2 cyc
|
||||
|
||||
increment:
|
||||
positive: ; 5-10 cyc
|
||||
inc arg + 2 ; 5 cyc
|
||||
bne next ; 2 cyc
|
||||
inc arg + 3 ; 5 cyc
|
||||
|
|
Loading…
Reference in a new issue