From 6fa1d14652ae944e7aa80e52c3c863cfb0858240 Mon Sep 17 00:00:00 2001 From: Liao Shihua Date: Fri, 25 Oct 2024 15:18:33 +0800 Subject: [PATCH] Add CMO extension intrinsics --- src/c-api.adoc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/c-api.adoc b/src/c-api.adoc index aed70db..b83aae3 100644 --- a/src/c-api.adoc +++ b/src/c-api.adoc @@ -485,6 +485,29 @@ RISC-V intrinsics examples: vint8m1_t __riscv_vadd_vv_i8m1(vint8m1_t vs2, vint8m1_t vs1, size_t vl); // vadd.vv vd, vs2, vs1 ---- +=== CMO Intrinsics + +The RISC-V CMO extension provides instruction for perform operations on copies +of data in the memory hierarchy. + +In order to access the RISC-V CMO intrinsics, it is necessary to +include the header file `riscv_cmo.h`. + +The functions are only available if the compiler's `-march` string enables the +required ISA extension. + +.CMO Extension Intrinsics +[%autowidth] +|=== +|*Prototype* |*Instruction* |*Extension* +|`+void __riscv_cbo_clean(void *addr);+` |`cbo.clean` |Zicbom +|`+void __riscv_cbo_flush(void *addr);+` |`cbo.flush` |Zicbom +|`+void __riscv_cbo_inval(void *addr);+` |`cbo.inval` |Zicbom +|`+void __riscv_cbo_zero(void *addr);+` |`cbo.zero` |Zicboz +|`+void __riscv_cbo_prefetch(void *addr, const int rw, const int locality);+` |`prefetch.[r][w]` |Zicbop +|`+int __riscv_cbo_prefetchi(const int locality);+` |`prefetch.i` |Zicbop +|=== + === NTLH Intrinsics