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
View vfprintf.cpp
template <template <typename, typename> class Base, typename Character>
static int __cdecl common_vfprintf(
unsigned __int64 const options,
FILE* const stream,
Character const* const format,
_locale_t const locale,
va_list const arglist
) throw()
{
typedef output_processor<
View vrcpps-errors.cpp
#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;
@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>
You can’t perform that action at this time.