Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor (potential) size opts #1

Open
emoon opened this issue May 10, 2019 · 2 comments
Open

Some minor (potential) size opts #1

emoon opened this issue May 10, 2019 · 2 comments

Comments

@emoon
Copy link

emoon commented May 10, 2019

Hi,

I noticed some minor size opts that can be done as part of the sin-table generation

https://github.com/askeksa/Cinter/blob/master/player/Cinter4.S#L70

At this point it would be possible to do

neg.w d0

instead as d0 is -16384 after this loop.

Also here these two pointers (+ the offsets) points to the same address so actually one write is needed.

https://github.com/askeksa/Cinter/blob/master/player/Cinter4.S#L74-L75

Now given that the code above here

https://github.com/askeksa/Cinter/blob/master/player/Cinter4.S#L63-L64 looks identical maybe the compressor will actually do a better job if it stays the same so I'm not as sure about that one.

@askeksa
Copy link
Owner

askeksa commented May 11, 2019

Thanks for the optimization tip.

The first one is definitely an improvement. I experimented with a few different variations of eliminating the redundant moves, and what seems to work best (after compression) is to swap the two offset writes around (inside the loop) and keeping the middle 3 instructions of the block outside the loop, so it becomes:

neg.w   d0
move.w  d0,-(a1)
neg.w   d0
move.w  d0,CINTER_DEGREES/2*2(a1)

Repository owner deleted a comment from askeksa-google May 11, 2019
@emoon
Copy link
Author

emoon commented May 11, 2019

Nice! np :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants