Skip to content

Commit

Permalink
[CIR][CIRGen][Builtin][Neon] Lower neon_vsubd_s64 and neon_vsubd_u64
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Dec 24, 2024
1 parent 04d7dcf commit 0517929
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 @@ -3785,7 +3785,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
llvm_unreachable("NEON::BI__builtin_neon_vaddd_u64 NYI");
case NEON::BI__builtin_neon_vsubd_s64:
case NEON::BI__builtin_neon_vsubd_u64:
llvm_unreachable("NEON::BI__builtin_neon_vsubd_u64 NYI");
return builder.createSub(Ops[0], emitScalarExpr(E->getArg(1)));
case NEON::BI__builtin_neon_vqdmlalh_s16:
case NEON::BI__builtin_neon_vqdmlslh_s16: {
llvm_unreachable("NEON::BI__builtin_neon_vqdmlslh_s16 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 @@ -9895,19 +9895,27 @@ poly16x8_t test_vmull_p8(poly8x8_t a, poly8x8_t b) {
// return vaddd_u64(a, b);
// }

// NYI-LABEL: @test_vsubd_s64(
// NYI: [[VSUBD_I:%.*]] = sub i64 %a, %b
// NYI: ret i64 [[VSUBD_I]]
// int64_t test_vsubd_s64(int64_t a, int64_t b) {
// return vsubd_s64(a, b);
// }
int64_t test_vsubd_s64(int64_t a, int64_t b) {
return vsubd_s64(a, b);

// NYI-LABEL: @test_vsubd_u64(
// NYI: [[VSUBD_I:%.*]] = sub i64 %a, %b
// NYI: ret i64 [[VSUBD_I]]
// uint64_t test_vsubd_u64(uint64_t a, uint64_t b) {
// return vsubd_u64(a, b);
// }
// CIR-LABEL: vsubd_s64
// CIR: [[v3:%.*]] = cir.binop(sub, [[v1:%.*]], [[v2:%.*]]) : !s64i

// LLVM-LABEL: @test_vsubd_s64(
// LLVM: [[VSUBD_I:%.*]] = sub i64 [[a:%.*]], [[b:%.*]]
// LLVM: ret i64 [[VSUBD_I]]
}

uint64_t test_vsubd_u64(uint64_t a, uint64_t b) {
return vsubd_u64(a, b);

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

// LLVM-LABEL: @test_vsubd_u64(
// LLVM: [[VSUBD_I:%.*]] = sub i64 [[a:%.*]], [[b:%.*]]
// LLVM: ret i64 [[VSUBD_I]]
}

// NYI-LABEL: @test_vqaddb_s8(
// NYI: [[TMP0:%.*]] = insertelement <8 x i8> poison, i8 %a, i64 0
Expand Down

0 comments on commit 0517929

Please sign in to comment.