Skip to content

Commit

Permalink
[Clang][XTHeadVector] Implement 13.1 vsadd/vssub/vsaddu/vssubu (llvm#89)
Browse files Browse the repository at this point in the history
* [Clang][XTHeadVector] add `(Un)MaskedPolicyScheme` for section 13

* [Clang][XTHeadVector] Implement 13.1 `vsadd/vssub/vsaddu/vssubu`

* [Clang][XTHeadVector] Implement 13.1 `vsadd/vssub/vsaddu/vssubu` wrapper macros
  • Loading branch information
imkiva authored and RevySR committed Apr 3, 2024
1 parent 72043f0 commit c774c77
Show file tree
Hide file tree
Showing 10 changed files with 5,460 additions and 1 deletion.
13 changes: 12 additions & 1 deletion clang/include/clang/Basic/riscv_vector_xtheadv.td
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,18 @@ enum __RISCV_VXRM {
}] in
def vxrm_enum : RVVHeader;

let ManualCodegen = [{
// 13.1. Vector Single-Width Saturating Add and Subtract
let UnMaskedPolicyScheme = HasPassthruOperand,
MaskedPolicyScheme = HasPassthruOperand in {
defm th_vsaddu : RVVUnsignedBinBuiltinSet;
defm th_vsadd : RVVSignedBinBuiltinSet;
defm th_vssubu : RVVUnsignedBinBuiltinSet;
defm th_vssub : RVVSignedBinBuiltinSet;
}

let UnMaskedPolicyScheme = HasPassthruOperand,
MaskedPolicyScheme = HasPassthruOperand,
ManualCodegen = [{
{
// LLVM intrinsic
// Unmasked: (passthru, op0, op1, round_mode, vl)
Expand Down
272 changes: 272 additions & 0 deletions clang/include/clang/Basic/riscv_vector_xtheadv_wrappers.td

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit c774c77

Please sign in to comment.