-
Notifications
You must be signed in to change notification settings - Fork 47
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 a "xcheri-std-compat" mode to LLVM #756
Open
arichardson
wants to merge
18
commits into
CTSRD-CHERI:dev
Choose a base branch
from
arichardson:std-compat
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,095
−442
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5d2b79a
[CHERI-RISC-V] Add instruction aliases for the new getter mnemonics
arichardson c2c8a03
[CHERI-RISC-V] Add instruction aliases for the new modification mnemo…
arichardson abff069
[CHERI-RISC-V] Support scss and sceq mnemonics
arichardson 6efdb89
[CHERI-RISC-V] Support unprefixed jump instructions
arichardson 95dd7c6
[CHERI-RISC-V][NFCI] Split xcheri feature into cheri-common and xcheri
arichardson c19293b
[CHERI StdCompat] Add a flag to disable non-standard instructions
arichardson dc0e64c
[CHERI StdCompat] Expand CGetOffset
arichardson 6892a85
[CHERI StdCompat] Expand CGetSealed
arichardson cea4ec0
[CHERI StdCompat] Expand CSetOffset to a CSetAddr sequence
arichardson e724e83
[CHERI StdCompat] Expand (CClearTag x) to (CSetHigh x, (CGetHigh x))
arichardson 75caa2b
[CHERI StdCompat] Expand CRRL to the equivalent CRAM sequence
arichardson 9b3a67f
[CHERI StdCompat] Emit a Clang error for unsupported builtins
arichardson cfa1923
[CHERI StdCompat] Disable more unsupported intrinsics
arichardson 93090cd
[CHERI StdCompat] Add a baseline test for a broken pre-defined macro
arichardson d990221
[CHERI StdCompat] Correctly define a __riscv_xcheri_std_compat macro
arichardson 3018644
[CHERI StdCompat] Add MC support for the modesw.{cap,int} instructions
arichardson b35db52
[CHERI StdCompat] Expand explicit mode loads using mode-switching
arichardson a3b146b
[CHERI StdCompat] Expand explicit mode stores using mode-switching
arichardson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// In the RISC-V standard compat mode not all builtins are supported since we do not perform the expansion in the backend. | ||
// RUN: %riscv64_cheri_purecap_cc1 -target-feature +xcheri %s -fsyntax-only -verify=xcheri | ||
// RUN: %riscv64_cheri_purecap_cc1 -target-feature +xcheri-std-compat %s -fsyntax-only -verify=std-compat | ||
// xcheri-no-diagnostics | ||
|
||
void *cseal(void *a, void *b) { | ||
_Static_assert(__has_builtin(__builtin_cheri_seal), ""); // TODO: would be nice to report false here | ||
return __builtin_cheri_seal(a, b); // std-compat-error{{builtin requires at least one of the following extensions to be enabled: xcheri (without std-compat)}} | ||
} | ||
void *cunseal(void *a, void *b) { | ||
_Static_assert(__has_builtin(__builtin_cheri_unseal), ""); // TODO: would be nice to report false here | ||
return __builtin_cheri_unseal(a, b); // std-compat-error{{builtin requires at least one of the following extensions to be enabled: xcheri (without std-compat)}} | ||
} | ||
void *ccseal(void *a, void *b) { | ||
_Static_assert(__has_builtin(__builtin_cheri_conditional_seal), ""); // TODO: would be nice to report false here | ||
return __builtin_cheri_conditional_seal(a, b); // std-compat-error{{builtin requires at least one of the following extensions to be enabled: xcheri (without std-compat)}} | ||
} | ||
void *ccopytype(void *a, void *b) { | ||
_Static_assert(__has_builtin(__builtin_cheri_cap_type_copy), ""); // TODO: would be nice to report false here | ||
return __builtin_cheri_cap_type_copy(a, b); // std-compat-error{{builtin requires at least one of the following extensions to be enabled: xcheri (without std-compat)}} | ||
} | ||
unsigned long cloadtags(void *a) { | ||
_Static_assert(__has_builtin(__builtin_cheri_cap_load_tags), ""); // TODO: would be nice to report false here | ||
return __builtin_cheri_cap_load_tags(a); // std-compat-error{{builtin requires at least one of the following extensions to be enabled: xcheri (without std-compat)}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 guess we could expand this to lc+cgettag, but I think an error if it's not support might make it clearer that the optimized version does not exist?