| 141 | } |
| 142 | |
| 143 | spv_result_t ValidateBitFieldInsert(ValidationState_t& _, |
| 144 | const Instruction* inst) { |
| 145 | const spv::Op opcode = inst->opcode(); |
| 146 | const uint32_t result_type = inst->type_id(); |
| 147 | const uint32_t base_type = _.GetOperandTypeId(inst, 2); |
| 148 | const uint32_t insert_type = _.GetOperandTypeId(inst, 3); |
| 149 | const uint32_t offset_type = _.GetOperandTypeId(inst, 4); |
| 150 | const uint32_t count_type = _.GetOperandTypeId(inst, 5); |
| 151 | |
| 152 | if (spv_result_t error = ValidateBaseType(_, inst, base_type)) { |
| 153 | return error; |
| 154 | } |
| 155 | |
| 156 | if (insert_type != result_type) |
| 157 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 158 | << "Expected Insert Type to be equal to Result Type: " |
| 159 | << spvOpcodeString(opcode); |
| 160 | |
| 161 | if (!offset_type || !_.IsIntScalarType(offset_type)) |
| 162 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 163 | << "Expected Offset Type to be int scalar: " |
| 164 | << spvOpcodeString(opcode); |
| 165 | |
| 166 | if (!count_type || !_.IsIntScalarType(count_type)) |
| 167 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 168 | << "Expected Count Type to be int scalar: " |
| 169 | << spvOpcodeString(opcode); |
| 170 | return SPV_SUCCESS; |
| 171 | } |
| 172 | |
| 173 | spv_result_t ValidateBitFieldExtract(ValidationState_t& _, |
| 174 | const Instruction* inst) { |
no test coverage detected