Skip to content

Instantly share code, notes, and snippets.

View boot_alpha.sh
#! /bin/sh
# Kudos to https://gmplib.org/~tege/qemu.html
sim=qemu-system-alpha
$sim -smp 4 -m 1024 \
-nographic -serial null -monitor null \
-kernel vmlinux \
-drive file=disk.img,if=virtio,media=disk,format=raw,index=0 \
-nic user,model=virtio,hostfwd=tcp::12345-:22 \
View .zshrc
# History.
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HISTSIZE=50000
SAVEHIST=10000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt inc_append_history
setopt share_history
View rust-src.patch
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 90d24d20737..e3cf7001eba 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -68,7 +68,7 @@ extern "C" void LLVMInitializePasses() {
extern "C" void LLVMTimeTraceProfilerInitialize() {
#if LLVM_VERSION_GE(9, 0)
- timeTraceProfilerInitialize();
+ timeTraceProfilerInitialize(0, "");
View dsymutil.patch
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 2801178c605..277abd5dc3a 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -552,7 +552,7 @@ int main(int argc, char **argv) {
const bool Verify = Options.Verify && !Options.LinkOpts.NoOutput;
SmallVector<MachOUtils::ArchAndFile, 4> TempFiles;
- std::atomic_char AllOK(1);
+ std::atomic<int> AllOK(1);
View config.toml
[llvm]
ninja = true
targets = "RISCV;X86"
[build]
host = ["x86_64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu"]
target = ["riscv64gc-unknown-linux-gnu"]
View openbsd.c
#include <ctype.h>
#include <stdio.h>
int openbsd_check(const char* line) {
if (isdigit((int)*line) && *(line + 1) == '.' &&
isdigit((int)*line+2) && *(line + 3) == '.' &&
isdigit((int)*line+4) && isspace((int)*(line + 5)))
return 1;
else
return 0;
View better_69225.rs
fn do_test(x: usize) {
let arr = vec![vec![0u8; 3]];
let mut z = vec![0];
for arr_ref in arr {
for y in 0..x {
for _ in 0..1 {
z.reserve_exact(x);
let iterator = std::iter::repeat(0).take(x);
let mut cnt = 0;
View main.ll
; ModuleID = 'main.7rcbfp3g-cgu.2'
source_filename = "main.7rcbfp3g-cgu.2"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%"alloc::vec::Vec<i32>" = type { [0 x i64], { i32*, i64 }, [0 x i64], i64, [0 x i64] }
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
@vtable.0.llvm.14851218111650171626 = external hidden unnamed_addr constant { void (i8**)*, i64, i64, i32 (i8**)*, i32 (i8**)*, i32 (i8**)* }, align 8
View bad_codegen.rs
fn do_test(x: usize) {
let arr = vec![vec![0u8; 3]];
let mut z = Vec::new();
for arr_ref in arr {
for y in 0..x {
for _ in 0..1 {
z.extend(std::iter::repeat(0).take(x));
let a = y * x;
let b = (y + 1) * x - 1;
@dfyz
dfyz / bench.txt
Last active Aug 5, 2019
DEC Alpha GCC vs. Clang benchmark
View bench.txt
**************
*** X86_64 ***
**************
~/alpha-test-programs/fib $ time echo 40 | ./a.out
102334155
102334155
real 0m0.661s
user 0m0.658s
You can’t perform that action at this time.