Skip to content

Instantly share code, notes, and snippets.

Konstantin Const-me

Block or report user

Report or block Const-me

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Const-me
Const-me / SimdBrightness-manual-invarients.cs
Created Nov 23, 2019
Manually propagated invariants, and fixed benchmarking code
View SimdBrightness-manual-invarients.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View brightness-3x.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View brightness-3x.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View brightness-second-time.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View brightness-manual-invariants.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View brightness-net-core.asm
00007FFE6C7D2103 vmovdqu xmm5,xmmword ptr [rcx]
00007FFE6C7D2107 vmovdqu xmm6,xmmword ptr [rcx+10h]
00007FFE6C7D210C vmovdqu xmm7,xmmword ptr [rcx+20h]
00007FFE6C7D2111 vmovdqu xmm8,xmmword ptr [rcx+30h]
00007FFE6C7D2116 vpand xmm9,xmm5,xmm0
00007FFE6C7D211A vpand xmm10,xmm6,xmm0
00007FFE6C7D211E vpackusdw xmm9,xmm9,xmm10
00007FFE6C7D2123 vpslldq xmm9,xmm9,1
00007FFE6C7D2129 vpand xmm10,xmm5,xmm1
00007FFE6C7D212D vpand xmm11,xmm6,xmm1
View brightness-vc2015.asm
{
VecInteger r, g, b;
loadRgb( src, r, g, b );
00007FF735AD11C0 vmovdqu xmm6,xmmword ptr [rcx-10h]
00007FF735AD11C5 vmovdqu xmm7,xmmword ptr [rcx-20h]
loadRgb( src + 2, r, g, b );
00007FF735AD11CA vmovdqu xmm9,xmmword ptr [rcx]
00007FF735AD11CE vmovdqu xmm8,xmmword ptr [rcx+10h]
@Const-me
Const-me / SimdBrightness.cs
Created Nov 21, 2019
.NET Core SSE Test, with static readonly constants
View SimdBrightness.cs
using System;
using System.Diagnostics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SimdBrightness
{
static class Program
{
/// <summary>Load 4 pixels of RGB</summary>
View MappedFileTest.cs
// Tested with .NET Core 2.2, will likely work with the rest of the runtimes
using System;
using System.Diagnostics;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Runtime.InteropServices;
namespace MappedFileTest
{
static class Program
View generic.cs
static class Utils
{
/// <summary>Append a new item to list, return that item</summary>
public static E appendNew<E>( List<E> list ) where E : new()
{
E newVal = new E();
list.Add( newVal );
return newVal;
}
}
You can’t perform that action at this time.