Skip to content

Commit 345d684

Browse files
heiherxiangzhai
authored andcommitted
core_arch: Add LoongArch LASX intrinsics
Co-authored-by: ZHAI Xiang <zhaixiang@loongson.cn>
1 parent 828d98d commit 345d684

File tree

6 files changed

+16127
-0
lines changed

6 files changed

+16127
-0
lines changed

crates/core_arch/src/loongarch64/lasx/generated.rs

Lines changed: 7027 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! LoongArch64 LASX intrinsics
2+
3+
#![allow(non_camel_case_types)]
4+
5+
#[rustfmt::skip]
6+
mod types;
7+
8+
#[rustfmt::skip]
9+
mod generated;
10+
11+
#[rustfmt::skip]
12+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
13+
pub use self::generated::*;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
types! {
2+
/// LOONGARCH-specific 256-bit wide vector of 32 packed `i8`.
3+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
4+
pub struct v32i8(
5+
pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8,
6+
pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8,
7+
pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8,
8+
pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8, pub(crate) i8,
9+
);
10+
11+
/// LOONGARCH-specific 256-bit wide vector of 16 packed `i16`.
12+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
13+
pub struct v16i16(
14+
pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16,
15+
pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16, pub(crate) i16,
16+
);
17+
18+
/// LOONGARCH-specific 256-bit wide vector of 8 packed `i32`.
19+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
20+
pub struct v8i32(pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32, pub(crate) i32);
21+
22+
/// LOONGARCH-specific 256-bit wide vector of 4 packed `i64`.
23+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
24+
pub struct v4i64(pub(crate) i64, pub(crate) i64, pub(crate) i64, pub(crate) i64);
25+
26+
/// LOONGARCH-specific 256-bit wide vector of 32 packed `u8`.
27+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
28+
pub struct v32u8(
29+
pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8,
30+
pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8,
31+
pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8,
32+
pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8, pub(crate) u8,
33+
);
34+
35+
/// LOONGARCH-specific 256-bit wide vector of 16 packed `u16`.
36+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
37+
pub struct v16u16(
38+
pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16,
39+
pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16, pub(crate) u16,
40+
);
41+
42+
/// LOONGARCH-specific 256-bit wide vector of 8 packed `u32`.
43+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
44+
pub struct v8u32(pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32, pub(crate) u32);
45+
46+
/// LOONGARCH-specific 256-bit wide vector of 4 packed `u64`.
47+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
48+
pub struct v4u64(pub(crate) u64, pub(crate) u64, pub(crate) u64, pub(crate) u64);
49+
50+
/// LOONGARCH-specific 128-bit wide vector of 8 packed `f32`.
51+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
52+
pub struct v8f32(pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32, pub(crate) f32);
53+
54+
/// LOONGARCH-specific 256-bit wide vector of 4 packed `f64`.
55+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
56+
pub struct v4f64(pub(crate) f64, pub(crate) f64, pub(crate) f64, pub(crate) f64);
57+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! `LoongArch` intrinsics
22
3+
mod lasx;
34
mod lsx;
45

6+
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
7+
pub use self::lasx::*;
58
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
69
pub use self::lsx::*;

0 commit comments

Comments
 (0)