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

Add RISCV vector extension #289

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Conversation

michael-roe
Copy link
Contributor

No description provided.

@@ -36,6 +36,7 @@ typedef struct {
int D : 1; // Standard Extension for Double-Precision Floating-Point
int Q : 1; // Standard Extension for Quad-Precision Floating-Point
int C : 1; // Standard Extension for Compressed Instructions
int V : 1; // Standard Extneions for Vector Instructions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Extension

@michael-roe
Copy link
Contributor Author

Ok, I've fixed the typo in the comment.

@gchatelet
Copy link
Collaborator

@michael-roe I originally implemented only the ratified extensions from the spec, that's why vector extension is missing.

Do you know of any board that currently supports vector extensions?
Also can you add a test case for it?

@michael-roe
Copy link
Contributor Author

Yes, I can add a test case. (I was kind of expecting you to ask for one...)

The QEMU emulator can emulate V, and there are implementations on FPGA.

As far as I know, current boards don't support it (Allwinner D1 is based on an obsolete version of the vector spec), but things are moving fairly quickly.

@Mizux
Copy link
Collaborator

Mizux commented Jan 25, 2023

Last kernel news about it AFAIK proposal in September 2021
https://lore.kernel.org/lkml/802edef897b4bd40f3ebc2cb47c02b8e2f61a666.1636362169.git.greentime.hu@sifive.com/

November 2022
https://lkml.org/lkml/2022/11/4/10 Review seems in progress but there is some works remaining...

@michael-roe
Copy link
Contributor Author

Ok, I've added tests for the V extension.

Comment on lines 160 to 162
ResetHwcaps();
auto& fs = GetEmptyFilesystem();
fs.CreateFile("/proc/cpuinfo", R"(
Copy link
Contributor

Choose a reason for hiding this comment

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

could you format these lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I've fixed the indentation.

@michael-roe
Copy link
Contributor Author

Is this PR Ok now?

(There are a bunch of people who want rto use riscv vector)

@gchatelet gchatelet merged commit 75ec988 into google:main Apr 24, 2023
@gchatelet
Copy link
Collaborator

Sorry for the lag and thx for the PR!

@Mizux
Copy link
Collaborator

Mizux commented Apr 25, 2023

please notice https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/asm/hwcap.h still does not contain it so we could change this implementation if the kernel want to go in a different way...

@gchatelet gchatelet added the enhancement New feature or request label Apr 27, 2023
@gchatelet gchatelet added this to the v0.8.0 milestone Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants