fix accidental mutation in vec binary ops

This commit is contained in:
Matthew 2026-01-09 20:27:38 +11:00
parent 9f70b8982c
commit 246e7006f5

16
math.d
View File

@ -249,19 +249,19 @@ struct Vector(T, int N)
asm
{
mov R8, l;
mov R9, r;
mov R10, res;
mov R8, l;
mov R9, r;
mov R10, res;
movups XMM0, x.offsetof[R8];
movups XMM1, other.x.offsetof[R9];
}
static if(op == "*") asm { mulps XMM0, XMM1; }
else static if(op == "-") asm { subps XMM0, XMM1; }
else static if(op == "+") asm { addps XMM0, XMM1; }
else static if(op == "/") asm { divps XMM0, XMM1; }
static if(op == "*") asm { mulps XMM0, XMM1; }
else static if(op == "-") asm { subps XMM0, XMM1; }
else static if(op == "+") asm { addps XMM0, XMM1; }
else static if(op == "/") asm { divps XMM0, XMM1; }
asm
{
movups result.x.offsetof[R8], XMM0;
movups result.x.offsetof[R10], XMM0;
}
return result;