Skip to content

Instantly share code, notes, and snippets.

// Output created by jacc on Sun Apr 07 22:44:19 COT 2019
package travisdowns.github.io;
class RegexParser extends ParserBase implements RegexTokens {
private int yyss = 100;
private int yytok;
private int yysp = 0;
private int[] yyst;
protected int yyerrno = (-1);
An example of an allowed outcome not explained solely by StoreLoad reordering (i.e., could not occur on
a system with a total store order and only StoreLoad reordering).
all memory initially zero
thread 1:
mov [x], 1
mov a, [x]
mov b, [y]
package com.example.scrap;
import java.util.ArrayList;
import java.util.stream.Collectors;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
public class DecodeSim {
Results of HSW vs SKL decode tests, for different patterns of multi-byte nops.
Tests run with:
./uarch-bench.sh --timer=libpfc --test-name=misc/decode* --extra-events=inst_retired,lsd.uops,idq.dsb_uops,idq.mite_uops --precision=3
Haswell (i7-4770) Results:
** Running group misc : Miscellaneous tests **
Benchmark Cycles INST_R LSD:UO IDQ:DS IDQ:MI
==========================================================================
== Memory bandwidth tests ==
== ==
== Note 1: 1MB = 1000000 bytes ==
== Note 2: Results for 'copy' tests show how many bytes can be ==
== copied per second (adding together read and writen ==
== bytes would have provided twice higher numbers) ==
== Note 3: 2-pass copy means that we are using a small temporary buffer ==
== to first fetch data into it, and only then write it to the ==
== destination (source -> L1 cache, L1 cache -> destination) ==
#!/bin/bash
LINUX=linux-4.19.5
set -e
set -x
if [ -z "$THREADS" ]; then
echo "set THREADS to the number of compilation threads"
exit 1
#!/bin/bash
sudo apt update
sudo apt-get install -y build-essential unzip
git clone https://github.com/inikep/lzbench
cd lzbench
curl http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip > silesia.zip
@travisdowns
travisdowns / dry.sh
Last active November 27, 2018 22:51
setup EC2 for development
git clone https://github.com/Keith-S-Thompson/dhrystone
cd dhrystone/v2.2
CFLAGS=-O3 sh dry.c
./dry2
// file Base.java
public class Base {
final void print() { System.out.println("base"); };
}
// file Derived.java
public class Derived extends Base {
@Override
void print() {
System.out.println("derived");
/* https://stackoverflow.com/questions/20697215/when-should-we-use-prefetch */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/timeb.h>
#include <emmintrin.h>
#define MIB (1024 * 1024)
#define ELEM int