| 2108 | } |
| 2109 | |
| 2110 | spv_number_kind_t Differ::GetTypeNumberKind(const IdInstructions& id_to, |
| 2111 | uint32_t id, |
| 2112 | uint32_t* number_bit_width) { |
| 2113 | const opt::Instruction* type_inst = GetInst(id_to, id); |
| 2114 | if (!spvOpcodeIsScalarType(type_inst->opcode())) { |
| 2115 | type_inst = GetInst(id_to, type_inst->type_id()); |
| 2116 | } |
| 2117 | |
| 2118 | switch (type_inst->opcode()) { |
| 2119 | case spv::Op::OpTypeInt: |
| 2120 | *number_bit_width = type_inst->GetSingleWordOperand(1); |
| 2121 | return type_inst->GetSingleWordOperand(2) == 0 ? SPV_NUMBER_UNSIGNED_INT |
| 2122 | : SPV_NUMBER_SIGNED_INT; |
| 2123 | break; |
| 2124 | case spv::Op::OpTypeFloat: |
| 2125 | *number_bit_width = type_inst->GetSingleWordOperand(1); |
| 2126 | return SPV_NUMBER_FLOATING; |
| 2127 | default: |
| 2128 | assert(false && "Unreachable"); |
| 2129 | return SPV_NUMBER_NONE; |
| 2130 | } |
| 2131 | } |
| 2132 | |
| 2133 | void Differ::MatchCapabilities() { |
| 2134 | MatchPreambleInstructions(src_->capabilities(), dst_->capabilities()); |
nothing calls this directly
no test coverage detected