You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the generated asm code loads the same value into the same register multiple times.
The old Mathpresso (with an old AsmJit) version that I used before didn't do this:
Another thing - a combination of an unary operation ("-", sqrt, etc.) and a function call somehow makes it use xmm6, that apparently needs to be savied/restored:
The best would be to have an implementation of all trigo functions inlinable, and this can be addressed in MathPresso as well. I'm planning to address the multiple fetches of constants in MPSL, I'm not sure if it is worth the effort to address it in MathPresso as it doesn't have IR (MSPL has).
I'm marking this as wontfix, as this will be fixed in more advanced MPSL project. After MPSL is ready there will be an expression mode so it can replace mathpresso completely.
I noticed that the generated asm code loads the same value into the same register multiple times.
The old Mathpresso (with an old AsmJit) version that I used before didn't do this:
x = y =1
lea rax, [L2]
movsd xmm0, [rax]
movsd [rdx], xmm0
movsd xmm0, [rax]
movsd [rdx+8], xmm0
movsd xmm0, [rax]
movsd [rcx], xmm0
ret
Another thing - a combination of an unary operation ("-", sqrt, etc.) and a function call somehow makes it use xmm6, that apparently needs to be savied/restored:
-x / sin(y)
sub rsp, 72
movaps oword ptr [rsp+48], xmm6
xorpd xmm6, xmm6
subsd xmm6, [rdx]
...
movaps xmm6, oword ptr [rsp+48]
add rsp, 72
ret
The text was updated successfully, but these errors were encountered: