Skip to content

Commit

Permalink
Add figure to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Jul 17, 2024
1 parent 7684352 commit 1152fa8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions diagram/gen.py → docs/diagram/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ def add_line(f, from_row, from_col, from_index, to_row, to_col, to_index):
print(f'<line x1="{x1}" y1="{y1}" x2="{x2}" y2="{y2}" stroke="black" />', 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])
Expand Down Expand Up @@ -142,4 +142,4 @@ def __lasx_xvshuf_d():


if __name__ == "__main__":
__lasx_xvshuf_d()
xvshuf_d()
File renamed without changes
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(".", "_")
Expand Down Expand Up @@ -193,6 +198,8 @@ def instruction(intrinsic, instr, desc):
{desc}
{diagram}
{examples_text}
### Operation
Expand Down

0 comments on commit 1152fa8

Please sign in to comment.