Skip to content

Commit 6ddda5c

Browse files
authored
add vldx neon instructions (#1200)
1 parent 89b0e35 commit 6ddda5c

File tree

19 files changed

+9494
-7467
lines changed

19 files changed

+9494
-7467
lines changed

crates/core_arch/src/aarch64/crc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extern "C" {
1+
extern "unadjusted" {
22
#[link_name = "llvm.aarch64.crc32x"]
33
fn crc32x_(crc: u32, data: u64) -> u32;
44

crates/core_arch/src/aarch64/neon/generated.rs

+293-167
Large diffs are not rendered by default.

crates/core_arch/src/aarch64/neon/mod.rs

+21-31
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,38 @@ types! {
2525
pub struct float64x2_t(f64, f64);
2626
}
2727

28-
/// ARM-specific type containing two `int8x16_t` vectors.
28+
/// ARM-specific type containing two `float64x1_t` vectors.
2929
#[derive(Copy, Clone)]
30-
pub struct int8x16x2_t(pub int8x16_t, pub int8x16_t);
31-
/// ARM-specific type containing three `int8x16_t` vectors.
30+
pub struct float64x1x2_t(pub float64x1_t, pub float64x1_t);
31+
/// ARM-specific type containing three `float64x1_t` vectors.
3232
#[derive(Copy, Clone)]
33-
pub struct int8x16x3_t(pub int8x16_t, pub int8x16_t, pub int8x16_t);
34-
/// ARM-specific type containing four `int8x16_t` vectors.
33+
pub struct float64x1x3_t(pub float64x1_t, pub float64x1_t, pub float64x1_t);
34+
/// ARM-specific type containing four `float64x1_t` vectors.
3535
#[derive(Copy, Clone)]
36-
pub struct int8x16x4_t(pub int8x16_t, pub int8x16_t, pub int8x16_t, pub int8x16_t);
37-
38-
/// ARM-specific type containing two `uint8x16_t` vectors.
39-
#[derive(Copy, Clone)]
40-
pub struct uint8x16x2_t(pub uint8x16_t, pub uint8x16_t);
41-
/// ARM-specific type containing three `uint8x16_t` vectors.
42-
#[derive(Copy, Clone)]
43-
pub struct uint8x16x3_t(pub uint8x16_t, pub uint8x16_t, pub uint8x16_t);
44-
/// ARM-specific type containing four `uint8x16_t` vectors.
45-
#[derive(Copy, Clone)]
46-
pub struct uint8x16x4_t(
47-
pub uint8x16_t,
48-
pub uint8x16_t,
49-
pub uint8x16_t,
50-
pub uint8x16_t,
36+
pub struct float64x1x4_t(
37+
pub float64x1_t,
38+
pub float64x1_t,
39+
pub float64x1_t,
40+
pub float64x1_t,
5141
);
5242

53-
/// ARM-specific type containing two `poly8x16_t` vectors.
43+
/// ARM-specific type containing two `float64x2_t` vectors.
5444
#[derive(Copy, Clone)]
55-
pub struct poly8x16x2_t(pub poly8x16_t, pub poly8x16_t);
56-
/// ARM-specific type containing three `poly8x16_t` vectors.
45+
pub struct float64x2x2_t(pub float64x2_t, pub float64x2_t);
46+
/// ARM-specific type containing three `float64x2_t` vectors.
5747
#[derive(Copy, Clone)]
58-
pub struct poly8x16x3_t(pub poly8x16_t, pub poly8x16_t, pub poly8x16_t);
59-
/// ARM-specific type containing four `poly8x16_t` vectors.
48+
pub struct float64x2x3_t(pub float64x2_t, pub float64x2_t, pub float64x2_t);
49+
/// ARM-specific type containing four `float64x2_t` vectors.
6050
#[derive(Copy, Clone)]
61-
pub struct poly8x16x4_t(
62-
pub poly8x16_t,
63-
pub poly8x16_t,
64-
pub poly8x16_t,
65-
pub poly8x16_t,
51+
pub struct float64x2x4_t(
52+
pub float64x2_t,
53+
pub float64x2_t,
54+
pub float64x2_t,
55+
pub float64x2_t,
6656
);
6757

6858
#[allow(improper_ctypes)]
69-
extern "C" {
59+
extern "unadjusted" {
7060
// absolute value
7161
#[link_name = "llvm.aarch64.neon.abs.i64"]
7262
fn vabsd_s64_(a: i64) -> i64;

crates/core_arch/src/aarch64/prefetch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(test)]
22
use stdarch_test::assert_instr;
33

4-
extern "C" {
4+
extern "unadjusted" {
55
#[link_name = "llvm.prefetch"]
66
fn prefetch(p: *const i8, rw: i32, loc: i32, ty: i32);
77
}

crates/core_arch/src/aarch64/tme.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#[cfg(test)]
1818
use stdarch_test::assert_instr;
1919

20-
extern "C" {
20+
extern "unadjusted" {
2121
#[link_name = "llvm.aarch64.tstart"]
2222
fn aarch64_tstart() -> u64;
2323
#[link_name = "llvm.aarch64.tcommit"]

crates/core_arch/src/arm/dsp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ types! {
3232
pub struct uint16x2_t(u16, u16);
3333
}
3434

35-
extern "C" {
35+
extern "unadjusted" {
3636
#[link_name = "llvm.arm.smulbb"]
3737
fn arm_smulbb(a: i32, b: i32) -> i32;
3838

crates/core_arch/src/arm/ex.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
doc
1212
))]
1313
pub unsafe fn __clrex() {
14-
extern "C" {
14+
extern "unadjusted" {
1515
#[link_name = "llvm.arm.clrex"]
1616
fn clrex();
1717
}
@@ -27,7 +27,7 @@ pub unsafe fn __clrex() {
2727
doc
2828
))]
2929
pub unsafe fn __ldrexb(p: *const u8) -> u8 {
30-
extern "C" {
30+
extern "unadjusted" {
3131
#[link_name = "llvm.arm.ldrex.p0i8"]
3232
fn ldrex8(p: *const u8) -> u32;
3333
}
@@ -43,7 +43,7 @@ pub unsafe fn __ldrexb(p: *const u8) -> u8 {
4343
doc
4444
))]
4545
pub unsafe fn __ldrexh(p: *const u16) -> u16 {
46-
extern "C" {
46+
extern "unadjusted" {
4747
#[link_name = "llvm.arm.ldrex.p0i16"]
4848
fn ldrex16(p: *const u16) -> u32;
4949
}
@@ -60,7 +60,7 @@ pub unsafe fn __ldrexh(p: *const u16) -> u16 {
6060
doc
6161
))]
6262
pub unsafe fn __ldrex(p: *const u32) -> u32 {
63-
extern "C" {
63+
extern "unadjusted" {
6464
#[link_name = "llvm.arm.ldrex.p0i32"]
6565
fn ldrex32(p: *const u32) -> u32;
6666
}
@@ -78,7 +78,7 @@ pub unsafe fn __ldrex(p: *const u32) -> u32 {
7878
doc
7979
))]
8080
pub unsafe fn __strexb(value: u32, addr: *mut u8) -> u32 {
81-
extern "C" {
81+
extern "unadjusted" {
8282
#[link_name = "llvm.arm.strex.p0i8"]
8383
fn strex8(value: u32, addr: *mut u8) -> u32;
8484
}
@@ -97,7 +97,7 @@ pub unsafe fn __strexb(value: u32, addr: *mut u8) -> u32 {
9797
doc
9898
))]
9999
pub unsafe fn __strexh(value: u16, addr: *mut u16) -> u32 {
100-
extern "C" {
100+
extern "unadjusted" {
101101
#[link_name = "llvm.arm.strex.p0i16"]
102102
fn strex16(value: u32, addr: *mut u16) -> u32;
103103
}
@@ -116,7 +116,7 @@ pub unsafe fn __strexh(value: u16, addr: *mut u16) -> u32 {
116116
doc
117117
))]
118118
pub unsafe fn __strex(value: u32, addr: *mut u32) -> u32 {
119-
extern "C" {
119+
extern "unadjusted" {
120120
#[link_name = "llvm.arm.strex.p0i32"]
121121
fn strex32(value: u32, addr: *mut u32) -> u32;
122122
}

crates/core_arch/src/arm/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub unsafe fn __dbg<const IMM4: i32>() {
107107
dbg(IMM4);
108108
}
109109

110-
extern "C" {
110+
extern "unadjusted" {
111111
#[link_name = "llvm.arm.dbg"]
112112
fn dbg(_: i32);
113113
}

crates/core_arch/src/arm/neon.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(crate) type p8 = u8;
1212
pub(crate) type p16 = u16;
1313

1414
#[allow(improper_ctypes)]
15-
extern "C" {
15+
extern "unadjusted" {
1616
#[link_name = "llvm.arm.neon.vbsl.v8i8"]
1717
fn vbsl_s8_(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t;
1818
#[link_name = "llvm.arm.neon.vbsl.v16i8"]

crates/core_arch/src/arm/simd32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ macro_rules! dsp_call {
8080
};
8181
}
8282

83-
extern "C" {
83+
extern "unadjusted" {
8484
#[link_name = "llvm.arm.qadd8"]
8585
fn arm_qadd8(a: i32, b: i32) -> i32;
8686

crates/core_arch/src/arm_shared/barrier/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ where
122122
arg.__isb()
123123
}
124124

125-
extern "C" {
125+
extern "unadjusted" {
126126
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.dmb")]
127127
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.dmb")]
128128
fn dmb(_: i32);

crates/core_arch/src/arm_shared/crc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extern "C" {
1+
extern "unadjusted" {
22
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crc32b")]
33
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.crc32b")]
44
fn crc32b_(crc: u32, data: u32) -> u32;

crates/core_arch/src/arm_shared/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::core_arch::arm_shared::{uint32x4_t, uint8x16_t};
22

33
#[allow(improper_ctypes)]
4-
extern "C" {
4+
extern "unadjusted" {
55
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.crypto.aese")]
66
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.aese")]
77
fn vaeseq_u8_(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t;

crates/core_arch/src/arm_shared/hints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub unsafe fn __nop() {
8080
asm!("nop", options(nomem, nostack, preserves_flags));
8181
}
8282

83-
extern "C" {
83+
extern "unadjusted" {
8484
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.hint")]
8585
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.hint")]
8686
fn hint(_: i32);

0 commit comments

Comments
 (0)