Skip to content
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

Unimplemented x86 llvm intrinsic vcvtph2ps #1545

Open
DGriffin91 opened this issue Nov 21, 2024 · 4 comments
Open

Unimplemented x86 llvm intrinsic vcvtph2ps #1545

DGriffin91 opened this issue Nov 21, 2024 · 4 comments
Labels
A-core-arch Area: Necessary for full core::arch support C-enhancement Category: An issue proposing an enhancement or a PR with one. O-x86_64 Target: x64 processors

Comments

@DGriffin91
Copy link

DGriffin91 commented Nov 21, 2024

When compiling half I noticed two warnings for a missing x86 llvm intrinsic vcvtph2ps:

warning: unsupported x86 llvm intrinsic llvm.x86.vcvtph2ps.128; replacing with trap
warning: unsupported x86 llvm intrinsic llvm.x86.vcvtph2ps.256; replacing with trap
trap at Instance { def: Item(DefId(2:23219 ~ core[4322]::core_arch::x86::f16c::_mm_cvtps_ph)), args: [0_i32] } (_ZN4core9core_arch3x864f16c12_mm_cvtps_ph17heb7efe16215ebb1fE): llvm.x86.vcvtps2ph.128

Thanks for all your work on the cranelift backend for rust!

Edit: I guess this is might be related to #1461

@bjorn3
Copy link
Member

bjorn3 commented Nov 21, 2024

Support for f16 and f128 is basically non-existent in Cranelift so I can't implement these intrinsics the regular way of emulating it using scalar operations. Instead I did have to use inline asm to directly emit the respective x86 instructions, which makes compilation slower as it involves spawning another rustc instance with the LLVM backend to do the compilation of assembly for us. I have some ideas about how to handle this better in the future, but those ideas are not something that will be implemented within a couple of weeks.

@bjorn3 bjorn3 added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-core-arch Area: Necessary for full core::arch support O-x86_64 Target: x64 processors labels Nov 21, 2024
@tgross35
Copy link
Contributor

(some more info at #1461)

@DGriffin91
Copy link
Author

DGriffin91 commented Nov 21, 2024

@bjorn3 Does Cranelift want to eventually support f16 and f128 more directly or is the asm route the plan for the foreseeable future?

@bjorn3
Copy link
Member

bjorn3 commented Nov 21, 2024

Cranelift will probably have to support it eventually, but the asm route will be much quicker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core-arch Area: Necessary for full core::arch support C-enhancement Category: An issue proposing an enhancement or a PR with one. O-x86_64 Target: x64 processors
Projects
None yet
Development

No branches or pull requests

3 participants