Skip to content

Commit a61a0d8

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower vcalts_f32 (#1520)
Lower vcalts_f32
1 parent f60e828 commit a61a0d8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,11 +2712,10 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
27122712
case NEON::BI__builtin_neon_vcaled_f64:
27132713
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facge", resultTy,
27142714
loc);
2715+
case NEON::BI__builtin_neon_vcalts_f32:
27152716
case NEON::BI__builtin_neon_vcaltd_f64:
27162717
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facgt", resultTy,
27172718
loc);
2718-
case NEON::BI__builtin_neon_vcalts_f32:
2719-
llvm_unreachable(" neon_vcalts_f32 NYI ");
27202719
case NEON::BI__builtin_neon_vcvtad_s64_f64:
27212720
llvm_unreachable(" neon_vcvtad_s64_f64 NYI ");
27222721
case NEON::BI__builtin_neon_vcvtad_u64_f64:

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15181,9 +15181,16 @@ uint64_t test_vcaled_f64(float64_t a, float64_t b) {
1518115181
// NYI-LABEL: @test_vcalts_f32(
1518215182
// NYI: [[VCALTS_F32_I:%.*]] = call i32 @llvm.aarch64.neon.facgt.i32.f32(float %b, float %a)
1518315183
// NYI: ret i32 [[VCALTS_F32_I]]
15184-
// uint32_t test_vcalts_f32(float32_t a, float32_t b) {
15185-
// return (uint32_t)vcalts_f32(a, b);
15186-
// }
15184+
uint32_t test_vcalts_f32(float32_t a, float32_t b) {
15185+
return (uint32_t)vcalts_f32(a, b);
15186+
15187+
// CIR-LABEL: vcalts_f32
15188+
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.neon.facgt" {{.*}}, {{.*}} : (!cir.float, !cir.float) -> !u32i
15189+
15190+
// LLVM-LABEL: @test_vcalts_f32(
15191+
// LLVM: [[VCALTS_F32_I:%.*]] = call i32 @llvm.aarch64.neon.facgt.i32.f32(float %0, float %1)
15192+
// LLVM: ret i32 [[VCALTS_F32_I]]
15193+
}
1518715194

1518815195
uint64_t test_vcaltd_f64(float64_t a, float64_t b) {
1518915196
return (uint64_t)vcaltd_f64(a, b);

0 commit comments

Comments
 (0)