10#ifndef __RISCV_COREV_ALU_H
11#define __RISCV_COREV_ALU_H
15#if defined(__cplusplus)
19#if defined(__riscv_xcvalu)
21#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
24 return __builtin_abs(a);
28 return __builtin_riscv_cv_alu_slet(a,
b);
32__riscv_cv_alu_sletu(
unsigned long a,
unsigned long b) {
33 return __builtin_riscv_cv_alu_sletu(a,
b);
37 return __builtin_elementwise_min(a,
b);
41__riscv_cv_alu_minu(
unsigned long a,
unsigned long b) {
42 return __builtin_elementwise_min(a,
b);
46 return __builtin_elementwise_max(a,
b);
50__riscv_cv_alu_maxu(
unsigned long a,
unsigned long b) {
51 return __builtin_elementwise_max(a,
b);
55 return __builtin_riscv_cv_alu_exths(a);
59__riscv_cv_alu_exthz(uint16_t a) {
60 return __builtin_riscv_cv_alu_exthz(a);
64 return __builtin_riscv_cv_alu_extbs(a);
68__riscv_cv_alu_extbz(uint8_t a) {
69 return __builtin_riscv_cv_alu_extbz(a);
74 return __builtin_riscv_cv_alu_clip(a,
b);
78__riscv_cv_alu_clipu(
unsigned long a,
unsigned long b) {
79 return __builtin_riscv_cv_alu_clipu(a,
b);
84 return __builtin_riscv_cv_alu_addN(a,
b, shft);
88__riscv_cv_alu_adduN(
unsigned long a,
unsigned long b, uint8_t shft) {
89 return __builtin_riscv_cv_alu_adduN(a,
b, shft);
94 return __builtin_riscv_cv_alu_addRN(a,
b, shft);
98__riscv_cv_alu_adduRN(
unsigned long a,
unsigned long b, uint8_t shft) {
99 return __builtin_riscv_cv_alu_adduRN(a,
b, shft);
104 return __builtin_riscv_cv_alu_subN(a,
b, shft);
108__riscv_cv_alu_subuN(
unsigned long a,
unsigned long b, uint8_t shft) {
109 return __builtin_riscv_cv_alu_subuN(a,
b, shft);
114 return __builtin_riscv_cv_alu_subRN(a,
b, shft);
118__riscv_cv_alu_subuRN(
unsigned long a,
unsigned long b, uint8_t shft) {
119 return __builtin_riscv_cv_alu_subuRN(a,
b, shft);
124#if defined(__cplusplus)
#define __DEFAULT_FN_ATTRS