[PATCH] D151197: [Clang][SVE2p1] Add svpsel builtins

hassnaaHamdi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 10:18:15 PDT 2023


hassnaa-arm added inline comments.


================
Comment at: clang/include/clang/Basic/arm_sve.td:2123
+
+def SVPSEL_COUNT_ALIAS_B : SInst<"svpsel_lane_c8",  "}}Pmi", "Pc", MergeNone, "", [], [ImmCheck<3, ImmCheck0_15>]>;
+def SVPSEL_COUNT_ALIAS_H : SInst<"svpsel_lane_c16", "}}Pmi", "Ps", MergeNone, "", [], [ImmCheck<3, ImmCheck0_7>]>;
----------------
In the section of prototype modifiers: "}}Pmi"
According to the used modifiers, I see that they refer to 4 parameters, while in the testing file I see the function takes 3 parameters only.
Isn't that 'i' modifier extra ?
The same case for all the builtins.
Am I correct ?


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:9633-9635
+    bool IsSVCount = isa<TargetExtType>(Ops[0]->getType());
+    assert(((!IsSVCount || cast<TargetExtType>(Ops[0]->getType())->getName() ==
+                               "aarch64.svcount")) &&
----------------
for the case of sve::BI__builtin_sve_svpsel_lane_b8, 
what is the expected value of IsSVCount ? and how the assertion statement didn't assert for the check of :
(cast<TargetExtType>(Ops[0]->getType())->getName() ==
                               "aarch64.svcount"))
how is the parameter type considered as aarch64.svcount ?


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:9642
+    Function *CastToSVCountF =
+        CGM.getIntrinsic(Intrinsic::aarch64_sve_convert_from_svbool, SVCountTy);
+
----------------
Isn't the type of 'SVCountTy' = 'aarch64.svcount' as a result of the statement at line 9637 ?
So why do we need to aarch64_sve_convert_from_svbool while it's not svbool.
Am I missing something ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151197/new/

https://reviews.llvm.org/D151197



More information about the cfe-commits mailing list