Skip to content

Instantly share code, notes, and snippets.

View ttsiodras's full-sized avatar
💭
while True: hack()

Thanassis Tsiodras ttsiodras

💭
while True: hack()
View GitHub Profile
@ttsiodras
ttsiodras / gist:91203d875188884100258454ccd5de0c
Created July 18, 2022 20:36
Summary of uiCA results for "or eax,eax" replaced with "test eax,eax".
$ head -8 analysis_report_or.txt| tail -3 ; for i in analysis_report_* ; do echo $i ; tail -3 $i ; done
...
┌───────────────────────┬────────┬───────┬─────────────────────────────────────────────────────┬───────┐
│ MITE MS DSB LSD │ Issued │ Exec. │ Port 0 Port 1 Port 2 Port 3 Port 4 Port 5 │ Notes │
├───────────────────────┼────────┼───────┼─────────────────────────────────────────────────────┼───────┤
analysis_report_or.txt
├───────────────────────┼────────┼───────┼─────────────────────────────────────────────────────┼───────┤
│ 33 │ 33 │ 29 │ 9 9 11 │ │ Total
└───────────────────────┴────────┴───────┴─────────────────────────────────────────────────────┴───────┘
analysis_report_test.txt
@ttsiodras
ttsiodras / gist:e82c9d26f64e4c919bf6b34a033ed4fe
Created July 18, 2022 20:17
uiCA experiments on my mandelbrot
ttsiod@mbair ~/Github/uiCA
(master)*$ as mandel.asm -o mandel.o
ttsiod@mbair ~/Github/uiCA
(master)*$ ./uiCA.py mandel.o
Throughput (in cycles per iteration): 12.00 - 15.07
- 12.00 on BDW
- 14.00 on HSW, IVB, SNB
- 14.50 on CLX
.intel_syntax noprefix
l1:
vmulpd ymm2,ymm0,ymm1
vmulpd ymm0,ymm0,ymm0
vmulpd ymm1,ymm1,ymm1
vaddpd ymm4,ymm0,ymm1
vsubpd ymm0,ymm0,ymm1
vaddpd ymm0,ymm0,ymm6
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sched.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <x86intrin.h>
#define LEN 1000000
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sched.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <x86intrin.h>
#define LEN 1000000
@ttsiodras
ttsiodras / alioth.md
Last active September 29, 2021 12:44
History building alioth LineageOS

Commands I issued:

cd android/lineage/
repo init -u https://github.com/LineageOS/android.git -b lineage-18.1
repo sync
source build/envsetup.sh
breakfast alioth
# intermission, to extract firmware files from latest LineageOS image into ~/android/system_dump/
find . -name extract-files.sh

cd device/xiaomi/alioth/

#!/bin/bash
#
# Commenting on https://www.youtube.com/watch?v=Qiu0jlsp3ws
# Much faster than the original, using bash arrays, as Brock wanted to do this initially.
# Also avoids using hardcoded numbers (takes the number of students from the array length)
#
# $ time ./students_brock.sh
#
# real 0m0.170s
# user 0m0.170s
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\renewcommand*{\namefont}{\fontsize{24}{26}\mdseries\upshape}
\usepackage{fancybox}
\usepackage{mdwlist}
\usepackage[scale=0.75]{geometry}
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
\firstname{John}
\familyname{Doe}
@ttsiodras
ttsiodras / gist:c3e71b0db07ec2ca5a3d236fa6e98589
Last active March 4, 2024 01:56
List of RTEMS APIs used by uPython codebase
$ find py/ leon-common/ extmod/ -type f -iname '*.[ch]' -exec grep -ow 'rtems_[a-zA-Z0-9_-]*' '{}' ';' | sort -u | grep -v _obj
rtems_attribute
rtems_build_name
rtems_clock_get
rtems_clock_time_value
rtems_id
rtems_interval
rtems_message_queue_broadcast
rtems_message_queue_create
@ttsiodras
ttsiodras / monkeyIslandData.h
Last active September 19, 2020 14:23
Monkey Island songs - frequencies and durations.
/////////////////////////////////////////////////////////////////////////////
//
// I designed a small circuit playing the Monkey Island songs via a buzzer
// and an Arduino pro mini:
//
// https://www.youtube.com/watch?v=9FKhpKlKFoc
//
// I first collected the song data by hacking the source code of DOSBOX,
// and playing the game a bit while gathering the frequencies...
//