Skip to content

Commit

Permalink
[CIR][CIRGen][Builtin][Neon] Lower neon_vaddd_s64 and neon_vaddd_u64
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Dec 24, 2024
1 parent 04d7dcf commit d268604
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3782,7 +3782,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
}
case NEON::BI__builtin_neon_vaddd_s64:
case NEON::BI__builtin_neon_vaddd_u64:
llvm_unreachable("NEON::BI__builtin_neon_vaddd_u64 NYI");
return builder.createAdd(Ops[0], emitScalarExpr(E->getArg(1)));
case NEON::BI__builtin_neon_vsubd_s64:
case NEON::BI__builtin_neon_vsubd_u64:
llvm_unreachable("NEON::BI__builtin_neon_vsubd_u64 NYI");
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 @@ -9881,19 +9881,27 @@ poly16x8_t test_vmull_p8(poly8x8_t a, poly8x8_t b) {
// return vmull_high_p8(a, b);
// }

// NYI-LABEL: @test_vaddd_s64(
// NYI: [[VADDD_I:%.*]] = add i64 %a, %b
// NYI: ret i64 [[VADDD_I]]
// int64_t test_vaddd_s64(int64_t a, int64_t b) {
// return vaddd_s64(a, b);
// }
int64_t test_vaddd_s64(int64_t a, int64_t b) {
return vaddd_s64(a, b);

// NYI-LABEL: @test_vaddd_u64(
// NYI: [[VADDD_I:%.*]] = add i64 %a, %b
// NYI: ret i64 [[VADDD_I]]
// uint64_t test_vaddd_u64(uint64_t a, uint64_t b) {
// return vaddd_u64(a, b);
// }
// CIR-LABEL: vaddd_s64
// CIR: [[v3:%.*]] = cir.binop(add, [[v1:%.*]], [[v2:%.*]]) : !s64i

// LLVM-LABEL: @test_vaddd_s64(
// LLVM: [[VADDD_I:%.*]] = add i64 [[a:%.*]], [[b:%.*]]
// LLVM: ret i64 [[VADDD_I]]
}

uint64_t test_vaddd_u64(uint64_t a, uint64_t b) {
return vaddd_u64(a, b);

// CIR-LABEL: vaddd_u64
// CIR: [[v3:%.*]] = cir.binop(add, [[v1:%.*]], [[v2:%.*]]) : !u64i

// LLVM-LABEL: @test_vaddd_u64(
// LLVM: [[VADDD_I:%.*]] = add i64 [[a:%.*]], [[b:%.*]]
// LLVM: ret i64 [[VADDD_I]]
}

// NYI-LABEL: @test_vsubd_s64(
// NYI: [[VSUBD_I:%.*]] = sub i64 %a, %b
Expand Down

0 comments on commit d268604

Please sign in to comment.