Skip to content

Commit 9795760

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower neon vcaltd_f64 (llvm#1505)
Lower neon vcaltd_f64
1 parent d5cf19c commit 9795760

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
@@ -15186,12 +15186,16 @@ uint64_t test_vcaled_f64(float64_t a, float64_t b) {
1518615186
// return (uint32_t)vcalts_f32(a, b);
1518715187
// }
1518815188

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

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

0 commit comments

Comments
 (0)