Good evening,
how is the assigment of equal types solved in FPC interally?
I'm working on the DirectX Math unit and the assigment of Matrix or Vectors looks e.q. like this
inline XMFLOAT4X3& XMFLOAT4X3::operator=
(
const XMFLOAT4X3& Float4x3
)
{
XMVECTOR V1 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._11);
XMVECTOR V2 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._22);
XMVECTOR V3 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._33);
XMStoreFloat4((XMFLOAT4*)&_11, V1);
XMStoreFloat4((XMFLOAT4*)&_22, V2);
XMStoreFloat4((XMFLOAT4*)&_33, V3);
return *this;
}
The XMLoadFloat4 and XMStoreFloat4 are using SSE/AVX op codes, so should be very fast.
But if I define a assigment operator like this:
operator := (a : TXMFLOAT4X3) b : TXMFLOAT4X3;
I get the error message: Impossible to overload assignment for equal types.
So my question is: how is the assigment handeld in FPC internally? MemCopy? which should be slower then SSE ops I think.
And is it possible to do that overload somehow. C++ can handle this, so I think Pascal can do this also
class operator Implicit or Explicit also dont work.
thx