Skip to content

Support USubb/IMul/UMul/UDiv in the DirectX backend #128638

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

Open
farzonl opened this issue Feb 25, 2025 · 0 comments
Open

Support USubb/IMul/UMul/UDiv in the DirectX backend #128638

farzonl opened this issue Feb 25, 2025 · 0 comments

Comments

@farzonl
Copy link
Member

farzonl commented Feb 25, 2025

The plan for the frontend changes is still open for DXC so no frontend change is needed just yet for HLSL:
microsoft/DirectXShaderCompiler#6727

Since there still is no HLSL intrinsic yet for most of these It seems like these DXIL Ops exist primarily to convert DXBC (DirectX Bytecode) to DXIL.

What is defined is we need a way to lower llvmir to these DXIL opcodes:

ID Name Description
41 IMul multiply of 32-bit operands to produce the correct full 64-bit result.
42 UMul multiply of 32-bit operands to produce the correct full 64-bit result.
43 UDiv unsigned divide of the 32-bit operand src0 by the 32-bit operand src1.
45 USubb unsigned subtract of 32-bit operands with the borrow
DXILOP LLVM Intrinsic
USubb Intrinsic::usub_with_overflow
UMul Intrinsic::umul_with_overflow
IMul Intrinsic::smul_with_overflow
UDiv TBD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants