Skip to content

Instantly share code, notes, and snippets.

View xen0n's full-sized avatar

WÁNG Xuěruì xen0n

View GitHub Profile
@xen0n
xen0n / test-page-delta.cc
Created July 25, 2023 12:11
The verification code behind LLD's getLoongArchPageDelta
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// Ever wondered how the wicked logic in https://github.com/llvm/llvm-project/blob/6084ee742064cf8/lld/ELF/Arch/LoongArch.cpp#L86-L169
// got discovered? This is the experiment I've done...
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <unistd.h>
@xen0n
xen0n / linux-xor-simd-test.c
Created July 21, 2023 12:57
Sketching LoongArch SIMD acceleration for Linux XOR ops
// SPDX-License-Identifier: GPL-2.0-or-later
/*
$ gcc -O3 -o linux-xor-simd-test linux-xor-simd-test.c
$ ./linux-xor-simd-test
ref (size=4096 ) passed 16383 times: 0.005044150 s total, 0.000000307 s per pass, 12687.191 MiB/s
lsx_32b (size=4096 ) passed 16383 times: 0.002663250 s total, 0.000000162 s per pass, 24029.323 MiB/s
lsx_64b (size=4096 ) passed 16383 times: 0.002517970 s total, 0.000000153 s per pass, 25415.749 MiB/s
lsx_128b (size=4096 ) passed 16383 times: 0.002517590 s total, 0.000000153 s per pass, 25419.585 MiB/s
lasx_32b (size=4096 ) passed 16383 times: 0.001935550 s total, 0.000000118 s per pass, 33063.519 MiB/s
@xen0n
xen0n / check-new-world.tiny.s
Last active March 29, 2024 10:12
Tiny helper checking for LoongArch new world UAPI
# SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#
# how to build this:
#
# $ as -o check-new-world.tiny.o check-new-world.tiny.s
# $ ld check-new-world.tiny.o -o check-new-world.tiny.tmp
# $ objcopy -O binary --only-section=.blob ./check-new-world.tiny.tmp ./check-new-world.tiny
.section ".blob", "aw", @progbits
@xen0n
xen0n / gopherchina-2023-loong64.md
Last active June 9, 2023 12:30
GopherChina 2023: loong64 presentation

GOARCH=loong64: past, present and future

Who am I? What's LoongArch?

Me:

  • Linux/LoongArch port reviewer
@xen0n
xen0n / happy.go
Last active June 3, 2022 06:15
Welcome back to the office!
package main
import (
"fmt"
"strings"
)
func main() {
x, y, z := "7️⃣🐮", "🎁👜🔰🎥🧋🌔🌽🧐🧄🍓🔆📌💜🦔🍻🌲", "🍨🚙🚱🥹📏🐋🧱💈🧯🐕💱🍜"
#
# Automatically generated file; DO NOT EDIT.
# Linux/mips 4.7.0-ck1 Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@xen0n
xen0n / make-dist.log
Created December 19, 2016 17:50
Log of `make dist` after build triple filtering
Finished debug [unoptimized] target(s) in 0.0 secs
Synchronizing submodule url for 'src/compiler-rt'
Synchronizing submodule url for 'src/jemalloc'
Synchronizing submodule url for 'src/liblibc'
Synchronizing submodule url for 'src/llvm'
Synchronizing submodule url for 'src/rt/hoedown'
Synchronizing submodule url for 'src/rust-installer'
HEAD is now at a8fc4c1 Merge pull request #28 from xen0n/preprocessor-firefighting
HEAD is now at e058ca6 Change how the default zone is found
HEAD is now at 0ac39c5 Auto merge of #462 - semarie:openbsd-i686-correct, r=alexcrichton
@xen0n
xen0n / 0001-add-uksm-patch-ported-for-v4.5.patch
Created June 6, 2016 08:29
[EXPERIMENTAL] UKSM ported to Linux 4.5
From 3e9afc3a63c3126ee55df341547319ee4a8ac498 Mon Sep 17 00:00:00 2001
From: Wang Xuerui <idontknw.wang@gmail.com>
Date: Mon, 6 Jun 2016 16:20:23 +0800
Subject: [PATCH] add uksm patch ported for v4.5
---
Documentation/vm/00-INDEX | 2 +
Documentation/vm/uksm.txt | 59 +
fs/exec.c | 4 +-
fs/proc/meminfo.c | 6 +
@xen0n
xen0n / error.log
Created May 21, 2016 19:19
rust testsuite failures @ 91e9073
failures:
---- [run-pass] run-pass/issue-28950.rs stdout ----
error: test run failed!
status: signal: 11
command: /home/xenon/code/rust/build/x86_64-unknown-linux-gnu/test/run-pass/issue-28950.stage2-x86_64-unknown-linux-gnu
stdout:
------------------------------------------
@xen0n
xen0n / bootlogo-minami-kotori.patch
Last active August 29, 2015 14:05
Love Live for Linux
--- a/drivers/video/logo/logo_linux_clut224.ppm 2014-06-09 02:19:54.000000000 +0800
+++ b/drivers/video/logo/logo_linux_clut224.ppm 2014-08-21 20:07:31.729230596 +0800
@@ -1,5 +1,5 @@
P3
-# Standard 224-color Linux logo
+# 224-color Minami Kotori bootup logo for Linux
80 80
255
0 0 0 0 0 0 0 0 0 0 0 0
@@ -11,8 +11,6 @@