forked from plctlab/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Support CoreV SIMD builtins in clang (plctlab#32)
Co-authored-by: melonedo <[email protected]>
- Loading branch information
Showing
8 changed files
with
4,220 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
//==- BuiltinsRISCVCOREV.def - RISC-V CORE-V Builtin database ----*- C++ -*-==// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file defines the CORE-V-specific builtin function database. Users of | ||
// this file must define the BUILTIN macro to make use of this information. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#if defined(BUILTIN) && !defined(TARGET_BUILTIN) | ||
# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) | ||
#endif | ||
|
||
TARGET_BUILTIN(simd_add_h, "UZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_add_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_add_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_add_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sub_h, "UZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sub_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sub_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sub_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avg_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avg_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avg_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avg_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avgu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avgu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avgu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_avgu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_min_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_min_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_min_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_min_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_minu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_minu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_minu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_minu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_max_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_max_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_max_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_max_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_maxu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_maxu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_maxu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_maxu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_srl_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_srl_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_srl_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_srl_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sra_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sra_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sra_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sra_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sll_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sll_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sll_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sll_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_or_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_or_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_or_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_or_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_xor_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_xor_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_xor_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_xor_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_and_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_and_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_and_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_and_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_abs_h, "UZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_abs_b, "UZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotup_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotup_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotup_sc_h, "UZiUZiUs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotup_sc_b, "UZiUZiUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotusp_h, "ZiUZiSZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotusp_b, "ZiUZiSZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotusp_sc_h, "ZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotusp_sc_b, "ZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotsp_h, "ZiSZiSZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotsp_b, "ZiSZiSZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotsp_sc_h, "ZiSZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_dotsp_sc_b, "ZiSZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotup_h, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotup_b, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotup_sc_h, "UZiUZiUsUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotup_sc_b, "UZiUZiUcUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotusp_h, "ZiUZiSZiZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotusp_b, "ZiUZiSZiZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotusp_sc_h, "ZiUZiSsZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotusp_sc_b, "ZiUZiScZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotsp_h, "ZiSZiSZiZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotsp_b, "ZiSZiSZiZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotsp_sc_h, "ZiSZiSsZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_sdotsp_sc_b, "ZiSZiScZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_extract_h, "ZiUZiUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_extract_b, "ZiUZiUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_extractu_h, "UZiUZiUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_extractu_b, "UZiUZiUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_insert_h, "UZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_insert_b, "UZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle_sci_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle_sci_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle2_h, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_shuffle2_b, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_pack, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_pack_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_packhi_b, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_packlo_b, "UZiUZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpeq_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpeq_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpeq_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpeq_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpne_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpne_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpne_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpne_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgt_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgt_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgt_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgt_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpge_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpge_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpge_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpge_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmplt_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmplt_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmplt_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmplt_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmple_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmple_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmple_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmple_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgtu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgtu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgtu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgtu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgeu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgeu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgeu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpgeu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpltu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpltu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpltu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpltu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpleu_h, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpleu_b, "UZiUZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpleu_sc_h, "UZiUZiSs", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cmpleu_sc_b, "UZiUZiSc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cplxmul_r, "UZiUZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cplxmul_i, "UZiUZiUZiUZiIUc", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_cplxconj, "UZiUZi", "nc", "xcvsimd") | ||
TARGET_BUILTIN(simd_subrotmj, "UZiUZiUZiIUc", "nc", "xcvsimd") | ||
|
||
#undef BUILTIN | ||
#undef TARGET_BUILTIN |
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
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
Oops, something went wrong.