Skip to content

Instantly share code, notes, and snippets.

View aarch64_amx.py
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@dougallj
dougallj / gist:9211fd24c3759f7f340dede28929c659
Last active Jan 13, 2020 — forked from zwegner/gist:6841688fa897aef64a11016967c36f2d
Ternary logic multiplication (0, 1, unknown)
View gist:9211fd24c3759f7f340dede28929c659
N_BITS = 8
MASK = (1 << N_BITS) - 1
class Ternary:
def __init__(self, ones, unknowns):
self.ones = ones & MASK
self.unknowns = unknowns & MASK
assert (self.ones & self.unknowns) == 0, (bin(self.ones), bin(self.unknowns))
def __add__(self, other):
@dougallj
dougallj / asm.s
Created Jan 3, 2018
x86-64 Speculative Execution Harness
View asm.s
global _time_load
global _cache_flush
global _run_attempt
extern _bools
extern _values
extern _pointers
section .text
@dougallj
dougallj / draw-patterns.c
Last active Jan 22, 2022
All distinct 4x4 patterns
View draw-patterns.c
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
#define WIDTH_IN_BLOCKS 29
#define HEIGHT_IN_BLOCKS 28
#define PADDING 4
#define BLOCK_WIDTH (4 * 4)
#define BLOCK_HEIGHT (4 * 4)