diff --git a/diagram/gen.py b/docs/diagram/gen.py similarity index 97% rename from diagram/gen.py rename to docs/diagram/gen.py index 8ecdc68..0ea8bce 100644 --- a/diagram/gen.py +++ b/docs/diagram/gen.py @@ -96,11 +96,11 @@ def add_line(f, from_row, from_col, from_index, to_row, to_col, to_index): print(f'', file=f) -def __lasx_xvshuf_d(): +def xvshuf_d(): global elen, vlen elen = 64 vlen = 256 - with open("__lasx_xvshuf_d.svg", "w") as f: + with open("xvshuf_d.svg", "w") as f: init(f, 3, 2) add_row(f) add_box(f, "b", "data", indices=[3, 2, 3, 2]) @@ -142,4 +142,4 @@ def __lasx_xvshuf_d(): if __name__ == "__main__": - __lasx_xvshuf_d() + xvshuf_d() diff --git a/diagram/__lasx_xvshuf_d.svg b/docs/diagram/xvshuf_d.svg similarity index 100% rename from diagram/__lasx_xvshuf_d.svg rename to docs/diagram/xvshuf_d.svg diff --git a/main.py b/main.py index 19685c3..65c555e 100644 --- a/main.py +++ b/main.py @@ -139,6 +139,11 @@ def instruction(intrinsic, instr, desc): else: tested = "" + if os.path.exists(f"docs/diagram/{file_name}.svg"): + diagram = f'![](../diagram/{file_name}.svg)' + else: + diagram = "" + global measure global cpus instr_name = instr.split(" ")[0].replace(".", "_") @@ -193,6 +198,8 @@ def instruction(intrinsic, instr, desc): {desc} +{diagram} + {examples_text} ### Operation