| 2982 | } |
| 2983 | |
| 2984 | spv_result_t ValidateInt32Or64Operand(ValidationState_t& _, |
| 2985 | const Instruction* inst, |
| 2986 | uint32_t operand_index, |
| 2987 | const char* opcode_name, |
| 2988 | const char* operand_name) { |
| 2989 | const auto type_id = |
| 2990 | _.FindDef(inst->GetOperandAs<uint32_t>(operand_index))->type_id(); |
| 2991 | if (!_.IsIntScalarType(type_id) || |
| 2992 | !(_.GetBitWidth(type_id) == 32 || _.GetBitWidth(type_id) == 64)) { |
| 2993 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 2994 | << opcode_name << " " << operand_name << " type <id> " |
| 2995 | << _.getIdName(type_id) << " is not a 32 or 64 bit integer."; |
| 2996 | } |
| 2997 | |
| 2998 | return SPV_SUCCESS; |
| 2999 | } |
| 3000 | |
| 3001 | spv_result_t ValidateCooperativeVectorPointer(ValidationState_t& _, |
| 3002 | const Instruction* inst, |
no test coverage detected