Skip to content

Commit

Permalink
[Clang][XTHeadVector] implement 12.14 vmerge (ruyisdk#88)
Browse files Browse the repository at this point in the history
* [Clang][XTHeadVector] implement 12.14 `vmerge`

* [Clang][XTHeadVector] test 12.14 `vmerge`
  • Loading branch information
imkiva committed Apr 1, 2024
1 parent 27a7d8d commit 834f54d
Show file tree
Hide file tree
Showing 2 changed files with 663 additions and 0 deletions.
17 changes: 17 additions & 0 deletions clang/include/clang/Basic/riscv_vector_xtheadv.td
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,23 @@ let MaskedPolicyScheme = NonePolicy,
}

// 12.14. Vector Integer Merge Operations
let HasMasked = false,
UnMaskedPolicyScheme = HasPassthruOperand,
MaskedPolicyScheme = NonePolicy,
ManualCodegen = [{
{
// Builtin: (mask, op1, op2, vl), Intrinsic: (passthru, op1, op2, mask, vl)
if (PolicyAttrs & RVV_VTA)
Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); // passthru
IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
}
}] in {
defm th_vmerge : RVVOutOp1BuiltinSet<"th_vmerge", "csil",
[["vvm", "v", "vvvm"],
["vxm", "v", "vvem"],
["vvm", "Uv", "UvUvUvm"],
["vxm", "Uv", "UvUvUem"]]>;
}

// 12.15. Vector Integer Move Operations

Expand Down
Loading

0 comments on commit 834f54d

Please sign in to comment.