Skip to content

Commit dfef455

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower vabds_f32 and vabdd_f64 (#1531)
Lower `vabds_f32` and `vabdd_f64`
1 parent c861519 commit dfef455

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,9 +2667,9 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
26672667
llvm::errs() << getAArch64SIMDIntrinsicString(builtinID) << " ";
26682668
llvm_unreachable("in emitCommonNeonSISDBuiltinExpr NYI");
26692669
case NEON::BI__builtin_neon_vabdd_f64:
2670-
llvm_unreachable(" neon_vabdd_f64 NYI ");
26712670
case NEON::BI__builtin_neon_vabds_f32:
2672-
llvm_unreachable(" neon_vabds_f32 NYI ");
2671+
return emitNeonCall(builder, {argTy}, ops, "aarch64.sisd.fabd", resultTy,
2672+
loc);
26732673
case NEON::BI__builtin_neon_vabsd_s64:
26742674
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.abs", resultTy,
26752675
loc);

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18538,19 +18538,27 @@ int64_t test_vqshlud_n_s64(int64_t a) {
1853818538
// return vreinterpretq_p64_p16(a);
1853918539
// }
1854018540

18541-
// NYI-LABEL: @test_vabds_f32(
18542-
// NYI: [[VABDS_F32_I:%.*]] = call float @llvm.aarch64.sisd.fabd.f32(float %a, float %b)
18543-
// NYI: ret float [[VABDS_F32_I]]
18544-
// float32_t test_vabds_f32(float32_t a, float32_t b) {
18545-
// return vabds_f32(a, b);
18546-
// }
18541+
float32_t test_vabds_f32(float32_t a, float32_t b) {
18542+
return vabds_f32(a, b);
1854718543

18548-
// NYI-LABEL: @test_vabdd_f64(
18549-
// NYI: [[VABDD_F64_I:%.*]] = call double @llvm.aarch64.sisd.fabd.f64(double %a, double %b)
18550-
// NYI: ret double [[VABDD_F64_I]]
18551-
// float64_t test_vabdd_f64(float64_t a, float64_t b) {
18552-
// return vabdd_f64(a, b);
18553-
// }
18544+
// CIR-LABEL: vabds_f32
18545+
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.sisd.fabd" {{.*}}, {{.*}} : (!cir.float, !cir.float) -> !cir.float
18546+
18547+
// LLVM-LABEL: @test_vabds_f32(
18548+
// LLVM: [[VABDS_F32:%.*]] = call float @llvm.aarch64.sisd.fabd.f32(float %0, float %1)
18549+
// LLVM: ret float [[VABDS_F32]]
18550+
}
18551+
18552+
float64_t test_vabdd_f64(float64_t a, float64_t b) {
18553+
return vabdd_f64(a, b);
18554+
18555+
// CIR-LABEL: vabdd_f64
18556+
// CIR: [[TMP0:%.*]] = cir.llvm.intrinsic "aarch64.sisd.fabd" {{.*}}, {{.*}} : (!cir.double, !cir.double) -> !cir.double
18557+
18558+
// LLVM-LABEL: @test_vabdd_f64(
18559+
// LLVM: [[VABDD_F64:%.*]] = call double @llvm.aarch64.sisd.fabd.f64(double %0, double %1)
18560+
// LLVM: ret double [[VABDD_F64]]
18561+
}
1855418562

1855518563
// NYI-LABEL: @test_vuqaddq_s8(
1855618564
// NYI: entry:

0 commit comments

Comments
 (0)