diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 8bcc72ac..c4d092f5 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -1264,6 +1264,26 @@ namespace dxvk { src.at(0).id, src.at(1).id); break; + case DxbcOpcode::CountBits: + dst.id = m_module.opBitCount( + typeId, src.at(0).id); + break; + + case DxbcOpcode::FirstBitLo: + dst.id = m_module.opFindILsb( + typeId, src.at(0).id); + break; + + case DxbcOpcode::FirstBitHi: + dst.id = m_module.opFindUMsb( + typeId, src.at(0).id); + break; + + case DxbcOpcode::FirstBitShi: + dst.id = m_module.opFindSMsb( + typeId, src.at(0).id); + break; + /////////////////////////// // Conversion instructions case DxbcOpcode::ItoF: diff --git a/src/dxbc/dxbc_defs.cpp b/src/dxbc/dxbc_defs.cpp index cd265a5e..8be6e7a8 100644 --- a/src/dxbc/dxbc_defs.cpp +++ b/src/dxbc/dxbc_defs.cpp @@ -623,13 +623,25 @@ namespace dxvk { /* USubb */ { }, /* CountBits */ - { }, + { 2, DxbcInstClass::VectorAlu, { + { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, + { DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 }, + } }, /* FirstBitHi */ - { }, + { 2, DxbcInstClass::VectorAlu, { + { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, + { DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 }, + } }, /* FirstBitLo */ - { }, + { 2, DxbcInstClass::VectorAlu, { + { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, + { DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 }, + } }, /* FirstBitShi */ - { }, + { 2, DxbcInstClass::VectorAlu, { + { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, + { DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 }, + } }, /* UBfe */ { 4, DxbcInstClass::BitExtract, { { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },