Skip to content

Commit

Permalink
silly part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alion02 committed Dec 2, 2024
1 parent 89dd17c commit 64f2409
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![feature(portable_simd)]

use std::{
arch::x86_64::_mm256_i32gather_epi32, fs::read_to_string, hint::black_box, simd::prelude::*,
arch::x86_64::{_mm256_i32gather_epi32, _mm256_loadu_si256},
fs::read_to_string,
hint::black_box,
simd::prelude::*,
};

use aocopt::day2::{part1, part2};
Expand All @@ -27,12 +30,7 @@ use criterion::{criterion_group, criterion_main, Criterion};
pub fn silly(c: &mut Criterion) {
let a = [0; 256].as_slice().as_ptr();
c.bench_function("thing", |b| {
b.iter(|| unsafe {
_mm256_i32gather_epi32::<1>(
black_box(a),
u32x8::from_array([0, 4, 8, 12, 16, 20, 24, 28]).into(),
)
})
b.iter(|| unsafe { _mm256_loadu_si256(black_box(a as _)) })
});
}

Expand Down

0 comments on commit 64f2409

Please sign in to comment.