adv-accept-3: shadow and base multiply counts in the static properties
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
3160ea5b19
commit
e967cdefe1
2 changed files with 11 additions and 2 deletions
|
|
@ -140,6 +140,10 @@ struct Props {
|
|||
lossy_base: u32,
|
||||
/// longest dependency path through one shadow pass (256 instructions)
|
||||
shadow_pass_depth: u32,
|
||||
/// multiplies (mul, mulhi, mad) in the shadow block (of 256), the fixed-datapath chip's dearest op
|
||||
shadow_muls: u32,
|
||||
/// multiplies (mul, mulhi, mad) in the base program (of 48 non-load ops)
|
||||
base_muls: u32,
|
||||
}
|
||||
|
||||
/// Dependency depth over a sequence of instructions, carrying per-register (alu depth, load depth). `shfl` reads
|
||||
|
|
@ -211,9 +215,14 @@ fn props(p: &Program) -> Props {
|
|||
last[i.dst as usize] = Some(i.op);
|
||||
}
|
||||
let lossy_last_writes = last.iter().filter(|o| matches!(o, Some(Op::Or | Op::Mul | Op::MulHi))).count() as u32;
|
||||
let is_mul = |o: Op| matches!(o, Op::Mul | Op::MulHi | Op::Mad);
|
||||
let shadow_muls = p.shadow.iter().filter(|i| is_mul(i.op)).count() as u32;
|
||||
let base_muls = p.instrs.iter().filter(|i| is_mul(i.op)).count() as u32;
|
||||
Props {
|
||||
cp_loads,
|
||||
cp_alu,
|
||||
shadow_muls,
|
||||
base_muls,
|
||||
predictable_sites_it0: pred_it0,
|
||||
opmix_chi2_milli: (chi2 * 1000.0) as u32,
|
||||
opmix_max_pct: if nonload > 0 { maxc * 100 / nonload } else { 0 },
|
||||
|
|
@ -224,11 +233,11 @@ fn props(p: &Program) -> Props {
|
|||
}
|
||||
|
||||
fn props_header() -> &'static str {
|
||||
"cp_loads\tcp_alu\tpred_it0\tchi2_milli\topmax_pct\tlossy_last\tlossy_base\tshadow_depth"
|
||||
"cp_loads\tcp_alu\tpred_it0\tchi2_milli\topmax_pct\tlossy_last\tlossy_base\tshadow_depth\tshadow_muls\tbase_muls"
|
||||
}
|
||||
|
||||
fn props_row(q: &Props) -> String {
|
||||
format!("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}", q.cp_loads, q.cp_alu, q.predictable_sites_it0, q.opmix_chi2_milli, q.opmix_max_pct, q.lossy_last_writes, q.lossy_base, q.shadow_pass_depth)
|
||||
format!("{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}", q.cp_loads, q.cp_alu, q.predictable_sites_it0, q.opmix_chi2_milli, q.opmix_max_pct, q.lossy_last_writes, q.lossy_base, q.shadow_pass_depth, q.shadow_muls, q.base_muls)
|
||||
}
|
||||
|
||||
fn reject_part(r: &Reject) -> &'static str {
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue