| 171 | } |
| 172 | |
| 173 | spv_result_t ValidateBitFieldExtract(ValidationState_t& _, |
| 174 | const Instruction* inst) { |
| 175 | const spv::Op opcode = inst->opcode(); |
| 176 | const uint32_t base_type = _.GetOperandTypeId(inst, 2); |
| 177 | const uint32_t offset_type = _.GetOperandTypeId(inst, 3); |
| 178 | const uint32_t count_type = _.GetOperandTypeId(inst, 4); |
| 179 | |
| 180 | if (spv_result_t error = ValidateBaseType(_, inst, base_type)) { |
| 181 | return error; |
| 182 | } |
| 183 | |
| 184 | if (!offset_type || !_.IsIntScalarType(offset_type)) |
| 185 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 186 | << "Expected Offset Type to be int scalar: " |
| 187 | << spvOpcodeString(opcode); |
| 188 | |
| 189 | if (!count_type || !_.IsIntScalarType(count_type)) |
| 190 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 191 | << "Expected Count Type to be int scalar: " |
| 192 | << spvOpcodeString(opcode); |
| 193 | return SPV_SUCCESS; |
| 194 | } |
| 195 | |
| 196 | spv_result_t ValidateBitReverse(ValidationState_t& _, const Instruction* inst) { |
| 197 | const uint32_t base_type = _.GetOperandTypeId(inst, 2); |
no test coverage detected