This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <atlfile.h> | |
#include <intrin.h> | |
#include <array> | |
// These headers are from there: https://github.com/Const-me/IntelIntrinsics/tree/master/CppDemo/Intrinsics | |
#include "Intrinsics/avx.hpp" | |
#include "Intrinsics/avx2.hpp" | |
#include "Intrinsics/sse.hpp" | |
#include "Intrinsics/sse2.hpp" | |
using namespace Intrinsics::Avx; |