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
// float->sRGB8 conversions - two variants. | |
// by Fabian "ryg" Giesen | |
// | |
// I hereby place this code in the public domain. | |
// | |
// Both variants come with absolute error bounds and a reversibility and monotonicity | |
// guarantee (see test driver code below). They should pass D3D10 conformance testing | |
// (not that you can verify this, but still). They are verified against a clean reference | |
// implementation provided below, and the test driver checks all floats exhaustively. | |
// |
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
// float->half variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain, as per the terms of the | |
// CC0 license: | |
// | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// float_to_half_full: This is basically the ISPC stdlib code, except | |
// I preserve the sign of NaNs (any good reason not to?) |
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
// half->float variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain. | |
// | |
// half_to_float_fast: table based | |
// tables could be done in a more compact fashion (in particular, can store tab2 in low word of tab1!) | |
// but something of a dead end since not very SIMD-friendly. pretty much abandoned at this point. | |
// | |
// half_to_float_fast2: use FP adder hardware to deal with denormals. |
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
#ifdef _WIN32 | |
#include <malloc.h> | |
#endif | |
#include <cstdint> | |
#include <vector> | |
#include <iostream> | |
/** | |
* Allocator for aligned data. |
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
#!/usr/bin/env python3 | |
""" | |
Tests http mirrors of cygwin | |
""" | |
import random | |
import time | |
from urllib.request import urlopen | |
import sys | |
__author__ = 'Dmitry Sidorenko' |
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
// Fast SSE pow for range [0, 1] | |
// Adapted from C. Schlick with one more iteration each for exp(x) and ln(x) | |
// 8 muls, 5 adds, 1 rcp | |
inline __m128 _mm_fastpow_0_1_ps(__m128 x, __m128 y) | |
{ | |
static const __m128 fourOne = _mm_set1_ps(1.0f); | |
static const __m128 fourHalf = _mm_set1_ps(0.5f); | |
__m128 a = _mm_sub_ps(fourOne, y); | |
__m128 b = _mm_sub_ps(x, fourOne); |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist | |
# launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist | |
from twisted.internet import reactor, stdio, defer | |
from twisted.internet.protocol import Protocol, Factory | |
from twisted.protocols.basic import LineReceiver | |
import time, re, math, json |
NewerOlder