You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
196
196
only 100 inputs are generated.
197
197
2.`_mm256_bsrli_epi128`: This is the name of the intrinsic being tested, and is necessary in all cases.
198
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
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);`
200
+
We can confirm this by looking at the implementation and spotting the `static_assert_uimm_bits!(IMM8, 8);`
201
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
202
value of the constant argument.
203
203
4.`(a: BitVec)`: This part contains all the arguments of the intrinsic and their types.
204
204
205
-
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. You can see examples in the test files.
205
+
This summarizes the steps needed to use the `mk!` macro to generate a test. There is a caveat: 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. You can see examples in the test files.
207
207
208
208
209
209
210
210
## Contributing Models
211
211
212
212
To contribute new models of intrinsics, we expect the author to follow
213
213
the above steps and provide comprehensive tests. It is important that
214
-
the model author look carefully at both the Intel/ARM specification
214
+
the model author looks carefully at both the Intel/ARM specifications
215
215
and the Rust `stdarch` implementation, because they may look quite different
0 commit comments