Skip to content

Instantly share code, notes, and snippets.

View geoff-nixon's full-sized avatar

Geoff Nixon geoff-nixon

View GitHub Profile
@geoff-nixon
geoff-nixon / MacOSXInstaller.choiceChanges
Created April 10, 2013 09:23
MacOSXInstaller.choiceChanges
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
@geoff-nixon
geoff-nixon / killmybattery.command
Created August 4, 2013 08:56
LLVM-based battery life test.
#!/bin/bash -vx
killall Finder
export PATH=$PWD/install/bin:$PWD/usr/bin:$PWD/usr/sbin:$PATH
export CC=clang
export CXX=clang++
export MAKEFFLAGS=$(sysctl -n hw.availcpu)
export CFLAGS='-O4 -fslp-vectorize -fslp-vectorize-aggressive -march=native '
export CFLAGS+='-DNDEBUG -g0 -mmacosx-version-min=10.8 -Qunused-arguments'
export CXXFLAGS="$CFLAGS -std=c++11 -stdlib=libc++"
@geoff-nixon
geoff-nixon / clang-errors.log
Created August 18, 2013 12:19
gmp 5.1.2 test suite errors: clang -O4/-flto/-emit-llvm
> make check -i
... (abridged) ...
Making check in tests
==================
All 9 tests passed
==================
Making check in mpn
===================
@geoff-nixon
geoff-nixon / icc-errors.log
Created August 18, 2013 12:21
gmp 5.1.2 test suite errors: icc -fast/-ipo
> make check -i
... (abridged) ...
Making check in tests
==================
All 9 tests passed
==================
Making check in mpn
===================
All 43 tests passed
@geoff-nixon
geoff-nixon / clang-warnings.log
Created August 18, 2013 12:24
gmp 5.1.2: clang (all warnings)
> make; make check -i
... (abridged) ...
gen-trialdivtab.c:149:3: warning: Value stored to 'interval_start' is never read
interval_start = start_p;
^ ~~~~~~~
gen-trialdivtab.c:150:3: warning: Value stored to 'interval_end' is never read
interval_end = 0;
^ ~
@geoff-nixon
geoff-nixon / gmp-5.1.2-analysis.txz.txt
Created August 18, 2013 12:26
gmp 5.1.2: clang static analysis results (base64, txz)
/Td6WFoAAATm1rRGAgAhARwAAAAQz1jM85eq8ABdADObSmMD7pgmuVgyf1pD4VNO
q9O81HCPQYkB950E5oagrgpp2yDskTpHtfl8+jgEYabSBKpbN8aCs5la1+63IJXD
NPz/HqTYyV17gEQBKg7Q3nB8cSn0fCOPK/HgSNXGM8lAiadDLoml+U4ROsgSwypu
y4zPaNrI+uVQmhRqEhfkwkFVey+wuayFbdDT0M/R+ooLtoMYu7m/rtPWrJOZb4rU
IUqKCYh53qJHirVqvRXcNpAmRPY0E2LPymWcwUo7c6ZXY/wJzuCm6RqG69rXLNm6
VlK8aePpfsT6HmW7BDvEJL8FMYeMo+hvBo+FnNgq3fjwcopMPapomCBo11VgL0uV
GbJ8Qo8PXZW3k1HS/Iv32umc7q8wQJ/9OR5PRaC2VeO7LHkY3YzSqbCibMkPnDJm
qHVWHFOH7ThfJDUGtCxzyLUoT9cDSEbTTSrn8Ml5ZYzpOFAYTBZERxcv1+sVoNtt
LsXpWMJaBNxwmyUn0oSZz2zDsv4/fc8TbibqHJ9+zBbN2dWHWbJ/OKwszDkamwR1
mYyQ+0ynGIn70Ye/iJvUbm+kryZFp+A3kqFbhYJXwg6/SsdrRArEIxrpg1xs19H5
@geoff-nixon
geoff-nixon / t-get_d_2exp.i.c
Created August 18, 2013 12:30
gmp 5.1.2: tests/mpz/t-get_d_2exp intermediate file (clang -flto -save-temps)
#1 "t-get_d_2exp.c"
#1 "<built-in>" 1
#1 "<built-in>" 3
#166 "<built-in>" 3
#1 "<command line>" 1
#1 "<built-in>" 2
#1 "t-get_d_2exp.c" 2
#20 "t-get_d_2exp.c"
#1 "/usr/include/stdio.h" 1 3 4
#64 "/usr/include/stdio.h" 3 4
@geoff-nixon
geoff-nixon / t-get_d_2exp.o.ll
Created August 18, 2013 12:33
gmp 5.1.2: tests/mpz/t-get_d_2exp.o LLVM IR (clang -O4/-flto/-emit-llvm)
; ModuleID = 't-get_d_2exp.o'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"
%struct.__gmp_randstate_struct = type { [1 x %struct.__mpz_struct], i32, %union.anon }
%struct.__mpz_struct = type { i32, i32, i64* }
%union.anon = type { i8* }
@mp_trace_base = external global i32 ; [#uses=1 type=i32*]
@__gmp_rands_initialized = external global i8 ; [#uses=2 type=i8*]
@geoff-nixon
geoff-nixon / t-get_d_2exp.patch
Created August 18, 2013 12:37
gmp 5.1.2: superficial patch to correct LTO / IPO in tests.
Index: tests/mpz/t-get_d_2exp.c
==============================================================================
--- tests/mpz/t-get_d_2exp.c
+++ tests/mpz/t-get_d_2exp.c
@@ -127,0 +128 @@
+ got == 1 ? got = got / 2, mpz_add_ui (z, z, 1) : got;
@@ -141,0 +143 @@
+ got == -1 ? got = got / 2, mpz_sub_ui (z, z, 1) : got;
Index: tests/mpf/t-get_d_2exp.c
==============================================================================
#!/bin/bash
# Fallback base64 en-/decoder for systems that lack a native implementation
#
# @param ... - flags
which base64 &>/dev/null || {
# if even od is missing
which od &>/dev/null || od()
{
local C O=0 W=16