MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ValidateBitFieldExtract

Function ValidateBitFieldExtract

source/val/validate_bitwise.cpp:173–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173spv_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
196spv_result_t ValidateBitReverse(ValidationState_t& _, const Instruction* inst) {
197 const uint32_t base_type = _.GetOperandTypeId(inst, 2);

Callers 1

BitwisePassFunction · 0.85

Calls 6

ValidateBaseTypeFunction · 0.85
spvOpcodeStringFunction · 0.85
GetOperandTypeIdMethod · 0.80
IsIntScalarTypeMethod · 0.80
diagMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected