-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[CIR][CIRGen][Builtin][X86] Compress Store Intrinsics #169648
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -90,6 +90,14 @@ static mlir::Value getMaskVecValue(CIRGenFunction &cgf, const CallExpr *expr, | |||||
| return maskVec; | ||||||
| } | ||||||
|
|
||||||
| static mlir::Value emitX86CompressStore(CIRGenFunction &cgf, const CallExpr *expr, ArrayRef<mlir::Value> ops){ | ||||||
| auto ResultTy = cast<cir::VectorType>(ops[1].getType()); | ||||||
| mlir::Value MaskValue = getMaskVecValue(cgf, expr, ops[2], cast<cir::VectorType>(ResultTy).getSize()); | ||||||
| mlir::Value ptr = ops[0]; | ||||||
|
|
||||||
| return emitIntrinsicCallOp(cgf, expr, "masked_compressstore", ResultTy, llvm::SmallVector<mlir::Value, 3>{ops[1], ptr, MaskValue}); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| } | ||||||
| mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, | ||||||
| const CallExpr *expr) { | ||||||
| if (builtinID == Builtin::BI__builtin_cpu_is) { | ||||||
|
|
@@ -400,7 +408,12 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, | |||||
| case X86::BI__builtin_ia32_expandloadhi512_mask: | ||||||
| case X86::BI__builtin_ia32_expandloadqi128_mask: | ||||||
| case X86::BI__builtin_ia32_expandloadqi256_mask: | ||||||
| case X86::BI__builtin_ia32_expandloadqi512_mask: | ||||||
| case X86::BI__builtin_ia32_expandloadqi512_mask:{ | ||||||
| cgm.errorNYI(expr->getSourceRange(), | ||||||
| std::string("unimplemented X86 builtin call: ") + | ||||||
| getContext().BuiltinInfo.getName(builtinID)); | ||||||
| return {}; | ||||||
| } | ||||||
| case X86::BI__builtin_ia32_compressstoredf128_mask: | ||||||
| case X86::BI__builtin_ia32_compressstoredf256_mask: | ||||||
| case X86::BI__builtin_ia32_compressstoredf512_mask: | ||||||
|
|
@@ -419,6 +432,7 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID, | |||||
| case X86::BI__builtin_ia32_compressstoreqi128_mask: | ||||||
| case X86::BI__builtin_ia32_compressstoreqi256_mask: | ||||||
| case X86::BI__builtin_ia32_compressstoreqi512_mask: | ||||||
| return emitX86CompressStore(*this, expr, ops); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| case X86::BI__builtin_ia32_expanddf128_mask: | ||||||
| case X86::BI__builtin_ia32_expanddf256_mask: | ||||||
| case X86::BI__builtin_ia32_expanddf512_mask: | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #include <immintrin.h> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should be moved to |
||
|
|
||
| void test_compress_store(void *__P, __mmask8 __U, __m128d __A){ | ||
| return _mm_mask_compressstoreu_pd (__P, __U, __A); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature of
emitIntrinsicCallOphas recently been updated. This change makes the function you are adding consistent with it.