Skip to content

Instantly share code, notes, and snippets.

View merryhime's full-sized avatar

merry merryhime

  • UK
  • 01:35 (UTC +01:00)
View GitHub Profile
"ClangFormat2": {
"format_on_save": true,
},
// This file is part of the smolcc project
// SPDX-License-Identifier: MIT
#pragma once
#include <memory>
#include <type_traits>
namespace detail {
#include <cstdio>
class A {
public:
A() = default;
static void OverridableInit() {
std::printf("I am in A\n");
}
case Type::LowShelf:
if(gain >= 0) {
n = 1 / (1 + k / q + k * k);
a0 = (1 + sqrt(v) / q * k + v * k * k) * n;
a1 = 2 * (v * k * k - 1) * n;
a2 = (1 - sqrt(v) / q * k + v * k * k) * n;
b1 = 2 * (k * k - 1) * n;
b2 = (1 - k / q + k * k) * n;
} else {
n = 1 / (1 + sqrt(v) / q * k + v * k * k);
import math
import numpy
import matplotlib.pyplot as plt
def IdealH(f):
T = 1. / 441000. # we use the tenfold sampling frequency
OmegaU = 1. / 15e-6
OmegaL = 15. / 50. * OmegaU
# Calculate filter coefficients
V0 = OmegaL / OmegaU
import math
import numpy
import matplotlib.pyplot as plt
def IdealH(f):
T = 1. / 441000. # we use the tenfold sampling frequency
OmegaU = 1. / 15e-6
OmegaL = 15. / 50. * OmegaU
# Calculate filter coefficients
void ADR(Imm<2> immlo, Imm<19> immhi, Reg Rd);
void ADRP(Imm<2> immlo, Imm<19> immhi, Reg Rd);
void ADD_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd);
void ADDS_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd);
void SUB_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd);
void SUBS_addsub_imm(bool sf, Imm<2> shift, Imm<12> imm12, Reg Rn, Reg Rd);
void AND_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd);
void ORR_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd);
void EOR_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd);
void ANDS_log_imm(bool sf, bool N, Imm<6> immr, Imm<6> imms, Reg Rn, Reg Rd);
ld1 {v4.s}[1], [x7], #4
fadd v1.2s, v1.2s, v3.2s
sshll v2.4s, v2.4h, #0
sshll v3.4s, v3.4h, #0
fmul v3.2s, v4.2s, v3.s[0]
fcvtzs w12, s0, #0xf
fsqrt s0, s0
frinta s0, s0
fmax d1, d1, d2
fmin d8, d0, d2
@merryhime
merryhime / coro.md
Created July 10, 2017 15:17
Personal Notes on the Coroutines TS
std::uint32_t duplicate(std::uint32_t o) {
return ((o & 0x80808080) >> 7) * 0xFF;
}
# compiler suggestion:
duplicate(unsigned int):
shr edi, 7
and edi, 16843009
mov eax, edi
shl eax, 8