File tree Expand file tree Collapse file tree 5 files changed +1572
-1
lines changed
crates/stdarch-gen-loongarch Expand file tree Collapse file tree 5 files changed +1572
-1
lines changed Original file line number Diff line number Diff line change 4
4
tags
5
5
crates /stdarch-gen-arm /aarch64.rs
6
6
crates /stdarch-gen-arm /arm.rs
7
+ crates /stdarch-gen-loongarch /lasx.c
8
+ crates /stdarch-gen-loongarch /lsx.c
7
9
c_programs /*
8
- rust_programs /*
10
+ rust_programs /*
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ members = [
5
5
" crates/core_arch" ,
6
6
" crates/std_detect" ,
7
7
" crates/stdarch-gen-arm" ,
8
+ " crates/stdarch-gen-loongarch" ,
8
9
" crates/intrinsic-test" ,
9
10
" examples/"
10
11
]
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " stdarch-gen-loongarch"
3
+ version = " 0.1.0"
4
+ authors = [" ZHAI Xiang <zhaixiang@loongson.cn>" , " WANG Rui <wangrui@loongson.cn>" ]
5
+ edition = " 2021"
6
+
7
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
+
9
+ [dependencies ]
10
+ rand = " 0.8.5"
Original file line number Diff line number Diff line change
1
+ # LoongArch LSX/LASX intrinsic code generator
2
+
3
+ A small tool that allows to quickly generate intrinsics for the LoongArch LSX/LASX architectures.
4
+
5
+ The specification for the intrinsics can be found in ` lsx.spec ` or ` lasx.spec ` .
6
+
7
+ To run and re-generate the code run the following from the root of the ` stdarch ` crate.
8
+
9
+ LSX:
10
+ ```
11
+ # Generate bindings
12
+ OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsxintrin.h
13
+ OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec
14
+
15
+ # Generate tests
16
+ OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec test
17
+ loongarch64-unknown-linux-gnu-gcc -static -o lsx crates/stdarch-gen-loongarch/lsx.c -mlasx
18
+ qemu-loongarch64 ./lsx > crates/core_arch/src/loongarch64/lsx/tests.rs
19
+ rustfmt crates/core_arch/src/loongarch64/lsx/tests.rs
20
+ ```
21
+
22
+ LASX:
23
+ ```
24
+ # Generate bindings
25
+ OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasxintrin.h
26
+ OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec
27
+
28
+ # Generate tests
29
+ OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec test
30
+ loongarch64-unknown-linux-gnu-gcc -static -o lasx crates/stdarch-gen-loongarch/lasx.c -mlasx
31
+ qemu-loongarch64 ./lasx > crates/core_arch/src/loongarch64/lasx/tests.rs
32
+ rustfmt crates/core_arch/src/loongarch64/lasx/tests.rs
33
+ ```
You can’t perform that action at this time.
0 commit comments