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. 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
197
196
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.
204
204
205
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.
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.
0 commit comments