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

Performance analysis for vasm jcc #152

Open
igorsnunes opened this issue Sep 13, 2016 · 1 comment
Open

Performance analysis for vasm jcc #152

igorsnunes opened this issue Sep 13, 2016 · 1 comment

Comments

@igorsnunes
Copy link

igorsnunes commented Sep 13, 2016

Currently, a "jcc" executes all the following instructions, even if the branch is unlikely to happen.

li64 1/5
li64 2/5
li64 3/5
li64 4/5
li64 5/5
mtctr
nop for the overflow 1/2
nop for the overflow 2/2
bcctr with conditions

In order to avoid loading adresses when it is unlikely to execute a branch, we may use the following:

bc with negated conditions to the end of this block (+36 bytes)
li64 1/5
li64 2/5
li64 3/5
li64 4/5
li64 5/5
mtctr
nop for the overflow 1/2
nop for the overflow 2/2
bctr unconditionally
  • this issue is based on the current "next". On toc-implementatio-data-block there is no li64, but "ld(lwz) rt, r2(offset)", i.e. we use toc, in spite of li64. Avoiding "loads" from memory are also good to improve performance.
@gut
Copy link

gut commented Sep 13, 2016

Just a quick note: a branch (jcc vasm) is already sorted in a way that it's unlikely to branch.

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

No branches or pull requests

2 participants