Skip to content

Instantly share code, notes, and snippets.

@shilrobot
shilrobot / HexDumper.cs
Created April 28, 2013 03:41
C# hex dumper
using System.Text;
namespace Whatever
{
public static class HexDumper
{
public static string HexDump(byte[] data)
{
var sb = new StringBuilder();
Color4 Lerp(Color4 a, Color4 b, float t)
{
// nice branchless SIMD color lerp
__m128 one = _mm_set1_ps(1);
__m128 t4 = _mm_set1_ps(t);
t4 = _mm_max_ps(t4, _mm_setzero_ps());
t4 = _mm_min_ps(t4, one);
@shilrobot
shilrobot / ssebug.cpp
Last active March 14, 2017 16:19
On Release x64 on VC++ 2015 update 3 this doesn't work, on Debug x64/x86 this works just fine... >:|
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "emmintrin.h"
struct Color4
{
uint8_t red;
uint8_t green;