Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Use a3 for widening multiply in ch6.4 #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunshaoce
Copy link

This change makes the assembly code more clear and consistent, as x10 (a0) is already used to hold the total number of elements to process, while a3 is an argument register in the function calling convention that is suitable for the multiplier. This way, the programmer can easily understand the source and purpose of the multiplier for the widening multiplication.

@aswaterman
Copy link
Collaborator

aswaterman commented Jun 15, 2023

I agree x10 needs to be replaced with another register, but a3 is already used to hold the current vector length in this loop. You'd need to change all existing uses of a3 to e.g. t0 for this to work.

This change makes the assembly code more clear and consistent, as x10 (a0) is already used to hold the total number of elements to process, while a3 is an argument register in the function calling convention that is suitable for the multiplier. This way, the programmer can easily understand the source and purpose of the multiplier for the widening multiplication.
@sunshaoce
Copy link
Author

I agree x10 needs to be replaced with another register, but a3 is already used to hold the current vector length in this loop. You'd need to change all existing uses of a3 to e.g. t0 for this to work.

Addressed. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants