Skip to content

Commit

Permalink
[CIR][CIRGen][Builtin][Neon] Lower neon_vaddd_s64 and `neon_vaddd_u…
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper authored Jan 6, 2025
1 parent a477dfa commit 6d99bda
Show file tree
Hide file tree
Showing 2 changed files with 23 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 @@ -3786,7 +3786,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
34 changes: 22 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,29 @@ 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: {{%.*}} = cir.binop(add, {{%.*}}, {{%.*}}) : !s64i

// LLVM-LABEL: @test_vaddd_s64
// LLVM-SAME: (i64 [[a:%.]], i64 [[b:%.]])
// 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: {{%.*}} = cir.binop(add, {{%.*}}, {{%.*}}) : !u64i

// LLVM-LABEL: @test_vaddd_u64
// LLVM-SAME: (i64 [[a:%.]], i64 [[b:%.]])
// 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 6d99bda

Please sign in to comment.