Skip to content

Commit

Permalink
Fix type checking errors
Browse files Browse the repository at this point in the history
  • Loading branch information
colesbury committed Aug 7, 2024
1 parent 479ca70 commit ae1c018
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Tools/cases_generator/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def flush_single_var(self, out: CWriter, var_name: str, outputs: list[StackItem]
base_offset = self.base_offset.copy()
top_offset = self.top_offset.copy()
for var in self.variables:
base_offset.push(var)
base_offset.push(var.item)
for var in outputs:
if any(var == v.item for v in self.variables):
# The variable is already on the stack, such as a peeked value
Expand Down
8 changes: 4 additions & 4 deletions Tools/cases_generator/tier1_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ def write_uop(
emitter.emit(f"(void){cache.name};\n")
offset += cache.size
emitter.emit_tokens(uop, stack, inst)
for var in outputs:
if var.name in uop.deferred_refs.values():
for output in outputs:
if output.name in uop.deferred_refs.values():
# We've already spilled this when emitting tokens
var.cached = False
emitter.emit(stack.push(var))
output.cached = False
emitter.emit(stack.push(output))
if braces:
emitter.out.start_line()
emitter.emit("}\n")
Expand Down
8 changes: 4 additions & 4 deletions Tools/cases_generator/tier2_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ def write_uop(uop: Uop, emitter: Emitter, stack: Stack) -> None:
cast = f"uint{cache.size*16}_t"
emitter.emit(f"{type}{cache.name} = ({cast})CURRENT_OPERAND();\n")
emitter.emit_tokens(uop, stack, None)
for var in outputs:
if var.name in uop.deferred_refs.values():
for output in outputs:
if output.name in uop.deferred_refs.values():
# We've already spilled this when emitting tokens
var.cached = False
emitter.emit(stack.push(var))
output.cached = False
emitter.emit(stack.push(output))
except StackError as ex:
raise analysis_error(ex.args[0], uop.body[0]) from None

Expand Down

0 comments on commit ae1c018

Please sign in to comment.