8000 simd: optional shuffle configuration to save move instructions by recp · Pull Request #42 · recp/cglm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

simd: optional shuffle configuration to save move instructions #42

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

Merged
merged 4 commits into from
May 10, 2018

Conversation

recp
Copy link
Owner
@recp recp commented Apr 4, 2018

We can save some move instructions for 'shuffling on single vector' by using pshufd instead of shufps

There are some discussions about bypass delay, I made it optional. If using integer domain for shuffling is not desired then it can be disabled by this macro: CGLM_USE_INT_DOMAIN

As default it is not defined so this option is disabled. If user want to save instructions then defining this macro like this before cglm header (or global) would be enough:

#define CGLM_USE_INT_DOMAIN

#include <cglm/cglm.h>

FWIW, I am using https://godbolt.org for comparing instructions. Saved instructions after enabling CGLM_USE_INT_DOMAIN :

                            before               after                 save
mat4_mul:                   68                   56                    12
mat4_mulv:                  16                   13                    3
glm_mat4_inv_sse2:         112                  108                    4

It still needs to be tested, in the future we may make this enabled as default.

@recp recp mentioned this pull request Apr 4, 2018
@recp recp added this to the v0.4.5 milestone May 10, 2018
@coveralls
Copy link
coveralls commented May 10, 2018

Coverage Status

Coverage remained the same at 15.305% when pulling 599524d on optimizations into 48d33c1 on master.

@recp recp force-pushed the optimizations branch from c85ed58 to 599524d Compare May 10, 2018 13:42
@recp recp merged commit 077e304 into master May 10, 2018
@recp recp deleted the optimizations branch May 10, 2018 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0