ImmVector getImmVector(PC opcode) { auto const op = peek_op(opcode); int numImm = numImmediates(op); for (int k = 0; k < numImm; ++k) { ArgType t = immType(op, k); if (t == BLA || t == SLA || t == I32LA || t == BLLA || t == VSA) { PC vp = getImmPtr(opcode, k)->bytes; auto const size = decode_iva(vp); return ImmVector(vp, size, t == VSA ? size : 0); } } not_reached(); }
ImmVector getImmVector(PC opcode) { auto const op = peek_op(opcode); int numImm = numImmediates(op); for (int k = 0; k < numImm; ++k) { ArgType t = immType(op, k); if (t == BLA || t == SLA || t == ILA || t == I32LA) { void* vp = getImmPtr(opcode, k); return ImmVector::createFromStream( static_cast<const int32_t*>(vp) ); } if (t == VSA) { const int32_t* vp = (int32_t*)getImmPtr(opcode, k); return ImmVector(reinterpret_cast<const uint8_t*>(vp + 1), vp[0], vp[0]); } } not_reached(); }