Skip to content

Commit c38e637

Browse files
authored
[CIR][CIRGen][Builtin][Neon] Lower neon vcaltd_f64 (#1505)
Lower neon vcaltd_f64
1 parent 097b756 commit c38e637

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2713,7 +2713,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
27132713
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facge", resultTy,
27142714
loc);
27152715
case NEON::BI__builtin_neon_vcaltd_f64:
2716-
llvm_unreachable(" neon_vcaltd_f64 NYI ");
2716+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facgt", resultTy,
2717+
loc);
27172718
case NEON::BI__builtin_neon_vcalts_f32:
27182719
llvm_unreachable(" neon_vcalts_f32 NYI ");
27192720
case NEON::BI__builtin_neon_vcvtad_s64_f64:

clang/test/CIR/CodeGen/AArch64/neon.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15185,12 +15185,16 @@ uint64_t test_vcaled_f64(float64_t a, float64_t b) {
1518515185
// return (uint32_t)vcalts_f32(a, b);
1518615186
// }
1518715187

15188-
// NYI-LABEL: @test_vcaltd_f64(
15189-
// NYI: [[VCALTD_F64_I:%.*]] = call i64 @llvm.aarch64.neon.facgt.i64.f64(double %b, double %a)
15190-
// NYI: ret i64 [[VCALTD_F64_I]]
15191-
// uint64_t test_vcaltd_f64(float64_t a, float64_t b) {
15192-
// return (uint64_t)vcaltd_f64(a, b);
15193-
// }
15188+
uint64_t test_vcaltd_f64(float64_t a, float64_t b) {
15189+
return (uint64_t)vcaltd_f64(a, b);
15190+
15191+
// CIR-LABEL: vcaltd_f64
15192+
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.neon.facgt" {{.*}}, {{.*}} : (!cir.double, !cir.double) -> !u64i
15193+
15194+
// LLVM-LABEL: @test_vcaltd_f64(
15195+
// LLVM: [[VCALTD_F64_I:%.*]] = call i64 @llvm.aarch64.neon.facgt.i64.f64(double %0, double %1)
15196+
// LLVM: ret i64 [[VCALTD_F64_I]]
15197+
}
1519415198

1519515199
int64_t test_vshrd_n_s64(int64_t a) {
1519615200
return (int64_t)vshrd_n_s64(a, 1);

0 commit comments

Comments
 (0)