-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add header files for all CORE-V extensions that have C builtin functions. The definitions of existing builtin functions are also adjusted accordingly.
- Loading branch information
Showing
10 changed files
with
427 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*===---- riscv_corev_alu.h - CORE-V ALU intrinsics ------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __RISCV_COREV_ALU_H | ||
#define __RISCV_COREV_ALU_H | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(__riscv_xcvalu) | ||
int __builtin_abs (int j); | ||
int __builtin_riscv_cv_alu_slet (int32_t i, int32_t j); | ||
int __builtin_riscv_cv_alu_sletu (uint32_t i, uint32_t j); | ||
int32_t __builtin_riscv_cv_alu_min (int32_t i, int32_t j); | ||
uint32_t __builtin_riscv_cv_alu_minu (uint32_t i, uint32_t j); | ||
int32_t __builtin_riscv_cv_alu_max (int32_t i, int32_t j); | ||
uint32_t __builtin_riscv_cv_alu_maxu (uint32_t i, uint32_t j); | ||
int32_t __builtin_riscv_cv_alu_exths (int16_t i); | ||
uint32_t __builtin_riscv_cv_alu_exthz (uint16_t i); | ||
int32_t __builtin_riscv_cv_alu_extbs (int8_t i); | ||
uint32_t __builtin_riscv_cv_alu_extbz (uint8_t); | ||
int32_t __builtin_riscv_cv_alu_clip (int32_t i, uint32_t j); | ||
uint32_t __builtin_riscv_cv_alu_clipu (uint32_t i, uint32_t j); | ||
int32_t __builtin_riscv_cv_alu_addN (int32_t x, int32_t y, uint8_t shft); | ||
uint32_t __builtin_riscv_cv_alu_adduN (uint32_t x, uint32_t y, uint8_t shft); | ||
int32_t __builtin_riscv_cv_alu_addRN (int32_t x, int32_t y, uint8_t shft); | ||
uint32_t __builtin_riscv_cv_alu_adduRN (uint32_t x, uint32_t y, uint8_t shft); | ||
int32_t __builtin_riscv_cv_alu_subN (int32_t x, int32_t y, uint8_t shft); | ||
uint32_t __builtin_riscv_cv_alu_subuN (uint32_t x, uint32_t y, uint8_t shft); | ||
int32_t __builtin_riscv_cv_alu_subRN (int32_t x, int32_t y, uint8_t shft); | ||
uint32_t __builtin_riscv_cv_alu_subuRN (uint32_t x, uint32_t y, uint8_t shft); | ||
#endif // defined(__riscv_xcvalu) | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // define __RISCV_COREV_ALU_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*===---- riscv_corev_bitmanip.h - CORE-V bit manipulation intrinsics ------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __RISCV_COREV_BITMANIP_H | ||
#define __RISCV_COREV_BITMANIP_H | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(__riscv_xcvbitmanip) | ||
int32_t __builtin_riscv_cv_bitmanip_extract (int32_t i, uint16_t range); | ||
uint32_t __builtin_riscv_cv_bitmanip_extractu (uint32_t i, uint16_t range); | ||
uint32_t __builtin_riscv_cv_bitmanip_insert (uint32_t i, uint16_t range, uint32_t k); | ||
uint32_t __builtin_riscv_cv_bitmanip_bclr (uint32_t i, uint16_t range); | ||
uint32_t __builtin_riscv_cv_bitmanip_bset (uint32_t i, uint16_t range); | ||
uint8_t __builtin_riscv_cv_bitmanip_ff1 (uint32_t i); | ||
uint8_t __builtin_riscv_cv_bitmanip_fl1 (uint32_t i); | ||
uint8_t __builtin_riscv_cv_bitmanip_clb (uint32_t i); | ||
uint8_t __builtin_riscv_cv_bitmanip_cnt (uint32_t i); | ||
uint32_t __builtin_riscv_cv_bitmanip_ror (uint32_t i, uint32_t j); | ||
uint32_t __builtin_riscv_cv_bitmanip_bitrev (uint32_t i, uint8_t pts, uint8_t radix); | ||
#endif // defined(__riscv_xcvbitmanip) | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // define __RISCV_COREV_BITMANIP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*===---- riscv_corev_elw.h - CORE-V event load intrinsics -----------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __RISCV_COREV_ELW_H | ||
#define __RISCV_COREV_ELW_H | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(__riscv_xcvelw) | ||
uint32_t __builtin_riscv_cv_elw_elw (void *loc); | ||
#endif // defined(__riscv_xcvelw) | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // define __RISCV_COREV_ELW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*===---- riscv_corev_mac.h - CORE-V multiply accumulate intrinsics --------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __RISCV_COREV_MAC_H | ||
#define __RISCV_COREV_MAC_H | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(__riscv_xcvmac) | ||
int32_t __builtin_riscv_cv_mac_mac (int32_t x, int32_t y, int32_t z); | ||
int32_t __builtin_riscv_cv_mac_msu (int32_t x, int32_t y, int32_t z); | ||
uint32_t __builtin_riscv_cv_mac_muluN (uint32_t x, uint32_t y, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_mulhhuN (uint32_t x, uint32_t y, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_mulsN (uint32_t x, uint32_t y, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_mulhhsN (uint32_t x, uint32_t y, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_muluRN (uint32_t x, uint32_t y, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_mulhhuRN (uint32_t x, uint32_t y, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_mulsRN (uint32_t x, uint32_t y, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_mulhhsRN (uint32_t x, uint32_t y, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_macuN (uint32_t x, uint32_t y, uint32_t z, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_machhuN (uint32_t x, uint32_t y, uint32_t z, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_macsN (uint32_t x, uint32_t y, int32_t z, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_machhsN (uint32_t x, uint32_t y, int32_t z, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_macuRN (uint32_t x, uint32_t y, uint32_t z, const uint8_t shft); | ||
uint32_t __builtin_riscv_cv_mac_machhuRN (uint32_t x, uint32_t y, uint32_t z, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_macsRN (uint32_t x, uint32_t y, int32_t z, const uint8_t shft); | ||
int32_t __builtin_riscv_cv_mac_machhsRN (uint32_t x, uint32_t y, int32_t z, const uint8_t shft); | ||
#endif // defined(__riscv_xcvmac) | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // define __RISCV_COREV_MAC_H |
Oops, something went wrong.