Skip to content

Commit

Permalink
Add feature to dump intrinsics.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Dec 14, 2023
1 parent 451f47f commit df0c0df
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
site/
intrinsics.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Visit <http://jia.je/unofficial-loongarch-intrinsics-guide/>

Arranged from QEMU implementation and [GCC Intrinsics](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-SX-Vector-Intrinsics.html)

All LSX instructions are documented.
All LSX & LASX instructions are documented.
2 changes: 1 addition & 1 deletion docs/latency_throughput.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Latency and throughput (CPI) of each instruction:

{{ latency_throughput_table() }}
{{ latency_throughput_table() }}
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1875,4 +1875,18 @@ def latency_throughput_table():
result += "</tr>"

result += "</tbody>"
return result
return result

if __name__ == '__main__':
# Fake an env
class Env:
def __init__(self):
self.macros = {}

def macro(self, fn):
self.macros[fn.__name__] = fn

env = Env()
define_env(env)
result = env.macros["all_intrinsics"]()
json.dump(json.loads(result), open("intrinsics.json", 'w'), indent=True)

0 comments on commit df0c0df

Please sign in to comment.