Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions csharp/Platform.Collections.Benchmarks/BitStringBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,29 @@ public void Setup()

[Benchmark]
public BitString ParallelVectorXor() => new BitString(_left).ParallelVectorXor(_right);

[Benchmark]
public BitString IntrinsicsNot() => new BitString(_left).IntrinsicsNot();

[Benchmark]
public BitString ParallelIntrinsicsNot() => new BitString(_left).ParallelIntrinsicsNot();

[Benchmark]
public BitString IntrinsicsAnd() => new BitString(_left).IntrinsicsAnd(_right);

[Benchmark]
public BitString ParallelIntrinsicsAnd() => new BitString(_left).ParallelIntrinsicsAnd(_right);

[Benchmark]
public BitString IntrinsicsOr() => new BitString(_left).IntrinsicsOr(_right);

[Benchmark]
public BitString ParallelIntrinsicsOr() => new BitString(_left).ParallelIntrinsicsOr(_right);

[Benchmark]
public BitString IntrinsicsXor() => new BitString(_left).IntrinsicsXor(_right);

[Benchmark]
public BitString ParallelIntrinsicsXor() => new BitString(_left).ParallelIntrinsicsXor(_right);
}
}
80 changes: 80 additions & 0 deletions csharp/Platform.Collections.Tests/BitStringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,86 @@ public static void BitParallelVectorXorTest()
w.Xor(v);
});
}

[Fact]
public static void BitIntrinsicsNotTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.IntrinsicsNot();
w.Not();
});
}

[Fact]
public static void BitParallelIntrinsicsNotTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.ParallelIntrinsicsNot();
w.Not();
});
}

[Fact]
public static void BitIntrinsicsAndTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.IntrinsicsAnd(y);
w.And(v);
});
}

[Fact]
public static void BitParallelIntrinsicsAndTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.ParallelIntrinsicsAnd(y);
w.And(v);
});
}

[Fact]
public static void BitIntrinsicsOrTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.IntrinsicsOr(y);
w.Or(v);
});
}

[Fact]
public static void BitParallelIntrinsicsOrTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.ParallelIntrinsicsOr(y);
w.Or(v);
});
}

[Fact]
public static void BitIntrinsicsXorTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.IntrinsicsXor(y);
w.Xor(v);
});
}

[Fact]
public static void BitParallelIntrinsicsXorTest()
{
TestToOperationsWithSameMeaning((x, y, w, v) =>
{
x.ParallelIntrinsicsXor(y);
w.Xor(v);
});
}
private static void TestToOperationsWithSameMeaning(Action<BitString, BitString, BitString, BitString> test)
{
const int n = 5654;
Expand Down
Loading
Loading