Skip to content

Instantly share code, notes, and snippets.

View eloj's full-sized avatar

Eddy L O Jansson eloj

View GitHub Profile
@rygorous
rygorous / simd_multigetbits.cpp
Created February 3, 2023 08:37
Multigetbits, the second
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <smmintrin.h>
#ifdef __RADAVX__
#include <immintrin.h>
#endif
@Marc-B-Reynolds
Marc-B-Reynolds / output.md
Last active August 28, 2023 10:07
brute force testing of 1/sqrt functions
click for range breakdown

checking on [3f800000,40000000] [1.000000e+00,2.000000e+00]

func e max ULP CR FR 2 ULP > 2 ULP CR% FR% 2 ULP% > 2 ULP%
vrsqrte_f32 -- 4947968 103 225 216 8388065 0.001228 0.002682 0.002575 99.993515
FRSR_Mon0 -- 564177 3 8 6 8388592 0.000036 0.000095 0.000072 99.999797
FRSR_Deg0 -- 403258 0 0 0 8388609 0.000000 0.000000 0.000000 100.000000
FRSR_Mon1 -- 14751 230 464 466 8387449 0.002742 0.005531 0.005555 99.986172
@aras-p
aras-p / gist:5088284
Last active December 14, 2015 12:39
GfxDevice source sizes
Platform specific GfxDevice implementation source code size in Unity:
Direct3D 9 342k
Direct3D 11 446k, 146k of which fixed function emulation ;)
Flash Stage3D 147k
OpenGL 303k
OpenGL ES 1.1 140k
OpenGL ES 2.0 308k
PS3 libGCM 279k
Xbox 360 225k
@mpolak
mpolak / JNI.cpp
Created October 10, 2011 06:41
Proper method to create jstrings from Native Strings
/*
http://java.sun.com/docs/books/jni/html/other.html
8.2.1 Creating jstrings from Native Strings
*/
jstring JNI::JNU_NewStringNative(JNIEnv *env, const char *str)
{
jstring result;
jbyteArray bytes = 0;
int len;