From 35bba14b2cb2df3204b205fb1e7b90c59f72f06b Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Mon, 26 Jan 2026 17:48:27 +0100 Subject: [PATCH 1/2] IR: Remove malformatted comments from json Presumably this was done as a hack to highlight the line in red when rendering documentation to markdown. Since it's only used for two instructions, drop this use to ease generation of C++ docstrings. --- FEXCore/Source/Interface/IR/IR.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FEXCore/Source/Interface/IR/IR.json b/FEXCore/Source/Interface/IR/IR.json index 565d4286d..ee933aed7 100644 --- a/FEXCore/Source/Interface/IR/IR.json +++ b/FEXCore/Source/Interface/IR/IR.json @@ -488,7 +488,7 @@ "HasSideEffects": true, "Desc": ["Spills an SSA value to memory", "Spill slots are register allocated and has live ranges calculated to handle slot calculation", - "```diff\n- !Don't use this op. It is for RA to handle spilling and filling!\n```" + "!Don't use this op. It is for RA to handle spilling and filling!" ], "EmitValidation": [ "WalkFindRegClass($Value) == $Class" @@ -498,7 +498,7 @@ "SSA = FillRegister OpSize:#Size, OpSize:#ElementSize, u32:$Slot, RegisterClass:$Class": { "Desc": ["Fills a register from a spill slot", "Spill slots are register allocated and has live ranges calculated to handle slot calculation", - "```diff\n- !Don't use this op. It is for RA to handle spilling and filling!\n```" + "!Don't use this op. It is for RA to handle spilling and filling!" ], "DestSize": "Size", "ElementSize": "ElementSize" From 7c31ca2ac2e9b58fa5091543d0a46f6648d4bee9 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Mon, 26 Jan 2026 17:43:23 +0100 Subject: [PATCH 2/2] json_ir_generator: Generate docstring for IR op emitters --- FEXCore/Scripts/json_ir_generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FEXCore/Scripts/json_ir_generator.py b/FEXCore/Scripts/json_ir_generator.py index 66bf96dc6..27a7cefb2 100755 --- a/FEXCore/Scripts/json_ir_generator.py +++ b/FEXCore/Scripts/json_ir_generator.py @@ -678,6 +678,7 @@ def print_ir_allocator_helpers(): # Generate helpers with operands for op in IROps: if op.Name != "Last": + output_file.write("\t///\n".join(["\t/// {}\n" .format(comment) for comment in op.Desc])) output_file.write("\tIRPair _{}(" .format(op.Name, op.Name)) # Output SSA args first @@ -751,6 +752,7 @@ def print_ir_allocator_helpers(): # Now do the OrderedNode * version if necessary if op.SSAArgNum: + output_file.write("\t///\n".join(["\t/// {}\n" .format(comment) for comment in op.Desc])) output_file.write("\tIRPair _{}(" .format(op.Name, op.Name)) for i, arg in enumerate(op.Arguments):