Skip to content
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
7 changes: 7 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,16 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
case X86::BI__builtin_ia32_vp2intersect_d_512:
case X86::BI__builtin_ia32_vp2intersect_d_256:
case X86::BI__builtin_ia32_vp2intersect_d_128:
cgm.errorNYI(expr->getSourceRange(),
std::string("unimplemented X86 builtin call: ") +
getContext().BuiltinInfo.getName(builtinID));
return {};
case X86::BI__builtin_ia32_vpmultishiftqb128:
return emitIntrinsicCallOp(*this, expr, "x86_avx512_pmultishift_qb_128", ops[0].getType(), ops);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return emitIntrinsicCallOp(*this, expr, "x86_avx512_pmultishift_qb_128", ops[0].getType(), ops);
return emitIntrinsicCallOp(builder, getLoc(expr->getExprLoc()), "x86_avx512_pmultishift_qb_128", ops[0].getType(), ops);

You'll need to rebase your PR to get this new signature. It's been updated recently.

case X86::BI__builtin_ia32_vpmultishiftqb256:
return emitIntrinsicCallOp(*this, expr, "x86_avx512_pmultishift_qb_256", ops[0].getType(), ops);
case X86::BI__builtin_ia32_vpmultishiftqb512:
return emitIntrinsicCallOp(*this, expr, "x86_avx512_pmultishift_qb_512", ops[0].getType(), ops);
case X86::BI__builtin_ia32_vpshufbitqmb128_mask:
case X86::BI__builtin_ia32_vpshufbitqmb256_mask:
case X86::BI__builtin_ia32_vpshufbitqmb512_mask:
Expand Down
11 changes: 11 additions & 0 deletions clang/test/CIR/CodeGen/X86/builtin_multishift.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx512vbmi \
// RUN: -fclangir -emit-cir %s -o - | FileCheck %s
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx512vbmi \
// RUN: -fclangir -emit-cir %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx512vbmi -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CIR %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx512vbmi -fclangir -emit-llvm %s -o %t-cir.ll
// RUN: FileCheck --input-file=%t-cir.ll --check-prefix=LLVM %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +avx512vbmi -emit-llvm %s -o %t.ll
// RUN: FileCheck --input-file=%t.ll --check-prefix=OGCG %s

These lines perform the three variations of checks we expect.

However, this test should be moved to clang/test/CIR/CodeGenBuiltins/X86/avx512vbmi-builtins.c which is also being added in #169582


#include <immintrin.h>
__m512i test_multishift(__m512i x, __m512i y) {
return _mm512_multishift_epi64_epi8(x, y);
}

// // CHECK: cir.func @test_multishift
// // CHECK: cir.call @__builtin_ia32_vpmultishiftqb512