Skip to content

Commit acee401

Browse files
committed
Fix return type for vcls_u* intrinsics
1 parent f4fd7ef commit acee401

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ vclsq_s32_(a)
18101810
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18111811
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18121812
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1813-
pub unsafe fn vcls_u8(a: uint8x8_t) -> uint8x8_t {
1813+
pub unsafe fn vcls_u8(a: uint8x8_t) -> int8x8_t {
18141814
transmute(vcls_s8(transmute(a)))
18151815
}
18161816

@@ -1820,7 +1820,7 @@ pub unsafe fn vcls_u8(a: uint8x8_t) -> uint8x8_t {
18201820
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18211821
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18221822
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1823-
pub unsafe fn vclsq_u8(a: uint8x16_t) -> uint8x16_t {
1823+
pub unsafe fn vclsq_u8(a: uint8x16_t) -> int8x16_t {
18241824
transmute(vclsq_s8(transmute(a)))
18251825
}
18261826

@@ -1830,7 +1830,7 @@ pub unsafe fn vclsq_u8(a: uint8x16_t) -> uint8x16_t {
18301830
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18311831
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18321832
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1833-
pub unsafe fn vcls_u16(a: uint16x4_t) -> uint16x4_t {
1833+
pub unsafe fn vcls_u16(a: uint16x4_t) -> int16x4_t {
18341834
transmute(vcls_s16(transmute(a)))
18351835
}
18361836

@@ -1840,7 +1840,7 @@ pub unsafe fn vcls_u16(a: uint16x4_t) -> uint16x4_t {
18401840
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18411841
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18421842
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1843-
pub unsafe fn vclsq_u16(a: uint16x8_t) -> uint16x8_t {
1843+
pub unsafe fn vclsq_u16(a: uint16x8_t) -> int16x8_t {
18441844
transmute(vclsq_s16(transmute(a)))
18451845
}
18461846

@@ -1850,7 +1850,7 @@ pub unsafe fn vclsq_u16(a: uint16x8_t) -> uint16x8_t {
18501850
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18511851
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18521852
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1853-
pub unsafe fn vcls_u32(a: uint32x2_t) -> uint32x2_t {
1853+
pub unsafe fn vcls_u32(a: uint32x2_t) -> int32x2_t {
18541854
transmute(vcls_s32(transmute(a)))
18551855
}
18561856

@@ -1860,7 +1860,7 @@ pub unsafe fn vcls_u32(a: uint32x2_t) -> uint32x2_t {
18601860
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
18611861
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcls))]
18621862
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(cls))]
1863-
pub unsafe fn vclsq_u32(a: uint32x4_t) -> uint32x4_t {
1863+
pub unsafe fn vclsq_u32(a: uint32x4_t) -> int32x4_t {
18641864
transmute(vclsq_s32(transmute(a)))
18651865
}
18661866

@@ -25706,48 +25706,48 @@ mod test {
2570625706
#[simd_test(enable = "neon")]
2570725707
unsafe fn test_vcls_u8() {
2570825708
let a: u8x8 = u8x8::new(0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
25709-
let e: u8x8 = u8x8::new(7, 7, 7, 7, 7, 7, 7, 7);
25710-
let r: u8x8 = transmute(vcls_u8(transmute(a)));
25709+
let e: i8x8 = i8x8::new(7, 7, 7, 7, 7, 7, 7, 7);
25710+
let r: i8x8 = transmute(vcls_u8(transmute(a)));
2571125711
assert_eq!(r, e);
2571225712
}
2571325713

2571425714
#[simd_test(enable = "neon")]
2571525715
unsafe fn test_vclsq_u8() {
2571625716
let a: u8x16 = u8x16::new(0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF);
25717-
let e: u8x16 = u8x16::new(7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7);
25718-
let r: u8x16 = transmute(vclsq_u8(transmute(a)));
25717+
let e: i8x16 = i8x16::new(7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7);
25718+
let r: i8x16 = transmute(vclsq_u8(transmute(a)));
2571925719
assert_eq!(r, e);
2572025720
}
2572125721

2572225722
#[simd_test(enable = "neon")]
2572325723
unsafe fn test_vcls_u16() {
2572425724
let a: u16x4 = u16x4::new(0, 0xFF_FF, 0x00, 0x00);
25725-
let e: u16x4 = u16x4::new(15, 15, 15, 15);
25726-
let r: u16x4 = transmute(vcls_u16(transmute(a)));
25725+
let e: i16x4 = i16x4::new(15, 15, 15, 15);
25726+
let r: i16x4 = transmute(vcls_u16(transmute(a)));
2572725727
assert_eq!(r, e);
2572825728
}
2572925729

2573025730
#[simd_test(enable = "neon")]
2573125731
unsafe fn test_vclsq_u16() {
2573225732
let a: u16x8 = u16x8::new(0, 0xFF_FF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
25733-
let e: u16x8 = u16x8::new(15, 15, 15, 15, 15, 15, 15, 15);
25734-
let r: u16x8 = transmute(vclsq_u16(transmute(a)));
25733+
let e: i16x8 = i16x8::new(15, 15, 15, 15, 15, 15, 15, 15);
25734+
let r: i16x8 = transmute(vclsq_u16(transmute(a)));
2573525735
assert_eq!(r, e);
2573625736
}
2573725737

2573825738
#[simd_test(enable = "neon")]
2573925739
unsafe fn test_vcls_u32() {
2574025740
let a: u32x2 = u32x2::new(0, 0xFF_FF_FF_FF);
25741-
let e: u32x2 = u32x2::new(31, 31);
25742-
let r: u32x2 = transmute(vcls_u32(transmute(a)));
25741+
let e: i32x2 = i32x2::new(31, 31);
25742+
let r: i32x2 = transmute(vcls_u32(transmute(a)));
2574325743
assert_eq!(r, e);
2574425744
}
2574525745

2574625746
#[simd_test(enable = "neon")]
2574725747
unsafe fn test_vclsq_u32() {
2574825748
let a: u32x4 = u32x4::new(0, 0xFF_FF_FF_FF, 0x00, 0x00);
25749-
let e: u32x4 = u32x4::new(31, 31, 31, 31);
25750-
let r: u32x4 = transmute(vclsq_u32(transmute(a)));
25749+
let e: i32x4 = i32x4::new(31, 31, 31, 31);
25750+
let r: i32x4 = transmute(vclsq_u32(transmute(a)));
2575125751
assert_eq!(r, e);
2575225752
}
2575325753

crates/stdarch-gen/neon.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ validate BITS_M1, BITS_M1, BITS_M1, BITS_M1, BITS_M1, BITS_M1, BITS_M1, BITS_M1,
896896

897897
arm = vcls
898898
aarch64 = cls
899-
generate uint*_t
899+
generate uint8x8_t:int8x8_t, uint8x16_t:int8x16_t, uint16x4_t:int16x4_t, uint16x8_t:int16x8_t, uint32x2_t:int32x2_t, uint32x4_t:int32x4_t
900900

901901
/// Count leading zero bits
902902
name = vclz

0 commit comments

Comments
 (0)