RISC-V: Add interrupt attribute modes

Programming / Compilers / GCC - wilson [138bc75d-0d04-0410-961f-82ee72b054a4] - 6 June 2018 19:08 EDT

gcc/
- config/riscv/riscv.c (enum riscv_privilege_levels): New. (struct machine_function): New field interrupt_mode. (riscv_handle_type_attribute): New function. Add forward declaration. (riscv_attribute_table) : Use riscv_handle_type_attribute. (riscv_expand_epilogue): Check interrupt_mode field. (riscv_set_current_function): Check interrupt attribute args and set interrupt_mode field.
- config/riscv/riscv.md (UNSPECV_SRET, UNSPECV_URET): New. (riscv_sret, riscv_uret): New.
- doc/extend.texi (RISC-V Function Attributes) : Document new arguments to interrupt attribute.

gcc/testsuite/
- gcc.target/riscv/interrupt-5.c (sub3): Add new test.
- gcc.target/riscv/interrupt-mmode.c: New.
- gcc.target/riscv/interrupt-smode.c: New.
- gcc.target/riscv/interrupt-umode.c: New.

cd3f326c0fc RISC-V: Add interrupt attribute modes.
gcc/ChangeLog | 14 ++++
gcc/config/riscv/riscv.c | 82 +++++++++++++++++++++++-
gcc/config/riscv/riscv.md | 12 ++++
gcc/doc/extend.texi | 11 ++++
gcc/testsuite/ChangeLog | 7 ++
gcc/testsuite/gcc.target/riscv/interrupt-5.c | 5 ++
gcc/testsuite/gcc.target/riscv/interrupt-mmode.c | 8 +++
gcc/testsuite/gcc.target/riscv/interrupt-smode.c | 8 +++
gcc/testsuite/gcc.target/riscv/interrupt-umode.c | 8 +++
9 files changed, 152 insertions(+), 3 deletions(-)

Upstream: gcc.gnu.org


  • Share