Skip to content

Commit 306db70

Browse files
committed
add vcreat instructions
1 parent 8e92fe4 commit 306db70

File tree

2 files changed

+198
-0
lines changed

2 files changed

+198
-0
lines changed

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

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,94 @@ pub unsafe fn vcopyq_lane_f64<const LANE1: i32, const LANE2: i32>(a: float64x2_t
20242024
}
20252025
}
20262026

2027+
/// Insert vector element from another vector element
2028+
#[inline]
2029+
#[target_feature(enable = "neon")]
2030+
#[cfg_attr(test, assert_instr(nop))]
2031+
pub unsafe fn vcreate_s8(a: u64) -> int8x8_t {
2032+
transmute(a)
2033+
}
2034+
2035+
/// Insert vector element from another vector element
2036+
#[inline]
2037+
#[target_feature(enable = "neon")]
2038+
#[cfg_attr(test, assert_instr(nop))]
2039+
pub unsafe fn vcreate_s16(a: u64) -> int16x4_t {
2040+
transmute(a)
2041+
}
2042+
2043+
/// Insert vector element from another vector element
2044+
#[inline]
2045+
#[target_feature(enable = "neon")]
2046+
#[cfg_attr(test, assert_instr(nop))]
2047+
pub unsafe fn vcreate_s64(a: u64) -> int64x1_t {
2048+
transmute(a)
2049+
}
2050+
2051+
/// Insert vector element from another vector element
2052+
#[inline]
2053+
#[target_feature(enable = "neon")]
2054+
#[cfg_attr(test, assert_instr(nop))]
2055+
pub unsafe fn vcreate_u8(a: u64) -> uint8x8_t {
2056+
transmute(a)
2057+
}
2058+
2059+
/// Insert vector element from another vector element
2060+
#[inline]
2061+
#[target_feature(enable = "neon")]
2062+
#[cfg_attr(test, assert_instr(nop))]
2063+
pub unsafe fn vcreate_u16(a: u64) -> uint16x4_t {
2064+
transmute(a)
2065+
}
2066+
2067+
/// Insert vector element from another vector element
2068+
#[inline]
2069+
#[target_feature(enable = "neon")]
2070+
#[cfg_attr(test, assert_instr(nop))]
2071+
pub unsafe fn vcreate_u64(a: u64) -> uint64x1_t {
2072+
transmute(a)
2073+
}
2074+
2075+
/// Insert vector element from another vector element
2076+
#[inline]
2077+
#[target_feature(enable = "neon")]
2078+
#[cfg_attr(test, assert_instr(nop))]
2079+
pub unsafe fn vcreate_p8(a: u64) -> poly8x8_t {
2080+
transmute(a)
2081+
}
2082+
2083+
/// Insert vector element from another vector element
2084+
#[inline]
2085+
#[target_feature(enable = "neon")]
2086+
#[cfg_attr(test, assert_instr(nop))]
2087+
pub unsafe fn vcreate_p16(a: u64) -> poly16x4_t {
2088+
transmute(a)
2089+
}
2090+
2091+
/// Insert vector element from another vector element
2092+
#[inline]
2093+
#[target_feature(enable = "neon")]
2094+
#[cfg_attr(test, assert_instr(nop))]
2095+
pub unsafe fn vcreate_p64(a: u64) -> poly64x1_t {
2096+
transmute(a)
2097+
}
2098+
2099+
/// Insert vector element from another vector element
2100+
#[inline]
2101+
#[target_feature(enable = "neon")]
2102+
#[cfg_attr(test, assert_instr(nop))]
2103+
pub unsafe fn vcreate_f32(a: u64) -> float32x2_t {
2104+
transmute(a)
2105+
}
2106+
2107+
/// Insert vector element from another vector element
2108+
#[inline]
2109+
#[target_feature(enable = "neon")]
2110+
#[cfg_attr(test, assert_instr(nop))]
2111+
pub unsafe fn vcreate_f64(a: u64) -> float64x1_t {
2112+
transmute(a)
2113+
}
2114+
20272115
/// Floating-point convert to higher precision long
20282116
#[inline]
20292117
#[target_feature(enable = "neon")]
@@ -9084,6 +9172,94 @@ mod test {
90849172
assert_eq!(r, e);
90859173
}
90869174

