1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +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

@ -1264,6 +1264,26 @@ namespace dxvk {
src.at(0).id, src.at(1).id); src.at(0).id, src.at(1).id);
break; 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 // Conversion instructions
case DxbcOpcode::ItoF: case DxbcOpcode::ItoF:

@ -623,13 +623,25 @@ namespace dxvk {
/* USubb */ /* USubb */
{ }, { },
/* CountBits */ /* CountBits */
{ }, { 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* FirstBitHi */ /* FirstBitHi */
{ }, { 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* FirstBitLo */ /* FirstBitLo */
{ }, { 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* FirstBitShi */ /* FirstBitShi */
{ }, { 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* UBfe */ /* UBfe */
{ 4, DxbcInstClass::BitExtract, { { 4, DxbcInstClass::BitExtract, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 }, { DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },