Skip to content

Instantly share code, notes, and snippets.

View linsinan1995's full-sized avatar
🌛
Have a good sleep

sinan linsinan1995

🌛
Have a good sleep
View GitHub Profile
@linsinan1995
linsinan1995 / decbnez.patch
Last active September 9, 2021 12:13
decbnez
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 7eff85b7ea..b0559f9612 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -4414,6 +4414,8 @@ number for the SBIC, SBIS, SBI and CBI instructions */
BFD_RELOC_RISCV_SET16,
BFD_RELOC_RISCV_SET32,
BFD_RELOC_RISCV_32_PCREL,
+ BFD_RELOC_RISCV_DECBNEZ,
+ BFD_RELOC_RISCV_C_DECBNEZ,
@linsinan1995
linsinan1995 / README-opcode-generator.md
Last active March 15, 2021 23:36
A tool used for easing the pain of adding opcode and mask to risc-v binutils. See gen_opcode.py

Intro

A tool used for easing the pain of adding opcode and mask to risc-v binutils. Other example, see gen_opcode.py and gen_kadd.py.

Usage

from gen_opcode import *

# init instruction
kadd8 = Inst("kadd8")
@linsinan1995
linsinan1995 / benchmark.h
Last active January 7, 2021 23:19
easy benchmark template and example
// simple framework for timing, feel free to modify it.
#include <chrono>
#include <thread>
#include <iostream>
template <typename Type = std::chrono::milliseconds> class Timer;
template <typename Type = std::chrono::milliseconds> class scope_timer;
using timer_sec_t = Timer<std::chrono::seconds>;