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

Allow riscv-codegen to generate executable mul instruction without RV32M #56

Closed
wants to merge 2 commits into from

Conversation

oucs638
Copy link

@oucs638 oucs638 commented Jul 31, 2022

Add new compiler option +m/-m as the switch to take whether m extension or not.
Check the global variable "use_m_ext" before riscv-codegen going to call __mul()/__div()/__mod().
If there is no m extension, replace __mul()/__div()/__mod() with __addi(zero, zero, 0) as the no operation in riscv.

Add new compiler option +m/-m as the switch to take whether m extension
or not.
Check the global variable "riscv_m_extension" before riscv-codegen going
to call __mul()/__div()/__mod().
If there is no m extension, replace __mul()/__div()/__mod() with
__addi(zero, zero, 0) as the no operation in riscv.
Replace riscv_m_extension with use_m_ext.
Update tests/driver.sh.
@jserv jserv requested a review from eecheng87 August 1, 2022 02:47
@eecheng87
Copy link
Collaborator

Please remove generated file mul_test

@@ -0,0 +1,9 @@
#include <stdio.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the difference between this file and driver.sh:L324-331? Can we merge this test suite into driver.sh? I suppose there is something duplicate.

else {
emit(__addi(__zero, __zero, 0));
/* implement multiplication with shift */
/* emit(__addi(__t1, __zero, 1));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this dead code? If so, please remove it.

@jserv
Copy link
Collaborator

jserv commented Oct 27, 2023

The proposed change was far away from the mainline. Drop it.

@jserv jserv closed this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants