Base IACoreV2
Some checks failed
CI / build-linux-and-wasm (x64-linux) (push) Has been cancelled

This commit is contained in:
2026-01-22 05:54:26 +05:30
parent dedf28c6cb
commit 3ad1e3a2fb
57 changed files with 4398 additions and 4639 deletions

View File

@ -20,12 +20,12 @@ using namespace IACore;
IAT_BEGIN_BLOCK(Core, FloatVec4)
BOOL TestFloatArithmetic()
bool TestFloatArithmetic()
{
FloatVec4 v1(10.0f, 20.0f, 30.0f, 40.0f);
FloatVec4 v2(2.0f, 4.0f, 5.0f, 8.0f);
ALIGN(16) FLOAT32 res[4];
alignas(16) f32 res[4];
(v1 / v2).Store(res);
IAT_CHECK_APPROX(res[0], 5.0f);
@ -40,9 +40,9 @@ BOOL TestFloatArithmetic()
return TRUE;
}
BOOL TestMathHelpers()
bool TestMathHelpers()
{
ALIGN(16) FLOAT32 res[4];
alignas(16) f32 res[4];
FloatVec4 vSq(4.0f, 9.0f, 16.0f, 25.0f);
vSq.Sqrt().Store(res);
@ -63,9 +63,9 @@ BOOL TestMathHelpers()
return TRUE;
}
BOOL TestApproxMath()
bool TestApproxMath()
{
ALIGN(16) FLOAT32 res[4];
alignas(16) f32 res[4];
FloatVec4 v(16.0f, 25.0f, 100.0f, 1.0f);
v.Rsqrt().Store(res);
@ -76,16 +76,16 @@ BOOL TestApproxMath()
return TRUE;
}
BOOL TestLinearAlgebra()
bool TestLinearAlgebra()
{
FloatVec4 v1(1.0f, 2.0f, 3.0f, 4.0f);
FloatVec4 v2(1.0f, 0.0f, 1.0f, 0.0f);
FLOAT32 dot = v1.Dot(v2);
f32 dot = v1.Dot(v2);
IAT_CHECK_APPROX(dot, 4.0f);
FloatVec4 vNorm(10.0f, 0.0f, 0.0f, 0.0f);
ALIGN(16) FLOAT32 res[4];
alignas(16) f32 res[4];
vNorm.Normalize().Store(res);
IAT_CHECK_APPROX(res[0], 1.0f);

View File

@ -23,10 +23,10 @@ using namespace IACore;
IAT_BEGIN_BLOCK(Core, IntVec4)
BOOL TestConstructors()
bool TestConstructors()
{
IntVec4 vBroadcast(10);
ALIGN(16) UINT32 storeBuf[4];
alignas(16) u32 storeBuf[4];
vBroadcast.Store(storeBuf);
IAT_CHECK_EQ(storeBuf[0], 10U);
@ -37,7 +37,7 @@ BOOL TestConstructors()
IAT_CHECK_EQ(storeBuf[0], 1U);
IAT_CHECK_EQ(storeBuf[3], 4U);
ALIGN(16) UINT32 srcBuf[4] = {100, 200, 300, 400};
alignas(16) u32 srcBuf[4] = {100, 200, 300, 400};
IntVec4 vLoad = IntVec4::Load(srcBuf);
vLoad.Store(storeBuf);
IAT_CHECK_EQ(storeBuf[1], 200U);
@ -45,13 +45,13 @@ BOOL TestConstructors()
return TRUE;
}
BOOL TestArithmetic()
bool TestArithmetic()
{
IntVec4 v1(10, 20, 30, 40);
IntVec4 v2(1, 2, 3, 4);
IntVec4 vAdd = v1 + v2;
ALIGN(16) UINT32 res[4];
alignas(16) u32 res[4];
vAdd.Store(res);
IAT_CHECK_EQ(res[0], 11U);
IAT_CHECK_EQ(res[3], 44U);
@ -69,13 +69,13 @@ BOOL TestArithmetic()
return TRUE;
}
BOOL TestBitwise()
bool TestBitwise()
{
IntVec4 vAllOnes(0xFFFFFFFF);
IntVec4 vZero((UINT32) 0);
IntVec4 vZero((u32) 0);
IntVec4 vPattern(0xAAAAAAAA);
ALIGN(16) UINT32 res[4];
alignas(16) u32 res[4];
(vAllOnes & vPattern).Store(res);
IAT_CHECK_EQ(res[0], 0xAAAAAAAAU);
@ -100,13 +100,13 @@ BOOL TestBitwise()
return TRUE;
}
BOOL TestSaturation()
bool TestSaturation()
{
UINT32 max = 0xFFFFFFFF;
u32 max = 0xFFFFFFFF;
IntVec4 vHigh(max - 10);
IntVec4 vAdd(20);
ALIGN(16) UINT32 res[4];
alignas(16) u32 res[4];
vHigh.SatAdd(vAdd).Store(res);
IAT_CHECK_EQ(res[0], max);
@ -119,10 +119,10 @@ BOOL TestSaturation()
return TRUE;
}
BOOL TestAdvancedOps()
bool TestAdvancedOps()
{
IntVec4 v(0, 50, 100, 150);
ALIGN(16) UINT32 res[4];
alignas(16) u32 res[4];
v.Clamp(40, 110).Store(res);
IAT_CHECK_EQ(res[0], 40U);