riscv-v-spec icon indicating copy to clipboard operation
riscv-v-spec copied to clipboard

Use a3 for widening multiply in ch6.4

Open sunshaoce opened this issue 2 years ago • 2 comments
trafficstars

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 avatar Jun 15 '23 15:06 sunshaoce

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.

aswaterman avatar Jun 15 '23 15:06 aswaterman

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!

sunshaoce avatar Jun 15 '23 15:06 sunshaoce