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

Optimize mov() to output smaller sequence when possible #92

Open
andrewlow opened this issue Sep 24, 2013 · 3 comments
Open

Optimize mov() to output smaller sequence when possible #92

andrewlow opened this issue Sep 24, 2013 · 3 comments
Assignees

Comments

@andrewlow
Copy link
Collaborator

The current mov() implementation in 32bit looks something like this

lis     r8, 2146
ori     r8, r8, 38788

on 64bit it is 5 instructions

lis 3,0xdead
ori 3,3,48879
sldi 3,3,32
oris 3,3,0xfeed
ori 3,3,32918

For some constants (specifically those that do not need relocation) we can do better.

@ghost ghost assigned andrewlow Sep 24, 2013
@andrewlow
Copy link
Collaborator Author

Initial implementation doesn't appear to produce much difference in terms of performance

baseline:

$ ../out/ppc.release/d8 run.js
Richards: 6704
DeltaBlue: 8562
Crypto: 5987
RayTrace: 8189
EarleyBoyer: 16069
RegExp: 2383
Splay: 4603
NavierStokes: 7842
----
Score (version 7): 6664
-bash-4.1$ ../out/ppc.release/d8 run.js
Richards: 6683
DeltaBlue: 7121
Crypto: 5976
RayTrace: 8132
EarleyBoyer: 15795
RegExp: 2392
Splay: 4480
NavierStokes: 7749
----
Score (version 7): 6460
-bash-4.1$ ../out/ppc.release/d8 run.js
Richards: 6704
DeltaBlue: 8549
Crypto: 6210
RayTrace: 8189
EarleyBoyer: 16052
RegExp: 2432
Splay: 4477
NavierStokes: 6997
----
Score (version 7): 6592

With new mov()

$ ../out/ppc.release/d8 run.js
Richards: 6390
DeltaBlue: 8556
Crypto: 5915
RayTrace: 8066
EarleyBoyer: 16049
RegExp: 2409
Splay: 4689
NavierStokes: 8358
----
Score (version 7): 6677
-bash-4.1$ ../out/ppc.release/d8 run.js
Richards: 6651
DeltaBlue: 8549
Crypto: 5921
RayTrace: 8067
EarleyBoyer: 16049
RegExp: 2404
Splay: 4702
NavierStokes: 7998
----
Score (version 7): 6675
-bash-4.1$ ../out/ppc.release/d8 run.js
Richards: 5627
DeltaBlue: 8483
Crypto: 6194
RayTrace: 8149
EarleyBoyer: 16091
RegExp: 2400
Splay: 4726
NavierStokes: 7709
----
Score (version 7): 6550

@andrewlow
Copy link
Collaborator Author

Commit a4e0fda - I'm not sure we can optimize more with mov()

@andrewlow
Copy link
Collaborator Author

Leaving this open until 64bit has been optimized - my commit above only addresses 32bit

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

1 participant