Skip to content

Correct LLVM linking of Intel BMI intrinsics `pdep{8,16}` and `pext{8,16}`

recursion-ninja requested to merge wip/fix-26065 into master

This patch fixes #26065 (closed).

The LLVM interface does not expose bindings to the following Intel Bit Manipulation Instructions (BMI):

  • llvm.x86.bmi.pdep.8
  • llvm.x86.bmi.pdep.16
  • llvm.x86.bmi.pext.8
  • llvm.x86.bmi.pext.16

In cases where a user calls one of these operations, the call is instead made to llvm.x86.bmi.{pdep,pext}.32, and a pre/post-operation truncation id performed to constrain the logical value range to W8 or W16.

I have added the T26065 test case based on the minimal reproducer provided by @aratamizuki for issue #26065 (closed).

Edited by recursion-ninja

Merge request reports

Loading