Lines Matching defs:inst

287     static void write_one_instruction(Val id, const OptimizedInstruction& inst, SkWStream* o) {
288 Op op = inst.op;
289 Val x = inst.x,
290 y = inst.y,
291 z = inst.z,
292 w = inst.w;
293 int immA = inst.immA,
294 immB = inst.immB,
295 immC = inst.immC;
386 const OptimizedInstruction& inst = optimized[id];
387 write(o, inst.can_hoist ? "↑ " : " ");
388 write_one_instruction(id, inst, o);
405 const InterpreterInstruction& inst = fImpl->instructions[i];
406 Op op = inst.op;
407 Reg d = inst.d,
408 x = inst.x,
409 y = inst.y,
410 z = inst.z,
411 w = inst.w;
412 int immA = inst.immA,
413 immB = inst.immB,
414 immC = inst.immC;
500 const Instruction& inst = program[id];
501 for (Val arg : {inst.x, inst.y, inst.z, inst.w}) {
515 const Instruction& inst = program[id];
516 if (inst.op != Op::trace_line) {
522 if (inst.immA == last.immA && inst.x == last.x) {
536 Instruction& inst = program[id];
537 for (Val* arg : {&inst.x, &inst.y, &inst.z, &inst.w}) {
548 auto it = std::remove_if(program.begin(), program.end(), [&](const Instruction& inst) {
549 Val id = (Val)(&inst - program.data());
560 Instruction inst = program[id];
561 optimized[id] = {inst.op, inst.x,inst.y,inst.z,inst.w,
562 inst.immA,inst.immB,inst.immC,
568 OptimizedInstruction& inst = optimized[id];
569 for (Val arg : {inst.x, inst.y, inst.z, inst.w}) {
576 for (OptimizedInstruction& inst : optimized) {
578 if (is_always_varying(inst.op) || is_trace(inst.op)) {
579 inst.can_hoist = false;
583 if (inst.can_hoist) {
584 for (Val arg : {inst.x, inst.y, inst.z, inst.w}) {
585 if (arg != NA) { inst.can_hoist &= optimized[arg].can_hoist; }
591 for (OptimizedInstruction& inst : optimized) {
592 if (!inst.can_hoist /*i.e. we're in the loop, so the arguments are used-in-loop*/) {
593 for (Val arg : {inst.x, inst.y, inst.z, inst.w}) {
639 uint32_t InstructionHash::operator()(const Instruction& inst, uint32_t seed) const {
640 return SkOpts::hash(&inst, sizeof(inst), seed);
646 Val Builder::push(Instruction inst) {
653 if (!touches_varying_memory(inst.op) && !is_trace(inst.op)) {
654 if (Val* id = fIndex.find(inst)) {
659 fProgram.push_back(inst);
660 fIndex.set(inst, id);
2532 uint32_t inst;
2533 memcpy(&inst, fCode + ref, 4);
2536 int disp = (int)(inst << 8) >> 13;
2541 inst = ((disp << 5) & (19_mask << 5))
2542 | ((inst ) & ~(19_mask << 5));
2543 memcpy(fCode + ref, &inst, 4);
3125 const OptimizedInstruction& inst = instructions[id];
3136 const Val x = inst.x, y = inst.y, z = inst.z, w = inst.w;
3143 if (inst.death != id) {
3176 auto push_instruction = [&](Val id, const OptimizedInstruction& inst) {
3178 inst.op,
3180 lookup_register(inst.x),
3181 lookup_register(inst.y),
3182 lookup_register(inst.z),
3183 lookup_register(inst.w),
3184 inst.immA,
3185 inst.immB,
3186 inst.immC,
3192 const OptimizedInstruction& inst = instructions[id];
3193 if (inst.can_hoist) {
3194 push_instruction(id, inst);
3199 const OptimizedInstruction& inst = instructions[id];
3200 if (!inst.can_hoist) {
3201 push_instruction(id, inst);
3410 const OptimizedInstruction& inst = instructions[id];
3411 const Op op = inst.op;
3412 const Val x = inst.x,
3413 y = inst.y,
3414 z = inst.z,
3415 w = inst.w;
3416 const int immA = inst.immA,
3417 immB = inst.immB,
3418 immC = inst.immC;