-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add intrinsic code generator for LoongArch
Co-authored-by: WANG Rui <[email protected]>
- Loading branch information
Showing
5 changed files
with
1,572 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "stdarch-gen-loongarch" | ||
version = "0.1.0" | ||
authors = ["ZHAI Xiang <[email protected]>", "WANG Rui <[email protected]>"] | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
rand = "0.8.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# LoongArch LSX/LASX intrinsic code generator | ||
|
||
A small tool that allows to quickly generate intrinsics for the LoongArch LSX/LASX architectures. | ||
|
||
The specification for the intrinsics can be found in `lsx.spec` or `lasx.spec`. | ||
|
||
To run and re-generate the code run the following from the root of the `stdarch` crate. | ||
|
||
LSX: | ||
``` | ||
# Generate bindings | ||
OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsxintrin.h | ||
OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec | ||
# Generate tests | ||
OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lsx.spec test | ||
loongarch64-unknown-linux-gnu-gcc -static -o lsx crates/stdarch-gen-loongarch/lsx.c -mlasx | ||
qemu-loongarch64 ./lsx > crates/core_arch/src/loongarch64/lsx/tests.rs | ||
rustfmt crates/core_arch/src/loongarch64/lsx/tests.rs | ||
``` | ||
|
||
LASX: | ||
``` | ||
# Generate bindings | ||
OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasxintrin.h | ||
OUT_DIR=`pwd`/crates/core_arch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec | ||
# Generate tests | ||
OUT_DIR=`pwd`/crates/stdarch-gen-loongarch cargo run -p stdarch-gen-loongarch -- crates/stdarch-gen-loongarch/lasx.spec test | ||
loongarch64-unknown-linux-gnu-gcc -static -o lasx crates/stdarch-gen-loongarch/lasx.c -mlasx | ||
qemu-loongarch64 ./lasx > crates/core_arch/src/loongarch64/lasx/tests.rs | ||
rustfmt crates/core_arch/src/loongarch64/lasx/tests.rs | ||
``` |
Oops, something went wrong.