From 6a68d05c359ba1cdd808281fc4c63d6e03148631 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 17 Jul 2024 12:48:52 +0800 Subject: [PATCH] Add more xvshuf4i figures --- docs/diagram/gen.py | 65 ++++++++++ docs/diagram/xvshuf4i_b.svg | 236 ++++++++++++++++++++++++++++++++++++ docs/diagram/xvshuf4i_d.svg | 52 ++++++++ docs/diagram/xvshuf4i_h.svg | 124 +++++++++++++++++++ docs/diagram/xvshuf4i_w.svg | 68 +++++++++++ 5 files changed, 545 insertions(+) create mode 100644 docs/diagram/xvshuf4i_b.svg create mode 100644 docs/diagram/xvshuf4i_d.svg create mode 100644 docs/diagram/xvshuf4i_h.svg create mode 100644 docs/diagram/xvshuf4i_w.svg diff --git a/docs/diagram/gen.py b/docs/diagram/gen.py index 8d8c8f13..8993bd9a 100644 --- a/docs/diagram/gen.py +++ b/docs/diagram/gen.py @@ -136,6 +136,71 @@ def xvshuf(): add_line(f, 2, 0, i, 3, 0, i) end(f) +def xvshuf4i_bhw(): + global elen, vlen + for el, name in [(32, "w"), (16, "h"), (8, "b")]: + elen = el + vlen = 256 + with open(f"xvshuf4i_{name}.svg", "w") as f: + init(f, 2, 1) + add_row(f) + add_box( + f, + "a", + "data", + indices=list(range(3, -1, -1)) * (vlen // el // 4), + ) + add_row(f) + add_box(f, "ret", "returns") + + # a to returns + for i in range(vlen // elen): + for j in range(4): + add_line(f, 1, 0, i, 2, 0, i // 4 * 4 + j) + end(f) + +def xvshuf4i_d(): + global elen, vlen + elen = 64 + vlen = 256 + with open("xvshuf4i_d.svg", "w") as f: + init(f, 2, 2) + add_row(f) + add_box( + f, + "b", + "data", + indices=[3, 2, 3, 2], + ) + add_box( + f, + "a", + "data", + indices=[1, 0, 1, 0], + ) + add_row(f) + add_box(f, "ret", "returns") + + # a & b to returns + add_line(f, 1, 0, 2, 2, 0, 3) + add_line(f, 1, 0, 3, 2, 0, 3) + add_line(f, 1, 1, 2, 2, 0, 3) + add_line(f, 1, 1, 3, 2, 0, 3) + add_line(f, 1, 0, 2, 2, 0, 2) + add_line(f, 1, 0, 3, 2, 0, 2) + add_line(f, 1, 1, 2, 2, 0, 2) + add_line(f, 1, 1, 3, 2, 0, 2) + add_line(f, 1, 0, 0, 2, 0, 1) + add_line(f, 1, 0, 1, 2, 0, 1) + add_line(f, 1, 1, 0, 2, 0, 1) + add_line(f, 1, 1, 1, 2, 0, 1) + add_line(f, 1, 0, 0, 2, 0, 0) + add_line(f, 1, 0, 1, 2, 0, 0) + add_line(f, 1, 1, 0, 2, 0, 0) + add_line(f, 1, 1, 1, 2, 0, 0) + end(f) if __name__ == "__main__": xvshuf() + xvshuf4i_bhw() + xvshuf4i_d() diff --git a/docs/diagram/xvshuf4i_b.svg b/docs/diagram/xvshuf4i_b.svg new file mode 100644 index 00000000..e21a7c31 --- /dev/null +++ b/docs/diagram/xvshuf4i_b.svg @@ -0,0 +1,236 @@ + +(1) +a +data + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 +upper +lower +(2) +ret +returns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/diagram/xvshuf4i_d.svg b/docs/diagram/xvshuf4i_d.svg new file mode 100644 index 00000000..af8ed307 --- /dev/null +++ b/docs/diagram/xvshuf4i_d.svg @@ -0,0 +1,52 @@ + +(1) +b +data + +3 + +2 + +3 + +2 +upper +lower +a +data + +1 + +0 + +1 + +0 +upper +lower +(2) +ret +returns + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/diagram/xvshuf4i_h.svg b/docs/diagram/xvshuf4i_h.svg new file mode 100644 index 00000000..2b4b1164 --- /dev/null +++ b/docs/diagram/xvshuf4i_h.svg @@ -0,0 +1,124 @@ + +(1) +a +data + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 +upper +lower +(2) +ret +returns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/diagram/xvshuf4i_w.svg b/docs/diagram/xvshuf4i_w.svg new file mode 100644 index 00000000..f8d4ca15 --- /dev/null +++ b/docs/diagram/xvshuf4i_w.svg @@ -0,0 +1,68 @@ + +(1) +a +data + +3 + +2 + +1 + +0 + +3 + +2 + +1 + +0 +upper +lower +(2) +ret +returns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +