[dxbc] Implemented BfRev instruction

This commit is contained in:
Philip Rebohle 2018-02-15 09:41:48 +01:00
parent 0c2058e8c4
commit 563d4582ab
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 26 additions and 1 deletions

View File

@ -1324,6 +1324,11 @@ namespace dxvk {
typeId, src.at(0).id);
break;
case DxbcOpcode::BfRev:
dst.id = m_module.opBitReverse(
typeId, src.at(0).id);
break;
///////////////////////////
// Conversion instructions
case DxbcOpcode::ItoF:

View File

@ -693,7 +693,10 @@ namespace dxvk {
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* BfRev */
{ },
{ 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
} },
/* Swapc */
{ 5, DxbcInstClass::VectorCmov, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },

View File

@ -946,6 +946,19 @@ namespace dxvk {
}
uint32_t SpirvModule::opBitReverse(
uint32_t resultType,
uint32_t operand) {
uint32_t resultId = this->allocateId();
m_code.putIns (spv::OpBitReverse, 4);
m_code.putWord(resultType);
m_code.putWord(resultId);
m_code.putWord(operand);
return resultId;
}
uint32_t SpirvModule::opFindILsb(
uint32_t resultType,
uint32_t operand) {

View File

@ -381,6 +381,10 @@ namespace dxvk {
uint32_t resultType,
uint32_t operand);
uint32_t opBitReverse(
uint32_t resultType,
uint32_t operand);
uint32_t opFindILsb(
uint32_t resultType,
uint32_t operand);