Skip to content

Instantly share code, notes, and snippets.

$ ghc -Odph -rtsopts -threaded -fno-liberate-case -funbox-strict-fields -funfolding-keeness-factor1000 -fllvm -optlo-O3 -fexpose-all-unfoldings -fsimpl-tick-factor=500 -ddump-simpl -dsuppress-all zip-columns.hs > z.hs
@leventov
leventov / blur-core.hs
Last active December 12, 2015 06:38
blur.hs: inlining issue. Search `$wa2` in blur-core.hs to see details. See http://stackoverflow.com/questions/14748900/ghc-doesnt-perform-2-stage-partial-application-inlining
[1 of 1] Compiling Main ( blur.hs, blur.o )
==================== Simplified expression ====================
quoteExp
dim2St
(unpackCString#
" 2 4 5 4 2\
\ 4 9 12 9 4\
\ 5 12 15 12 5\
\ 4 9 12 9 4\
@leventov
leventov / minmax.c
Last active December 10, 2015 18:48
-- minmax.h
float max_ss(float a, float b);
float min_ss(float a, float b);
double max_sd(double a, double b);
double min_sd(double a, double b);
float clamp_ss(float x, float mn, float mx);
double clamp_sd(double x, double mn, double mx);
@leventov
leventov / bios.s
Created December 13, 2011 21:56
lab4: protected mode with paging
.arch pentium4
.code16
.section .text
.org 0x100
_gdt: .quad 0
.byte 0xFF, 0xFF, 0, 0, 0xF, 0b10011010, 0b00001111, 0 # код
.byte 0xFF, 0xFF, 0, 0, 0xF, 0b10010000, 0b00001111, 0 # данные
.byte 0x00, 0x80, 0,0x80, 0xB, 0b10010010, 0b00000000, 0 # видео