Skip to content

Commit d7b9025

Browse files
readme edtis
1 parent 27819eb commit d7b9025

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

testable-simd-models/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,21 @@ similar to the upstream code in `core::arch`.
190190
and that generated by the intrinsic in upstream `core::arch`. A valid test of the intrinsic above looks like this.
191191
```rust
192192
mk!([100]_mm256_bsrli_epi128{<0>,<1>,<2>,<3>,...,<255>}(a: BitVec));
193-
// i. ii. iii. iv.
194193
```
195194
The macro invocation has four parts.
196-
1. By default the macro tests for a thousand randomly generated inputs. If needed, this can be modified, such as here, where the `[100]` is used so that
195+
1. `mk!([100]...`: By default the macro tests for a thousand randomly generated inputs. If needed, this can be modified, such as here, where the `[100]` is used so that
197196
only 100 inputs are generated.
198-
2. This is the name of the intrinsic being tested, and is necessary in all cases.
199-
3. This is relevant because of the constant `IMM8` argument used by the intrinsic. We can gleam from the name the constant argument is supposed
200-
to be at most 8 bits wide. We can confirm this by looking at the `core::arch` implementation, and spotting the `static_assert_uimm_bits!(IMM8, 8);`
201-
line, which asserts the constant argument fits in at most 8 bits. Thus, we add `{<0>,<1>,<2>,<3>,...,<255>}` to test for each possible constant
202-
value of the constant argument. If the intrinsic does not have a constant argument, then this part must be ignored.
203-
4. This signifies the arguments that the intrinsics take, and is also necessary.
197+
2. `_mm256_bsrli_epi128`: This is the name of the intrinsic being tested, and is necessary in all cases.
198+
3. `{<0>,<1>,<2>,<3>,...,<255>}`: This part only appears when the intrinsic has a const generic argument, like the `IMM8` in this intrinsic.
199+
As the name indicates, this constant argument is supposed to be at most 8 bits wide.
200+
We can confirm this by looking at the implementation, and spotting the `static_assert_uimm_bits!(IMM8, 8);`
201+
line, which asserts that constant argument is positive and fits in 8 bits. Thus, we add `{<0>,<1>,<2>,<3>,...,<255>}` to test for each possible constant
202+
value of the constant argument.
203+
4. `(a: BitVec)`: This part contains all the arguments of the intrinsic and their types.
204204

205205
This surmises the steps needed to use the `mk!` macro to generate a test. There is a caveat however. In the case that the output of an intrinsic is _not_
206-
a bit-vector (and is instead say, an integer like `i32`), then the macro will not work, and a manual test has to be written.
207-
206+
a bit-vector (and is instead say, an integer like `i32`), then the macro will not work, and a manual test has to be written. You can see examples in the test files.
207+
208208

209209

210210
## Contributing Models

0 commit comments

Comments
 (0)