mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Start of SIMD support
This commit is contained in:
parent
73e260c1d5
commit
64b62c09be
30 changed files with 5846 additions and 5096 deletions
26
IDEHelper/Tests/src/Numerics.bf
Normal file
26
IDEHelper/Tests/src/Numerics.bf
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Numerics
|
||||
{
|
||||
[Test, UseLLVM]
|
||||
public static void TestBasics()
|
||||
{
|
||||
float4 v0 = .(1, 2, 3, 4);
|
||||
float4 v1 = .(10, 100, 1000, 10000);
|
||||
|
||||
float4 v2 = v0 * v1;
|
||||
Test.Assert(v2 === .(10, 200, 3000, 40000));
|
||||
Test.Assert(v2 !== .(10, 200, 3000, 9));
|
||||
Test.Assert(v2.x == 10);
|
||||
Test.Assert(v2.y == 200);
|
||||
Test.Assert(v2.z == 3000);
|
||||
Test.Assert(v2.w == 40000);
|
||||
|
||||
float4 v3 = v0.wzyx;
|
||||
Test.Assert(v3 === .(4, 3, 2, 1));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue