-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Implement intrinsics for XCVbitmanip extension in CV32E40P (#…
…74993) Implement XCVbitmanip intrinsics for CV32E40P according to the specification. This commit is part of a patch-set to upstream the vendor specific extensions of CV32E40P that need LLVM intrinsics to implement Clang builtins. Contributors: @CharKeaney, @ChunyuLiao, @jeremybennett, @lewis-revill, @NandniJamnadas, @PaoloS02, @simonpcook, @xingmingjie. Spec: https://github.com/openhwgroup/core-v-sw/blob/05481cf0ef7aa7b09067b14ff3f71faead7ba310/specifications/corev-builtin-spec.md#listing-of-pulp-bit-manipulation-builtins-xcvbitmanip. Previously reviewed on Phabricator: https://reviews.llvm.org/D157510. Parallel GCC patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635795.html. Co-authored-by: melonedo <funanzeng@gmail.com>
- Loading branch information
Showing
6 changed files
with
335 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//===- IntrinsicsRISCVXCV.td - CORE-V intrinsics -----------*- tablegen -*-===// | ||
// | ||
// 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 all of the CORE-V vendor intrinsics for RISC-V. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class ScalarCoreVBitManipGprGprIntrinsic | ||
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], | ||
[IntrNoMem, IntrSpeculatable]>; | ||
|
||
class ScalarCoreVBitManipGprIntrinsic | ||
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty], | ||
[IntrNoMem, IntrSpeculatable]>; | ||
|
||
let TargetPrefix = "riscv" in { | ||
def int_riscv_cv_bitmanip_extract : ScalarCoreVBitManipGprGprIntrinsic; | ||
def int_riscv_cv_bitmanip_extractu : ScalarCoreVBitManipGprGprIntrinsic; | ||
def int_riscv_cv_bitmanip_bclr : ScalarCoreVBitManipGprGprIntrinsic; | ||
def int_riscv_cv_bitmanip_bset : ScalarCoreVBitManipGprGprIntrinsic; | ||
|
||
def int_riscv_cv_bitmanip_insert | ||
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], | ||
[IntrNoMem, IntrSpeculatable]>; | ||
|
||
def int_riscv_cv_bitmanip_clb : ScalarCoreVBitManipGprIntrinsic; | ||
|
||
def int_riscv_cv_bitmanip_bitrev | ||
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], | ||
[IntrNoMem, IntrWillReturn, IntrSpeculatable, | ||
ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>; | ||
} // TargetPrefix = "riscv" |
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.