MCPcopy Index your code
hub / github.com/python/cpython / _small_const_1

Method _small_const_1

Tools/jit/_optimizers.py:618–626  ·  view source on GitHub ↗
(self, inst: Instruction)

Source from the content-addressed store, hash-verified

616 return reg.strip()
617
618 def _small_const_1(self, inst: Instruction) -> tuple[str, Instruction | None]:
619 assert inst.kind is InstructionKind.SMALL_CONST_1
620 assert inst.target is not None
621 if "16" in inst.target:
622 return "", None
623 pre, _ = inst.text.split(inst.name)
624 return "16a", Instruction(
625 InstructionKind.OTHER, "movz", f"{pre}movz {self._get_reg(inst)}, 0", None
626 )
627
628 def _small_const_2(self, inst: Instruction) -> tuple[str, Instruction | None]:
629 assert inst.kind is InstructionKind.SMALL_CONST_2

Callers

nothing calls this directly

Calls 3

_get_regMethod · 0.95
InstructionClass · 0.70
splitMethod · 0.45

Tested by

no test coverage detected