This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def .L1_end :: [i32, i32]: | |
def .L2 :: [i32, i32] num_callers=1: | |
def .L3 :: [i32, i32] has_backwards_callers: | |
def .L3_end :: [i32, i32]: | |
def .L4 :: [i32, i32] num_callers=1: | |
.fn_0: | |
const 0i32 | |
const 1i32 | |
swap 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait DisplayField { | |
fn display_field(&self, field: u64, f: &mut fmt::Formatter); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; rdi = vmctx | |
mov [rsp + 0x20], rdi | |
; eax = callee_idx | |
mov eax, 0 | |
mov [rsp + 0x34], eax | |
mov rax, [rsp + 0x20] | |
; eax = vmctx->tables[table_idx].len | |
mov eax, [rax + 0x68] | |
; ecx = callee_idx | |
mov ecx, [rsp + 0x34] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::iter; | |
fn optimized_sieve(limit: usize) -> impl Iterator<Item = usize> { | |
let map_func = |cmpsts: Vec<u32>| { | |
move |i| { | |
if i < 0 { | |
Some(2) | |
} else { | |
if cmpsts[i as usize >> 5] & (1u32 << (i & 31)) == 0 { | |
Some((i + i + 3) as usize) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $t0 (func (param i32))) | |
(type $t1 (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32))) | |
(type $t2 (func (param i32 i32))) | |
(type $t3 (func (param i32) (result i32))) | |
(type $t4 (func (param i32 i32 i32))) | |
(type $t5 (func (param i32 i32) (result i32))) | |
(type $t6 (func (param i32 i32 i32) (result i32))) | |
(type $t7 (func (param f64) (result f64))) | |
(func $log2 (type $t7) (param $p0 f64) (result f64) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::iter::repeat; | |
fn aks_coefficients(k: usize) -> Vec<i64> { | |
let mut coefficients = vec![0; k + 1]; | |
coefficients[0] = 1; | |
for i in 1..(k + 1) { | |
coefficients[i] = -(1..i).fold(coefficients[0], |prev, j|{ | |
let old = coefficients[j]; | |
coefficients[j] = old - prev; | |
old |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use cranelift_codegen::ir::types; | |
use cranelift_codegen::{ir, isa}; | |
use cranelift_entity::PrimaryMap; | |
use cranelift_wasm::{DefinedFuncIndex, Global as WasmGlobal, GlobalInit}; | |
use hlist::{Cons, Here, Nil, There}; | |
use std::any::Any; | |
use std::cell::RefCell; | |
use std::collections::HashMap; | |
use std::marker::PhantomData; | |
use std::rc::Rc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Unless otherwise specified, all the different input/output bit sizes are needed. You might be able to write helpers to | |
-- make this easier. | |
adc | |
add | |
-- I'm sure you know this but just to make 100% certain: all of the `***ss`/`***sd` instructions operate on IEEE754 | |
-- floats and so need to use separate Low IR actions to the integer operations. Futhermore, `div` has signed and unsigned | |
-- integer variants, plus single- and double-precision float variants. So that might look like `DivIntS(NumBits)`, | |
-- `DivIntU(NumBits)` and `DivFloat(FloatSize)` where `FloatSize` is an enum of `Single`,`Double`. | |
addsd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fn::61800aab { .. } -> { Output0 }: | |
%87fc4ed5: { Sine, Saw, Square } = Synth { | |
$Freq = 0.5Hz, | |
} | |
return { | |
Output0 = %87fc4ed5->Saw, | |
} | |
def fn::bbd34d0d { .. } -> { Output0 }: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
borrow::{Borrow, ToOwned}, | |
marker::PhantomData, | |
ops::{Deref, Drop}, | |
ptr::{self, NonNull}, | |
}; | |
pub unsafe trait Cursed<T: ?Sized>: Borrow<T> + Sized { | |
fn borrowed(borowed: &T) -> Option<NonNull<T>>; | |
fn owned(self) -> Option<NonNull<T>>; |