Seems I found a better solution hidden in the docs:
@nogc protected int[2] transformFunc(int[2] xy){
version(X86){
asm @nogc{
naked;
mov EBX, this;
movdXMM1, sX[EBX];
pslldq XMM1, 4;
movss XMM1, sY[EBX];
On Thursday, 5 April 2018 at 04:48:02 UTC, Basile B. wrote:
The "this" seems to be in R11, so you have to apply the asm
syntax for accessing the members using
.offsetof.[R11], example:
```
class Foo
{
double a = 123456;
extern(D) double foo()
{
asm
{
On Thursday, 5 April 2018 at 04:48:02 UTC, Basile B. wrote:
On Wednesday, 4 April 2018 at 21:00:44 UTC, solidstate1991
wrote:
void main()
{
import std.stdio;
(new Foo).foo(0,0).writeln;
}
```
Ah sorry, the params must be removed ((new Foo).foo().writeln;)...
I was actually trying to
On Wednesday, 4 April 2018 at 21:00:44 UTC, solidstate1991 wrote:
I have this code:
asm @nogc{
movqXMM0, xy;
paddd XMM0, sXY; // xy + sXY
movqXMM3, xy0;
psubd XMM0, XMM3; // xy + sXY - x0y0
movq
I forgot to tell, that xy0 ac, and bd are local to the class.
I have this code:
asm @nogc{
movqXMM0, xy;
paddd XMM0, sXY; // xy + sXY
movqXMM3, xy0;
psubd XMM0, XMM3; // xy + sXY - x0y0
movqXMM1, ac;
movqXMM2, bd;
pmuludq