Skip to content

Commit 75c1707

Browse files
quaternictgross35
authored andcommitted
add icount benchmarks for u256 Sub and Shl
1 parent a322da6 commit 75c1707

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

libm-test/benches/icount.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,22 @@ fn icount_bench_u256_add(cases: Vec<(u256, u256)>) {
119119
}
120120
}
121121

122+
#[library_benchmark]
123+
#[bench::linspace(setup_u256_add())]
124+
fn icount_bench_u256_sub(cases: Vec<(u256, u256)>) {
125+
for (x, y) in cases.iter().copied() {
126+
black_box(black_box(x) - black_box(y));
127+
}
128+
}
129+
130+
#[library_benchmark]
131+
#[bench::linspace(setup_u256_shift())]
132+
fn icount_bench_u256_shl(cases: Vec<(u256, u32)>) {
133+
for (x, y) in cases.iter().copied() {
134+
black_box(black_box(x) << black_box(y));
135+
}
136+
}
137+
122138
#[library_benchmark]
123139
#[bench::linspace(setup_u256_shift())]
124140
fn icount_bench_u256_shr(cases: Vec<(u256, u32)>) {
@@ -129,7 +145,7 @@ fn icount_bench_u256_shr(cases: Vec<(u256, u32)>) {
129145

130146
library_benchmark_group!(
131147
name = icount_bench_u128_group;
132-
benchmarks = icount_bench_u128_widen_mul, icount_bench_u256_add, icount_bench_u256_shr
148+
benchmarks = icount_bench_u128_widen_mul, icount_bench_u256_add, icount_bench_u256_sub, icount_bench_u256_shl, icount_bench_u256_shr
133149
);
134150

135151
#[library_benchmark]

0 commit comments

Comments
 (0)