Skip to content

Commit

Permalink
Merge pull request #4251 from Sonicadvance1/ir_numelements_to_element…
Browse files Browse the repository at this point in the history
…size

IR: Change convention from number of elements to elementsize
  • Loading branch information
lioncash authored Jan 4, 2025
2 parents f51812a + 1ecfa32 commit a6c67ca
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 148 deletions.
12 changes: 6 additions & 6 deletions FEXCore/Scripts/json_ir_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class OpDefinition:
HasDest: bool
DestType: str
DestSize: str
NumElements: str
ElementSize: str
OpClass: str
HasSideEffects: bool
ImplicitFlagClobber: bool
Expand All @@ -67,7 +67,7 @@ def __init__(self):
self.HasDest = False
self.DestType = None
self.DestSize = None
self.NumElements = None
self.ElementSize = None
self.OpClass = None
self.OpSize = 0
self.HasSideEffects = False
Expand Down Expand Up @@ -234,8 +234,8 @@ def parse_ops(ops):
if "DestSize" in op_val:
OpDef.DestSize = op_val["DestSize"]

if "NumElements" in op_val:
OpDef.NumElements = op_val["NumElements"]
if "ElementSize" in op_val:
OpDef.ElementSize = op_val["ElementSize"]

if len(op_class):
OpDef.OpClass = op_class
Expand Down Expand Up @@ -745,10 +745,10 @@ def print_ir_allocator_helpers():
if op.DestSize != None:
output_file.write("\t\t_Op.first->Header.Size = {};\n".format(op.DestSize))

if op.NumElements == None:
if op.ElementSize == None:
output_file.write("\t\t_Op.first->Header.ElementSize = _Op.first->Header.Size;\n")
else:
output_file.write("\t\t_Op.first->Header.ElementSize = _Op.first->Header.Size / ({});\n".format(op.NumElements))
output_file.write("\t\t_Op.first->Header.ElementSize = {};\n".format(op.ElementSize))

# Insert validation here
if op.EmitValidation != None:
Expand Down
Loading

0 comments on commit a6c67ca

Please sign in to comment.