1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-01 19:29:16 +01:00

[dxbc] Implement CountBits/FirstBit instructions

This commit is contained in:
Philip Rebohle 2018-02-04 13:14:23 +01:00
parent 495f58370c
commit 49f13cfdc4
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 36 additions and 4 deletions

View File

@ -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:

View File

@ -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 },