Skip to content

Commit

Permalink
[Clang][RISCV] Remove RVV intrinsics vread_csr,vwrite_csr
Browse files Browse the repository at this point in the history
As proposed in riscv-non-isa/rvv-intrinsic-doc#249, removing the interface.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D156321
  • Loading branch information
eopXD committed Jul 27, 2023
1 parent 7029e74 commit 7cb81c1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 134 deletions.
50 changes: 0 additions & 50 deletions clang/include/clang/Basic/riscv_vector.td
Original file line number Diff line number Diff line change
Expand Up @@ -990,56 +990,6 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range,
}
}

// Define vread_csr&vwrite_csr described in RVV intrinsics doc.
let HeaderCode =
[{
enum RVV_CSR {
RVV_VSTART = 0,
RVV_VXSAT,
RVV_VXRM,
RVV_VCSR,
};

static __inline__ __attribute__((__always_inline__, __nodebug__))
unsigned long __riscv_vread_csr(enum RVV_CSR __csr) {
unsigned long __rv = 0;
switch (__csr) {
case RVV_VSTART:
__asm__ __volatile__ ("csrr\t%0, vstart" : "=r"(__rv) : : "memory");
break;
case RVV_VXSAT:
__asm__ __volatile__ ("csrr\t%0, vxsat" : "=r"(__rv) : : "memory");
break;
case RVV_VXRM:
__asm__ __volatile__ ("csrr\t%0, vxrm" : "=r"(__rv) : : "memory");
break;
case RVV_VCSR:
__asm__ __volatile__ ("csrr\t%0, vcsr" : "=r"(__rv) : : "memory");
break;
}
return __rv;
}

static __inline__ __attribute__((__always_inline__, __nodebug__))
void __riscv_vwrite_csr(enum RVV_CSR __csr, unsigned long __value) {
switch (__csr) {
case RVV_VSTART:
__asm__ __volatile__ ("csrw\tvstart, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VXSAT:
__asm__ __volatile__ ("csrw\tvxsat, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VXRM:
__asm__ __volatile__ ("csrw\tvxrm, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VCSR:
__asm__ __volatile__ ("csrw\tvcsr, %z0" : : "rJ"(__value) : "memory");
break;
}
}
}] in
def vread_vwrite_csr: RVVHeader;

let HeaderCode =
[{
#define __riscv_vlenb() __builtin_rvv_vlenb()
Expand Down
42 changes: 0 additions & 42 deletions clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/vread-csr.c

This file was deleted.

42 changes: 0 additions & 42 deletions clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/vwrite-csr.c

This file was deleted.

0 comments on commit 7cb81c1

Please sign in to comment.