Skip to content

Instantly share code, notes, and snippets.

View Terminus-IMRC's full-sized avatar
💭
Doing nothing helpful

Yukimasa Sugizaki Terminus-IMRC

💭
Doing nothing helpful
View GitHub Profile
@satmandu
satmandu / make_current_arm64_rpi_kernel_debs.sh
Last active September 25, 2024 03:44
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels, tested with ubuntu 23.04
#!/bin/bash -x
# make_arm64_rpi_kernel_debs.sh
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by:
# sudo rpi-update
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Appears to work on
@tnishinaga
tnishinaga / README.md
Created December 9, 2019 19:10
OpenOCD config for Raspberry Pi 4

OpenOCD config for Raspberry Pi 4

OpenOCD version

0.10.0+dev-00865-g04ebb43f

How to use

openocd -f interface/YOUR_INTERFACE_CONFIG -f raspi4.cfg

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@shuuji3
shuuji3 / cannon.py
Last active July 1, 2019 10:07 — forked from Terminus-IMRC/cannon.py
Matrix-matrix multiplication: Cannon's algorithm
#!/usr/bin/env python3
import numpy as np
# Assume that P = N * N.
N = 4
A = np.arange(0, 2 * N * N, 2).reshape(N, N)
B = np.arange(1, 2 * N * N, 2).reshape(N, N)
C_gt = A.dot(B)
@Ishotihadus
Ishotihadus / atr.md
Last active July 10, 2025 05:40
ATR503文元ネタ集

ATR 音素バランス 503 文元ネタ集

判明している音素バランス文の元ネタを集めた。

Subset A

a01: あらゆる現実をすべて自分のほうへねじ曲げたのだ。

「マルサの女 撮影日記」(伊丹十三)(文藝春秋 1987 年 2 月)(c03、g01 と同一)

/*
* clzero の後にstoreするとmemsetよりはるかに悪くなる
*
* * clzeroのみ :30[GB/s]
* * clzero + ストア :3[GB/s]
* * memset :12.5[GB/s]
*/
void *amd_clzero(void *dst, const void *src, size_t sz)
{
size_t line_size = 64;
@wakita
wakita / Makefile
Last active July 21, 2023 08:53
Metal compute shader example
SDK = xcrun -sdk macosx
all: compute.metallib compute
compute.metallib: Compute.metal
# Metal intermediate representation (.air)
$(SDK) metal -c -Wall -Wextra -std=osx-metal2.0 -o /tmp/Compute.air $^
# Metal library (.metallib)
$(SDK) metallib -o $@ /tmp/Compute.air
@pixelomer
pixelomer / mkjail.sh
Last active March 13, 2025 09:33
Create a macOS chroot jail with GNU bash and utilities
#!/usr/bin/env sh
#############################################
# WARNING #
# No more commits are going to be made to #
# this gist. Please get the latest script #
# from the new repository: #
# https://github.com/pixelomer/macos-mkjail #
#############################################
@bennuttall
bennuttall / juliasets.jl
Last active September 28, 2018 15:49
Rich Wareham's Julia set code
# Copyright (c) 2017: Rich Wareham, Simon Byrne
# Available under the MIT "Expat" license.
using Colors
using SenseHat
const LED = led_matrix()
function julia(z, c)
maxit = 50
// public domain
//
// benchmark @ 3.5 GHz (i5-4690) Intel Core i5:
//
// 1,709,401,709 points/sec w/AVX2 + FMA
// 1,373,390,557 points/sec w/AVX2
// 382,043,935 points/sec w/o AVX2
//
#include <cstdio>
#include <cstdint>