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

Function desugar_inst

Tools/cases_generator/analyzer.py:1103–1128  ·  view source on GitHub ↗
(
    inst: parser.InstDef, instructions: dict[str, Instruction], uops: dict[str, Uop]
)

Source from the content-addressed store, hash-verified

1101
1102
1103def desugar_inst(
1104 inst: parser.InstDef, instructions: dict[str, Instruction], uops: dict[str, Uop]
1105) -> None:
1106 assert inst.kind == "inst"
1107 name = inst.name
1108 op_inputs: list[parser.InputEffect] = []
1109 parts: list[Part] = []
1110 uop_index = -1
1111 # Move unused cache entries to the Instruction, removing them from the Uop.
1112 for input in inst.inputs:
1113 if isinstance(input, parser.CacheEffect) and input.name == "unused":
1114 parts.append(Skip(input.size))
1115 else:
1116 op_inputs.append(input)
1117 if uop_index < 0:
1118 uop_index = len(parts)
1119 # Place holder for the uop.
1120 parts.append(Skip(0))
1121 uop = make_uop("_" + inst.name, inst, op_inputs, uops)
1122 uop.implicitly_created = True
1123 uops[inst.name] = uop
1124 if uop_index < 0:
1125 parts.append(uop)
1126 else:
1127 parts[uop_index] = uop
1128 add_instruction(inst.first_token, name, parts, instructions)
1129
1130
1131def add_macro(

Callers 1

analyze_forestFunction · 0.85

Calls 4

make_uopFunction · 0.85
add_instructionFunction · 0.85
SkipClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…