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

Switch to lld and compiler-rt #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,17 @@
asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \
__tmp; })

/* TODO: */
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be resolved before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove the TODO and the commented code. Jesse's fix should be OK. It matches the macro definitions in recent versions of encoding.h in riscv-opcodes.

/*
The conditional here does not work. It seems to see the value as less than 32
*/
/* #define write_csr(reg, val) ({ \ */
/* if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ */
/* asm volatile ("csrwi " #reg ", %0" :: "i"(val)); \ */
/* else \ */
/* asm volatile ("csrw " #reg ", %0" :: "r"(val)); }) */

#define write_csr(reg, val) ({ \
if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \
asm volatile ("csrw " #reg ", %0" :: "i"(val)); \
else \
asm volatile ("csrw " #reg ", %0" :: "r"(val)); })

#define swap_csr(reg, val) ({ unsigned long __tmp; \
Expand Down