This file contains 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
#[macro_export] | |
macro_rules! signal_build { | |
($name:expr, $shape:expr, $reset:expr, $reset_less:expr) => { | |
Signal::signal($name, Shape::from($shape), $reset, $reset_less) | |
}; | |
} | |
#[macro_export(local_inner_macros)] | |
macro_rules! signal_collect { | |
(($_:expr, $shape:expr, $reset:expr, $reset_less:expr) name: $name:expr, $($k:ident: $v:expr,)*) => { |
This file contains 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
example::test: | |
push rax | |
cmp rsi, 50 | |
jbe .LBB23_1 | |
mov eax, dword ptr [rdx] | |
mov dword ptr [rdi], eax | |
mov eax, dword ptr [rdx + 4] | |
mov dword ptr [rdi + 4], eax | |
mov eax, dword ptr [rdx + 8] | |
mov dword ptr [rdi + 8], eax |
This file contains 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
beagle_bros_test::poke: | |
cmp rsi, 60 | |
jbe LBB29_8 | |
movups xmm0, xmmword, ptr, [rdx, +, 64] | |
movups xmmword, ptr, [rdi], xmm0 | |
cmp dword, ptr, [rdx], 1 | |
jne LBB29_2 | |
mov byte, ptr, [rdi, +, 16], 1 | |
mov rax, qword, ptr, [rdx, +, 8] | |
mov qword, ptr, [rdi, +, 17], rax |
This file contains 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
In no particular order: | |
Space Master - I Need You (Master Mix) https://www.youtube.com/watch?v=Qg0VjVXVoXk | |
Afrika Bambaataa - Feeling Irie https://www.youtube.com/watch?v=z2VdfIA7N7o | |
House Pimps - Zulu Nation https://www.youtube.com/watch?v=zrXnzJ0Mn0E | |
The Badman Presents N.D.X. - Come With Me https://www.youtube.com/watch?v=EUDW_LWbtQM | |
Tainted Two - The Megablast https://www.youtube.com/watch?v=oHd8Sk-7WIU | |
Digital Domain - I Need Relief https://www.youtube.com/watch?v=zrXnzJ0Mn0E | |
Problem house - Party people https://www.youtube.com/watch?v=MNQitcvJKlw | |
DJ Hype - Shot in The Dark (Q Bass Remix) https://www.youtube.com/watch?v=0O40o6RvoH8 | |
Mig-29 - Mig-29 (Love Mix) https://www.youtube.com/watch?v=4oqqMbmIhkQ |
This file contains 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 proc_macro2::{Span, TokenStream}; | |
use quote::quote; | |
use syn::{ | |
fold::Fold, | |
parse::{Parse, ParseStream, Result}, | |
parse_quote, | |
punctuated::Punctuated, | |
Expr, ExprLit, FieldValue, Ident, ItemFn, LitStr, Local, Member, Pat, Stmt, Token, | |
}; |
This file contains 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
#[cfg_attr(feature = "capture", derive(Serialize))] | |
#[cfg_attr(feature = "replay", derive(Deserialize))] | |
#[derive(Debug, Clone, Eq, PartialEq, Hash)] | |
pub struct ImageKey { | |
pub common: PrimKeyCommonData, | |
pub key: ApiImageKey, | |
pub stretch_size: SizeKey, | |
pub tile_spacing: SizeKey, | |
pub color: ColorU, | |
pub sub_rect: Option<DeviceIntRect>, |
This file contains 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
// Type your code here, or load an example. | |
#[cfg(target_arch = "x86")] | |
use std::arch::x86::__m128; | |
#[cfg(target_arch = "x86_64")] | |
use std::arch::x86_64::__m128; | |
#[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "sse2"))] | |
pub struct Ray { | |
pub pt: __m128, | |
pub dir: __m128, |
This file contains 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
pub fn hit_zip(aabb: &Aabb, r: &Ray, t_min: f32, t_max: f32) -> bool { | |
r.direction | |
.iter() | |
.zip( | |
r.point | |
.iter() | |
.zip(aabb.min.iter().zip(aabb.max.iter())), | |
).all(|(d, (p, (min, max)))| { | |
let inv_d = 1. / d; | |
let t0 = (min - p) * inv_d; |
This file contains 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
#include <Vtop.h> | |
extern "C" { | |
// CONSTRUCTORS | |
Vtop* | |
top_new() { | |
return new Vtop(); | |
} | |
void |
This file contains 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
// Samples are delta-encoded | |
pub fn unpack_sample<T: Default + ops::AddAssign + Clone>(input: &[u8]) | |
-> Result<Vec<T>, &'static str> { | |
if input.len() % mem::size_of::<T>() != 0 { | |
return Err("packed sample data is not aligned"); | |
} | |
let packed_sample: &[T] = unsafe { | |
slice::from_raw_parts(input.as_ptr() as *const T, | |
input.len() / mem::size_of::<T>()) |