Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm instructions for long multiplication #481

Merged
merged 4 commits into from
Jun 21, 2023
Merged

Arm instructions for long multiplication #481

merged 4 commits into from
Jun 21, 2023

Conversation

Slukoo
Copy link
Collaborator

@Slukoo Slukoo commented Jun 16, 2023

Added UMLAL, SMULL, SMLAL, SMMUL & SMMULR instructions.

@Slukoo Slukoo linked an issue Jun 16, 2023 that may be closed by this pull request
4 tasks
@Slukoo Slukoo added the arm Related to the arm port label Jun 16, 2023
Copy link
Contributor

@bgregoir bgregoir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thank a lot for this PR.
I have a small general remark:
it seems that you frequently use the same sequence of code:
let lo := zero_extend U32 res in
let hi := zero_extend U32 (wshr res 32) in
Can you introduce some intermediate function to do that (in word.v)
Maybe it can be implemented using other pattern (split_word? I do not remember the name).

A more problematic remark:

I think that the semantic of the instructions are wrong.
Most of then should compute (x * y + (u : v))
The general pattern you use in
(l,h) = x * y
(u+l, h + v)
I think this is incorrect because the carry that can occurs in u + l is not propagated to the high part.

eclib/JModel_m4.ec Outdated Show resolved Hide resolved
proofs/compiler/arm_instr_decl.v Outdated Show resolved Hide resolved
proofs/compiler/arm_instr_decl.v Outdated Show resolved Hide resolved
proofs/compiler/arm_instr_decl.v Outdated Show resolved Hide resolved
@Slukoo
Copy link
Collaborator Author

Slukoo commented Jun 19, 2023

Thank you for your help, I tried addressing the issues you were pointing out. Please tell me if there are still some things to improve/correct

Copy link
Contributor

@bgregoir bgregoir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank for all the changes. I think it is ok now.

@bgregoir bgregoir merged commit c9c694c into main Jun 21, 2023
1 check passed
@bgregoir bgregoir deleted the arm-instructions branch June 21, 2023 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Related to the arm port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ARM Cortex M4 instructions for long multiplication
3 participants