9175+
#[simd_test(enable = "neon")]
9176+
unsafe fn test_vcreate_s8() {
9177+
let a: u64 = 1;
9178+
let e: i8x8 = i8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
9179+
let r: i8x8 = transmute(vcreate_s8(transmute(a)));
9180+
assert_eq!(r, e);
9181+
}
9182+
9183+
#[simd_test(enable = "neon")]
9184+
unsafe fn test_vcreate_s16() {
9185+
let a: u64 = 1;
9186+
let e: i16x4 = i16x4::new(1, 0, 0, 0);
9187+
let r: i16x4 = transmute(vcreate_s16(transmute(a)));
9188+
assert_eq!(r, e);
9189+
}
9190+
9191+
#[simd_test(enable = "neon")]
9192+
unsafe fn test_vcreate_s64() {
9193+
let a: u64 = 1;
9194+
let e: i64x1 = i64x1::new(1);
9195+
let r: i64x1 = transmute(vcreate_s64(transmute(a)));
9196+
assert_eq!(r, e);
9197+
}
9198+
9199+
#[simd_test(enable = "neon")]
9200+
unsafe fn test_vcreate_u8() {
9201+
let a: u64 = 1;
9202+
let e: u8x8 = u8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
9203+
let r: u8x8 = transmute(vcreate_u8(transmute(a)));
9204+
assert_eq!(r, e);
9205+
}
9206+
9207+
#[simd_test(enable = "neon")]
9208+
unsafe fn test_vcreate_u16() {
9209+
let a: u64 = 1;
9210+
let e: u16x4 = u16x4::new(1, 0, 0, 0);
9211+
let r: u16x4 = transmute(vcreate_u16(transmute(a)));
9212+
assert_eq!(r, e);
9213+
}
9214+
9215+
#[simd_test(enable = "neon")]
9216+
unsafe fn test_vcreate_u64() {
9217+
let a: u64 = 1;
9218+
let e: u64x1 = u64x1::new(1);
9219+
let r: u64x1 = transmute(vcreate_u64(transmute(a)));
9220+
assert_eq!(r, e);
9221+
}
9222+
9223+
#[simd_test(enable = "neon")]
9224+
unsafe fn test_vcreate_p8() {
9225+
let a: u64 = 1;
9226+
let e: i8x8 = i8x8::new(1, 0, 0, 0, 0, 0, 0, 0);
9227+
let r: i8x8 = transmute(vcreate_p8(transmute(a)));
9228+
assert_eq!(r, e);
9229+
}
9230+
9231+
#[simd_test(enable = "neon")]
9232+
unsafe fn test_vcreate_p16() {
9233+
let a: u64 = 1;
9234+
let e: i16x4 = i16x4::new(1, 0, 0, 0);
9235+
let r: i16x4 = transmute(vcreate_p16(transmute(a)));
9236+
assert_eq!(r, e);
9237+
}
9238+
9239+
#[simd_test(enable = "neon")]
9240+
unsafe fn test_vcreate_p64() {
9241+
let a: u64 = 1;
9242+
let e: i64x1 = i64x1::new(1);
9243+
let r: i64x1 = transmute(vcreate_p64(transmute(a)));
9244+
assert_eq!(r, e);
9245+
}
9246+
9247+
#[simd_test(enable = "neon")]
9248+
unsafe fn test_vcreate_f32() {
9249+
let a: u64 = 0;
9250+
let e: f32x2 = f32x2::new(0., 0.);
9251+
let r: f32x2 = transmute(vcreate_f32(transmute(a)));
9252+
assert_eq!(r, e);
9253+
}
9254+
9255+
#[simd_test(enable = "neon")]
9256+
unsafe fn test_vcreate_f64() {
9257+
let a: u64 = 0;
9258+
let e: f64 = 0.;
9259+
let r: f64 = transmute(vcreate_f64(transmute(a)));
9260+
assert_eq!(r, e);
9261+
}
9262+
90879263
#[simd_test(enable = "neon")]
90889264
unsafe fn test_vcvt_f64_f32() {
90899265
let a: f32x2 = f32x2::new(-1.2, 1.2);

crates/stdarch-gen/neon.spec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,28 @@ generate float32x4_t:float32x2_t:float32x4_t
839839
aarch64 = zip1
840840
generate float64x2_t:float64x1_t:float64x2_t
841841

842+
/// Insert vector element from another vector element
843+
name = vcreate
844+
out-suffix
845+
multi_fn = transmute, a
846+
a = 1
847+
validate 1, 0, 0, 0, 0, 0, 0, 0
848+
849+
aarch64 = nop
850+
generate u64:int8x8_t, u64:int16x4_t, u64:int32x2_t: u64:int64x1_t
851+
generate u64:uint8x8_t, u64:uint16x4_t, u64:uint32x2_t: u64:uint64x1_t
852+
generate u64:poly8x8_t, u64:poly16x4_t, u64:poly64x1_t
853+
854+
/// Insert vector element from another vector element
855+
name = vcreate
856+
out-suffix
857+
multi_fn = transmute, a
858+
a = 0
859+
validate 0., 0.
860+
861+
aarch64 = nop
862+
generate u64:float32x2_t, u64:float64x1_t
863+
842864
/// Floating-point convert to higher precision long
843865
name = vcvt
844866
double-suffixes

0 commit comments

Comments
 (0)