RISC-V: Cache Management Operation instructions
authorShiYulong <shiyulong@iscas.ac.cn>
Tue, 10 May 2022 03:25:25 +0000 (11:25 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 24 May 2022 13:00:39 +0000 (21:00 +0800)
commit3df3ca9014f94fe4af07444fea19b4ab29ba8e73
tree5e893fc3dd82f628ba514e0e668c82fa9f3bb09b
parent23c738bcba78a9df2259dd0626669c9a0aa04d1e
RISC-V: Cache Management Operation instructions

This commit adds cbo.clea, cbo.flush, cbo.inval, cbo.zero, prefetch.i,
prefetch.r and prefetch.w instructions.

diff with the previous version:
We use unspec_volatile instead of unspec for those cache operations.
We use UNSPECV instead of UNSPEC and move them to unspecv.

gcc/ChangeLog:

* config/riscv/predicates.md (imm5_operand): Add a new operand type for
prefetch instructions.
* config/riscv/riscv-builtins.cc (AVAIL): Add new AVAILs for CMO ISA
Extensions.
(RISCV_ATYPE_SI): New.
(RISCV_ATYPE_DI): New.
* config/riscv/riscv-ftypes.def (0): New.
(1): New.
* config/riscv/riscv.md (riscv_clean_<mode>): New.
(riscv_flush_<mode>): New.
(riscv_inval_<mode>): New.
(riscv_zero_<mode>): New.
(prefetch): New.
(riscv_prefetchi_<mode>): New.
* config/riscv/riscv-cmo.def: New file.
gcc/config/riscv/predicates.md
gcc/config/riscv/riscv-builtins.cc
gcc/config/riscv/riscv-cmo.def [new file with mode: 0644]
gcc/config/riscv/riscv-ftypes.def
gcc/config/riscv/riscv.md