Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/testable-simd-models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow runs the tests for testable simd models.

name: Testable simd models

on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
paths:
- '.github/workflows/testable-simd-models.yml'
- 'testable-simd-models/**'

defaults:
run:
shell: bash

jobs:
testable-simd-models:
name: Test testable simd models
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Run tests
working-directory: testable-simd-models
run: cargo test -- --test-threads=1 --nocapture

10 changes: 0 additions & 10 deletions testable-simd-models/src/abstractions/bitvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ impl<const N: u32> BitVec<N> {
.map(int_from_bit_slice)
.collect()
}

/// Generate a random BitVec.
pub fn rand() -> Self {
use rand::prelude::*;
let random_source: Vec<_> = {
let mut rng = rand::rng();
(0..N).map(|_| rng.random::<bool>()).collect()
};
Self::from_fn(|i| random_source[i as usize].into())
}
}

impl<const N: u32> BitVec<N> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ pub fn psravd(a: i32x4, count: i32x4) -> i32x4 {
}

pub fn psravd256(a: i32x8, count: i32x8) -> i32x8 {
dbg!(a, count);
i32x8::from_fn(|i| {
if count[i] > 31 || count[i] < 0 {
if a[i] < 0 {
Expand Down
22 changes: 17 additions & 5 deletions testable-simd-models/src/core_arch/x86/tests/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ fn _mm256_movemask_ps() {
let a: BitVec<256> = BitVec::random();
assert_eq!(
super::super::models::avx::_mm256_movemask_ps(a.into()),
unsafe { upstream::_mm256_movemask_ps(a.into()) }
unsafe { upstream::_mm256_movemask_ps(a.into()) },
"Failed with input value: {:?}",
a
);
}
}
Expand All @@ -62,7 +64,9 @@ fn _mm256_movemask_pd() {
let a: BitVec<256> = BitVec::random();
assert_eq!(
super::super::models::avx::_mm256_movemask_pd(a.into()),
unsafe { upstream::_mm256_movemask_pd(a.into()) }
unsafe { upstream::_mm256_movemask_pd(a.into()) },
"Failed with input value: {:?}",
a
);
}
}
Expand All @@ -76,7 +80,10 @@ fn _mm256_testz_si256() {
let b: BitVec<256> = BitVec::random();
assert_eq!(
super::super::models::avx::_mm256_testz_si256(a.into(), b.into()),
unsafe { upstream::_mm256_testz_si256(a.into(), b.into()) }
unsafe { upstream::_mm256_testz_si256(a.into(), b.into()) },
"Failed with input values: {:?}, {:?}",
a,
b
);
}
}
Expand All @@ -90,7 +97,10 @@ fn _mm256_testc_si256() {
let b: BitVec<256> = BitVec::random();
assert_eq!(
super::super::models::avx::_mm256_testc_si256(a.into(), b.into()),
unsafe { upstream::_mm256_testc_si256(a.into(), b.into()) }
unsafe { upstream::_mm256_testc_si256(a.into(), b.into()) },
"Failed with input values: {:?}, {:?}",
a,
b
);
}
}
Expand All @@ -116,7 +126,9 @@ fn _mm256_cvtsi256_si32() {
let a: BitVec<256> = BitVec::random();
assert_eq!(
super::super::models::avx::_mm256_cvtsi256_si32(a.into()),
unsafe { upstream::_mm256_cvtsi256_si32(a.into()) }
unsafe { upstream::_mm256_cvtsi256_si32(a.into()) },
"Failed with input value: {:?}",
a
);
}
}
Expand Down
Loading
Loading