-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
mat2x3: fix multiplication functions #403
Conversation
74232c4
to
ca389f1
Compare
Hi @EasyIP2023 , Thanks for fixing it. I had forgotten them :( float a00 = m1[0][0], a10 = m1[1][0],
a01 = m1[0][1], a11 = m1[1][1],
a02 = m1[0][2], a12 = m1[1][2], You are accessing memory randomly which is not desired in cglm. Compiler may optimize it but compilers may not have same capabilities Desired access: float a00 = m1[0][0], a01 = m1[0][1], a02 = m1[0][2],
a10 = m1[1][0], a11 = m1[1][1], a12 = m1[1][2]
Cache locality is important even compiler may do this for us, given hint is desired style. Same for setting dest[0][0] = ...
dest[0][1] = ...
dest[1][0] = ...
dest[1][1] = ... Thanks |
@recp Now it makes perfect since why. Okay Changing now! Do you think I should also do the same in Or would assigning variables then do math take longer then accessing elements randomly and do math? |
ca389f1
to
8f6f568
Compare
Just read other message will remove |
I'm not sure if there is a benefit to move vector on stack but not matrix, access both on array or both on stack I think but not sure. Probably compiler will do the job but asm output can be compared. Coding style: Declare first then init pls. ( except array init, const init ) float v0 = v[0], v1 = v[1]; to float v0, v1;
v0 = v[0];
v1 = v[1]; for similar places...
No, _mulv remain exist just waiting existence of _vmul. |
8f6f568
to
6aed774
Compare
lol Meant |
6aed774
to
79129d9
Compare
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This also includes tables to explain how mat2x3, column vectors and row vectors are represented. Also includes how resulting matrix or vector is formed. Signed-off-by: Vincent Davis Jr <vince@underview.tech>
79129d9
to
c5dcb93
Compare
This branch should be all cleaned up and ready for another review now. |
@EasyIP2023 many thanks, the PR is merged 🚀 |
EDIT:
This seems better fit existing code style, especially reading items from matrices, vectors... My actual intention was more general. Maybe variables that are not reading func params. |
Believe this is what we want. Per issue: #385
TODO: