[spec] Fix extmul & extadd execution #1716
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At step 11 of the definition of extmul (below image), there is an expression$\text{imul}_{t_2 \times N}(k_1^*, k_2^*)$ .
First solution
I guess it should be$\text{imul}_{|t_2|} (k_1^*, k_2^*)$ .$\text{imul}$ , which is $t_2 \times N$ is typed wrong. From the definition of $\text{imul}$ , its argument should be an integer.
$k^*$ should be a sequence of length $N$ with its elements typed $t_2$ . So I think the argument should be $|t_2|$ .
$\text{iadd}_N(j_1, j_2)^*$ at step 6 should be $\text{iadd}_{|t_2|} (j_1, j_2)^*$ instead, and fixed the document.
The underscored argument of
Here, from line 12,
Same problem occurs in the definition of extadd (below image).
I think the expression
Second solution
Another solution (which I'm not so sure of) could be using the lane-wise applying notation.
$\text{lanes}_{t_2 \times N}^{-1}(\text{imul}_{t_2 \times N} (k_1^*, k_2^*))$ from extmul can be replaced by $\text{mul}_{t_2 \times N} (k_1^*, k_2^*)$ , and $\text{lanes}_{t_2 \times N}^{-1}(\text{iadd}_N(j_1, j_2)^*)$ from extadd by $\text{add}_{t_2 \times N}(j_1, j_2)^*$ .
With this notation,
I'm not sure about the second solution nor which one is better, so I applied the first one to the document for now.