Re[4]: [cc65] optimizer?

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2001-06-25 14:11:03


Hello daniel,

Monday, June 25, 2001, 1:54:02 PM, you wrote:

dp> On Sun, 24 Jun 2001, groepaz wrote:

>> - replacing sequences of register-shifts by hash-table-accesses (need
>> one index register, so may be used after peephole analyzing) eg:
>> 
>> replace:
>> 
>>         lda something
>>         lsr a
>>         lsr a
>>         lsr a
>>         lsr a
>>         sta something
>> 
>> by:
>>         ldx something
>>         lda lsr4tab,x
>>         sta something
>> 
>> ...saving some cycles (and memory if used often enough to compensate
>> the tablesize)

dp> Aha! you are saving THREE-cycles.
dp> We are so little on registers that we always, me at least, need
dp> every-REgister busy. therefor saving/restoring the INDEX-Reg. 3+3
dp> cycles. So we are THREE-cycles MINUS!

dp> as far as I had experienced the SHIFT-things is the LAST thing to
dp> optimize. If you have more than FOUR shifts, like in your example, you
dp> shift the the other way round:
dp> replace:
dp>         lda zp
dp>         lsr
dp>         lsr
dp>         lsr
dp>         lsr
dp>         lsr
dp>         sta zp

dp> by:
dp>         lda zp
dp>         rol
dp>         rol
dp>         rol
dp>         and #$07        ; if you need the ZEROs
dp>         sta zp


dp> Any comments are welcome.

well all i can say to that is, that ofcoz the above optimization dont
make any sence if the index-register isnt available anyway


-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:40 CET