Skip to content

[CIR][CIRGen][Builtin][Neon] Lower vcagtd_f64 #1448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2686,10 +2686,11 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
}
case NEON::BI__builtin_neon_vcages_f32:
llvm_unreachable(" neon_vcages_f32 NYI ");
case NEON::BI__builtin_neon_vcagtd_f64:
llvm_unreachable(" neon_vcagtd_f64 NYI ");
case NEON::BI__builtin_neon_vcagts_f32:
llvm_unreachable(" neon_vcagts_f32 NYI ");
case NEON::BI__builtin_neon_vcagtd_f64: {
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facgt", resultTy,
loc);
}
case NEON::BI__builtin_neon_vcaled_f64:
llvm_unreachable(" neon_vcaled_f64 NYI ");
case NEON::BI__builtin_neon_vcales_f32:
Expand Down
32 changes: 20 additions & 12 deletions clang/test/CIR/CodeGen/AArch64/neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -15125,19 +15125,27 @@ uint64_t test_vcaged_f64(float64_t a, float64_t b) {
// LLVM: ret i64 [[VCAGED_F64_I]]
}

// NYI-LABEL: @test_vcagts_f32(
// NYI: [[VCAGTS_F32_I:%.*]] = call i32 @llvm.aarch64.neon.facgt.i32.f32(float %a, float %b)
// NYI: ret i32 [[VCAGTS_F32_I]]
// uint32_t test_vcagts_f32(float32_t a, float32_t b) {
// return (uint32_t)vcagts_f32(a, b);
// }
uint32_t test_vcagts_f32(float32_t a, float32_t b) {
return (uint32_t)vcagts_f32(a, b);

// NYI-LABEL: @test_vcagtd_f64(
// NYI: [[VCAGTD_F64_I:%.*]] = call i64 @llvm.aarch64.neon.facgt.i64.f64(double %a, double %b)
// NYI: ret i64 [[VCAGTD_F64_I]]
// uint64_t test_vcagtd_f64(float64_t a, float64_t b) {
// return (uint64_t)vcagtd_f64(a, b);
// }
// CIR-LABEL: vcagts_f32
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.neon.facgt" {{.*}}, {{.*}} : (!cir.float, !cir.float) -> !u32i

// LLVM-LABEL: @test_vcagts_f32(
// LLVM: [[VCAGED_F32_I:%.*]] = call i32 @llvm.aarch64.neon.facgt.i32.f32(float %0, float %1)
// LLVM: ret i32 [[VCAGED_F32_I]]
}

uint64_t test_vcagtd_f64(float64_t a, float64_t b) {
return (uint64_t)vcagtd_f64(a, b);

// CIR-LABEL: vcagtd_f64
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.neon.facgt" {{.*}}, {{.*}} : (!cir.double, !cir.double) -> !u64i

// LLVM-LABEL: @test_vcagtd_f64(
// LLVM: [[VCAGED_F64_I:%.*]] = call i64 @llvm.aarch64.neon.facgt.i64.f64(double %0, double %1)
// LLVM: ret i64 [[VCAGED_F64_I]]
}

// NYI-LABEL: @test_vcales_f32(
// NYI: [[VCALES_F32_I:%.*]] = call i32 @llvm.aarch64.neon.facge.i32.f32(float %b, float %a)
Expand Down