Skip to content

Instantly share code, notes, and snippets.

View deplinenoise's full-sized avatar

Andreas Fredriksson deplinenoise

View GitHub Profile
@deplinenoise
deplinenoise / build-gcc-toolchain.sh
Created June 5, 2016 19:15
Build m68k-unknown-elf toolchain into subdir of PWD on Mac, relies on brew for GCC dependencies
#! /usr/bin/env bash
echo Building GCC m68k toolchain...
mkdir -p sources
mkdir -p build
CORES=8
TARGET=m68k-unknown-elf
PREFIX=$PWD/m68k-unknown-elf
@deplinenoise
deplinenoise / double-round-to-float
Created July 9, 2019 06:37
Round double to float hardware-matching precision for default SSE rounding mode
constexpr uint64_t mask(int i)
{
return (1ull << i) - 1;
}
float Round1(double tmp)
{
uint64_t i;
memcpy(&i, &tmp, sizeof i);