Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arithmic/word address #412

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ pub const BYTES_PER_INSTRUCTION: usize = 4;
pub const REG_OPS_PER_INSTRUCTION: usize = 3;
pub const RAM_OPS_PER_INSTRUCTION: usize = 4;
pub const MEMORY_OPS_PER_INSTRUCTION: usize = REG_OPS_PER_INSTRUCTION + RAM_OPS_PER_INSTRUCTION;
pub const BYTES_PER_WORD: usize = 4; // denotes the number of bytes in a word
pub const RAM_WORD_OPS_PER_INSTRUCTION: usize = 1;

pub const RAM_START_ADDRESS: u64 = 0x80000000;
pub const DEFAULT_MEMORY_SIZE: u64 = 10 * 1024 * 1024;
Expand Down
47 changes: 47 additions & 0 deletions common/src/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,50 @@ macro_rules! par_join_8 {
)
}};
}

#[macro_export]
macro_rules! par_join_10 {
(
$task1:expr,
$task2:expr,
$task3:expr,
$task4:expr,
$task5:expr,
$task6:expr,
$task7:expr,
$task8:expr,
$task9:expr,
$task10:expr
) => {
{
let (
(((result1, result2), (result3, result4)), ((result5, result6), (result7, result8))),
(result9, result10)
) = rayon::join(
|| {
rayon::join(
|| {
rayon::join(
|| rayon::join($task1, $task2),
|| rayon::join($task3, $task4),
)
},
|| {
rayon::join(
|| rayon::join($task5, $task6),
|| rayon::join($task7, $task8),
)
},
)
},

|| {
rayon::join($task9, $task10)
},
);
(
result1, result2, result3, result4, result5, result6, result7, result8, result9, result10
)
}
};
}
Loading