Skip to content

Add RISCV vector extension - #289

Merged
gchatelet merged 1 commit into
google:mainfrom
michael-roe:riscv-vector
Apr 24, 2023
Merged

gchatelet merged 1 commit into
google:mainfrom
michael-roe:riscv-vector

Conversation

@michael-roe

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread include/cpuinfo_riscv.h Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@gchatelet

Copy link
Copy Markdown
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
Copy Markdown
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

Mizux commented Jan 25, 2023 •

Copy link
Copy Markdown
Collaborator

@michael-roe

Copy link
Copy Markdown
Contributor Author

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

Comment thread test/cpuinfo_riscv_test.cc Outdated
Comment on lines +160 to +162
ResetHwcaps();
auto& fs = GetEmptyFilesystem();
fs.CreateFile("/proc/cpuinfo", R"(

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

Sorry for the lag and thx for the PR!

@Mizux

Mizux commented Apr 25, 2023

Copy link
Copy Markdown
Collaborator

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.

4 participants