-
Notifications
You must be signed in to change notification settings - Fork 1.6k
disable fp16 flags on RISC-V unless BUILD_HFLOAT16=1 #5431
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,8 @@ struct riscv_hwprobe { | |
|
|
||
| #define RISCV_HWPROBE_KEY_IMA_EXT_0 4 | ||
| #define RISCV_HWPROBE_IMA_V (1 << 2) | ||
| #define RISCV_HWPROBE_EXT_ZFH (1 << 27) | ||
| #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) | ||
|
|
||
| #ifndef NR_riscv_hwprobe | ||
| #ifndef NR_arch_specific_syscall | ||
|
|
@@ -147,6 +149,7 @@ char* gotoblas_corename(void) { | |
| } | ||
|
|
||
| static gotoblas_t* get_coretype(void) { | ||
| uint64_t vector_mask; | ||
| unsigned vlenb = 0; | ||
|
|
||
| #if !defined(OS_LINUX) | ||
|
|
@@ -165,14 +168,23 @@ static gotoblas_t* get_coretype(void) { | |
| }; | ||
| int ret = syscall(NR_riscv_hwprobe, pairs, 1, 0, NULL, 0); | ||
| if (ret == 0) { | ||
| if (!(pairs[0].value & RISCV_HWPROBE_IMA_V)) | ||
| #if defined(BUILD_HFLOAT16) | ||
| vector_mask = (RISCV_HWPROBE_IMA_V | RISCV_HWPROBE_EXT_ZFH | RISCV_HWPROBE_EXT_ZVFH); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you need to check for these also? #define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these extensions being used? They don't appear to be enabled in the compiler flags
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ones that you currently have are for the mult and madd instructions.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I looked it up. Minimum extension is a subset of the regular extension. So what we and you have seem correct. |
||
| #else | ||
| vector_mask = RISCV_HWPROBE_IMA_V; | ||
| #endif | ||
| if ((pairs[0].value & vector_mask) != vector_mask) | ||
| return NULL; | ||
| } else { | ||
| #if defined(BUILD_HFLOAT16) | ||
| return NULL; | ||
| #else | ||
| if (!(getauxval(AT_HWCAP) & DETECT_RISCV64_HWCAP_ISA_V)) | ||
| return NULL; | ||
|
|
||
| if (!detect_riscv64_rvv100()) | ||
| return NULL; | ||
| #endif | ||
| } | ||
|
|
||
| /* | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone see any issue with removing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to remove these entirely, just revert them to their state before the addition of the HFLOAT16 PR (i.e. rv64imafdcv), unless we can be absolutely certain that the getarch utility and everything downstream of c_check still works on any affected RISCV64 platform (I'm especially worried about the
-mabi=lp64dpart) ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was removing these to fix
#5424
but perhaps this is not the way to do this. Perhaps it's best to remove
05c8654
from this PR and fix the issue separately.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've dropped the commit that removes these lines entirely. The remaining commit just removes the half float flags.