Skip to content

Commit 1a8cbfa

Browse files
committed
[ARM,MVE] Add ACLE intrinsics for VCVT[ANPM] family.
Summary: These instructions convert a vector of floats to a vector of integers of the same size, with assorted non-default rounding modes. Implemented in IR as target-specific intrinsics, because as far as I can see there are no matches for that functionality in the standard IR intrinsics list. Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D75255
1 parent b08d2dd commit 1a8cbfa

File tree

5 files changed

+1296
-10
lines changed

5 files changed

+1296
-10
lines changed

clang/include/clang/Basic/arm_mve.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,25 @@ multiclass float_int_conversions<Type FScalar, Type IScalar, IRBuilderBase ftoi,
482482
let pnt = PNT_None in {
483483
def : Intrinsic<IVector, (args FVector:$a), (ftoi $a, IVector)>,
484484
NameOverride<"vcvtq_" # IScalar>;
485+
486+
foreach suffix = ["a","n","p","m"] in
487+
def : Intrinsic<IVector, (args FVector:$a),
488+
(IRInt<"vcvt"#suffix, [IVector, FVector]>
489+
(unsignedflag IScalar), $a)>,
490+
NameOverride<"vcvt"#suffix#"q_" # IScalar>;
485491
}
486492
defm vcvtq: IntrinsicMX<IVector, (args FVector:$a, Predicate:$pred),
487493
(IRInt<"vcvt_fp_int_predicated", [IVector, FVector, Predicate]>
488494
$a, (unsignedflag IScalar), $pred, $inactive),
489495
1, "_" # IScalar, PNT_2Type, PNT_None>;
496+
497+
foreach suffix = ["a","n","p","m"] in {
498+
defm "vcvt"#suffix#"q" : IntrinsicMX<
499+
IVector, (args FVector:$a, Predicate:$pred),
500+
(IRInt<"vcvt"#suffix#"_predicated", [IVector, FVector, Predicate]>
501+
(unsignedflag IScalar), $inactive, $a, $pred),
502+
1, "_" # IScalar, PNT_2Type, PNT_None>;
503+
}
490504
}
491505
}
492506

0 commit comments

Comments
 (0)