rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.52k stars 94 forks source link

Unimplemented x86 llvm intrinsic pcmpestrm128 #1418

Closed pothos closed 7 months ago

pothos commented 7 months ago

When compiling hard-xml I noticed two warnings for a missing x86 llvm intrinsic pcmpestrm128:

warning: unsupported x86 llvm intrinsic llvm.x86.sse42.pcmpestri128; replacing with trap

Edit: And of course a huge thank you for your work and congratulations for getting it into rustup!

bjorn3 commented 7 months ago

That is quite a complex intrinsic: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cmpestri&ig_expand=939 I don't think I will get around implementing it in the next couple of days.

And of course a huge thank you for your work and congratulations for getting it into rustup!

:heart:

bjorn3 commented 7 months ago

Implemented this using inline asm to directly call the original instruction over at https://github.com/rust-lang/rustc_codegen_cranelift/tree/more_simd_intrinsics

pothos commented 7 months ago

Thanks a lot, tested it and it works :)

bjorn3 commented 7 months ago

A fix is available on the latest nightly.

pothos commented 7 months ago

Great that you managed to merge it!

With new instruction set extensions getting published almost every year this topic never is really done, but rather a nice goal post would be to cover all instructions set extensions older than X years. The panic unwinding is probably more generous topic in this regard and when it's done it will mostly be done (except for occasional bug reports), or?

bjorn3 commented 7 months ago

So far I have been implementing new vendor intrinsics as people report them actually being used. There are a lot of them that basically nobody uses. Unless I know of a user to test it with, it is hard for me to be confident that I correctly implemented a intrinsic. If you find other unimplemented intrinsics that some program or library needs, please do let me know.