+CyranoJ Posted December 12, 2017 Share Posted December 12, 2017 You can gain a bit of speed with the following changes, exploiting the pipeline: shlq #2,SQRT_REM_HI .sqrt_loop: move SQRT_REM_LO,TEMP1 sh SQRT_THIRTY,TEMP1 or TEMP1,SQRT_REM_HI shlq #2,SQRT_REM_LO shlq #1,SQRT_ROOT move SQRT_ROOT,SQRT_TEST_DIV shlq #1,SQRT_TEST_DIV addq #1,SQRT_TEST_DIV cmp SQRT_TEST_DIV,SQRT_REM_HI jump ge,(SQRT_LOOP_CHECK) ;if remHi >= testDiv subq #1,SQRT_COUNT sub SQRT_TEST_DIV,SQRT_REM_HI addq #1,SQRT_ROOT .sqrt_do_loop: cmpq #-1,SQRT_COUNT jump ne,(SQRT_LOOP_ADDR) ; if not -1, keep looping shlq #2,SQRT_REM_HI move SQRT_ROOT,r0 GPU_RTS 5 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.