Skip to content
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

[CIR][CIRGen][Builtin][Neon] Lower neon_vaddd_s64 and neon_vaddd_u64 #1255

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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
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
Loading