Skip to content

Commit 4d813f0

Browse files
committed
Fix bad spec
1 parent 11fa0a3 commit 4d813f0

File tree

3 files changed

+3
-295
lines changed

3 files changed

+3
-295
lines changed

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

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -265,90 +265,6 @@ pub unsafe fn vcgeq_f64(a: float64x2_t, b: float64x2_t) -> uint64x2_t {
265265
simd_ge(a, b)
266266
}
267267

268-
/// Halving add
269-
#[inline]
270-
#[target_feature(enable = "neon")]
271-
#[cfg_attr(test, assert_instr(uhadd))]
272-
pub unsafe fn vhadd_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t {
273-
274-
#[allow(improper_ctypes)]
275-
extern "C" {
276-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v8i8")]
277-
fn vhadd_u8_(a: uint8x8_t, a: uint8x8_t) -> uint8x8_t;
278-
}
279-
vhadd_u8_(a, b)
280-
}
281-
282-
/// Halving add
283-
#[inline]
284-
#[target_feature(enable = "neon")]
285-
#[cfg_attr(test, assert_instr(uhadd))]
286-
pub unsafe fn vhaddq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
287-
288-
#[allow(improper_ctypes)]
289-
extern "C" {
290-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v16i8")]
291-
fn vhaddq_u8_(a: uint8x16_t, a: uint8x16_t) -> uint8x16_t;
292-
}
293-
vhaddq_u8_(a, b)
294-
}
295-
296-
/// Halving add
297-
#[inline]
298-
#[target_feature(enable = "neon")]
299-
#[cfg_attr(test, assert_instr(uhadd))]
300-
pub unsafe fn vhadd_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t {
301-
302-
#[allow(improper_ctypes)]
303-
extern "C" {
304-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v4i16")]
305-
fn vhadd_u16_(a: uint16x4_t, a: uint16x4_t) -> uint16x4_t;
306-
}
307-
vhadd_u16_(a, b)
308-
}
309-
310-
/// Halving add
311-
#[inline]
312-
#[target_feature(enable = "neon")]
313-
#[cfg_attr(test, assert_instr(uhadd))]
314-
pub unsafe fn vhaddq_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t {
315-
316-
#[allow(improper_ctypes)]
317-
extern "C" {
318-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v8i16")]
319-
fn vhaddq_u16_(a: uint16x8_t, a: uint16x8_t) -> uint16x8_t;
320-
}
321-
vhaddq_u16_(a, b)
322-
}
323-
324-
/// Halving add
325-
#[inline]
326-
#[target_feature(enable = "neon")]
327-
#[cfg_attr(test, assert_instr(uhadd))]
328-
pub unsafe fn vhadd_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t {
329-
330-
#[allow(improper_ctypes)]
331-
extern "C" {
332-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v2i32")]
333-
fn vhadd_u32_(a: uint32x2_t, a: uint32x2_t) -> uint32x2_t;
334-
}
335-
vhadd_u32_(a, b)
336-
}
337-
338-
/// Halving add
339-
#[inline]
340-
#[target_feature(enable = "neon")]
341-
#[cfg_attr(test, assert_instr(uhadd))]
342-
pub unsafe fn vhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
343-
344-
#[allow(improper_ctypes)]
345-
extern "C" {
346-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhadd.v4i32")]
347-
fn vhaddq_u32_(a: uint32x4_t, a: uint32x4_t) -> uint32x4_t;
348-
}
349-
vhaddq_u32_(a, b)
350-
}
351-
352268
/// Multiply
353269
#[inline]
354270
#[target_feature(enable = "neon")]
@@ -712,60 +628,6 @@ mod test {
712628
assert_eq!(r, e);
713629
}
714630

715-
#[simd_test(enable = "neon")]
716-
unsafe fn test_vhadd_u8() {
717-
let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
718-
let b: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
719-
let e: u8x8 = u8x8::new(21, 22, 22, 23, 23, 24, 24, 25);
720-
let r: u8x8 = transmute(vhadd_u8(transmute(a), transmute(b)));
721-
assert_eq!(r, e);
722-
}
723-
724-
#[simd_test(enable = "neon")]
725-
unsafe fn test_vhaddq_u8() {
726-
let a: u8x16 = u8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
727-
let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
728-
let e: u8x16 = u8x16::new(21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29);
729-
let r: u8x16 = transmute(vhaddq_u8(transmute(a), transmute(b)));
730-
assert_eq!(r, e);
731-
}
732-
733-
#[simd_test(enable = "neon")]
734-
unsafe fn test_vhadd_u16() {
735-
let a: u16x4 = u16x4::new(42, 42, 42, 42);
736-
let b: u16x4 = u16x4::new(1, 2, 3, 4);
737-
let e: u16x4 = u16x4::new(21, 22, 22, 23);
738-
let r: u16x4 = transmute(vhadd_u16(transmute(a), transmute(b)));
739-
assert_eq!(r, e);
740-
}
741-
742-
#[simd_test(enable = "neon")]
743-
unsafe fn test_vhaddq_u16() {
744-
let a: u16x8 = u16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
745-
let b: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
746-
let e: u16x8 = u16x8::new(21, 22, 22, 23, 23, 24, 24, 25);
747-
let r: u16x8 = transmute(vhaddq_u16(transmute(a), transmute(b)));
748-
assert_eq!(r, e);
749-
}
750-
751-
#[simd_test(enable = "neon")]
752-
unsafe fn test_vhadd_u32() {
753-
let a: u32x2 = u32x2::new(42, 42);
754-
let b: u32x2 = u32x2::new(1, 2);
755-
let e: u32x2 = u32x2::new(21, 22);
756-
let r: u32x2 = transmute(vhadd_u32(transmute(a), transmute(b)));
757-
assert_eq!(r, e);
758-
}
759-
760-
#[simd_test(enable = "neon")]
761-
unsafe fn test_vhaddq_u32() {
762-
let a: u32x4 = u32x4::new(42, 42, 42, 42);
763-
let b: u32x4 = u32x4::new(1, 2, 3, 4);
764-
let e: u32x4 = u32x4::new(21, 22, 22, 23);
765-
let r: u32x4 = transmute(vhaddq_u32(transmute(a), transmute(b)));
766-
assert_eq!(r, e);
767-
}
768-
769631
#[simd_test(enable = "neon")]
770632
unsafe fn test_vmul_f64() {
771633
let a: f64 = 1.0;

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

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,102 +1477,6 @@ pub unsafe fn vhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
14771477
vhaddq_u32_(a, b)
14781478
}
14791479

1480-
/// Halving add
1481-
#[inline]
1482-
#[target_feature(enable = "neon")]
1483-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1484-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s8"))]
1485-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1486-
pub unsafe fn vhadd_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t {
1487-
#[allow(improper_ctypes)]
1488-
extern "C" {
1489-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v8i8")]
1490-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v8i8")]
1491-
fn vhadd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t;
1492-
}
1493-
vhadd_s8_(a, b)
1494-
}
1495-
1496-
/// Halving add
1497-
#[inline]
1498-
#[target_feature(enable = "neon")]
1499-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1500-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s8"))]
1501-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1502-
pub unsafe fn vhaddq_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t {
1503-
#[allow(improper_ctypes)]
1504-
extern "C" {
1505-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v16i8")]
1506-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v16i8")]
1507-
fn vhaddq_s8_(a: int8x16_t, b: int8x16_t) -> int8x16_t;
1508-
}
1509-
vhaddq_s8_(a, b)
1510-
}
1511-
1512-
/// Halving add
1513-
#[inline]
1514-
#[target_feature(enable = "neon")]
1515-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1516-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s16"))]
1517-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1518-
pub unsafe fn vhadd_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t {
1519-
#[allow(improper_ctypes)]
1520-
extern "C" {
1521-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v4i16")]
1522-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v4i16")]
1523-
fn vhadd_s16_(a: int16x4_t, b: int16x4_t) -> int16x4_t;
1524-
}
1525-
vhadd_s16_(a, b)
1526-
}
1527-
1528-
/// Halving add
1529-
#[inline]
1530-
#[target_feature(enable = "neon")]
1531-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1532-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s16"))]
1533-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1534-
pub unsafe fn vhaddq_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t {
1535-
#[allow(improper_ctypes)]
1536-
extern "C" {
1537-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v8i16")]
1538-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v8i16")]
1539-
fn vhaddq_s16_(a: int16x8_t, b: int16x8_t) -> int16x8_t;
1540-
}
1541-
vhaddq_s16_(a, b)
1542-
}
1543-
1544-
/// Halving add
1545-
#[inline]
1546-
#[target_feature(enable = "neon")]
1547-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1548-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s32"))]
1549-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1550-
pub unsafe fn vhadd_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t {
1551-
#[allow(improper_ctypes)]
1552-
extern "C" {
1553-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v2i32")]
1554-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v2i32")]
1555-
fn vhadd_s32_(a: int32x2_t, b: int32x2_t) -> int32x2_t;
1556-
}
1557-
vhadd_s32_(a, b)
1558-
}
1559-
1560-
/// Halving add
1561-
#[inline]
1562-
#[target_feature(enable = "neon")]
1563-
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1564-
#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vhadd.s32"))]
1565-
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(shadd))]
1566-
pub unsafe fn vhaddq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t {
1567-
#[allow(improper_ctypes)]
1568-
extern "C" {
1569-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhaddu.v4i32")]
1570-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.shadd.v4i32")]
1571-
fn vhaddq_s32_(a: int32x4_t, b: int32x4_t) -> int32x4_t;
1572-
}
1573-
vhaddq_s32_(a, b)
1574-
}
1575-
15761480
/// Halving add
15771481
#[inline]
15781482
#[target_feature(enable = "neon")]
@@ -4019,60 +3923,6 @@ mod test {
40193923
assert_eq!(r, e);
40203924
}
40213925

4022-
#[simd_test(enable = "neon")]
4023-
unsafe fn test_vhadd_s8() {
4024-
let a: i8x8 = i8x8::new(42, 42, 42, 42, 42, 42, 42, 42);
4025-
let b: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
4026-
let e: i8x8 = i8x8::new(21, 22, 22, 23, 23, 24, 24, 25);
4027-
let r: i8x8 = transmute(vhadd_s8(transmute(a), transmute(b)));
4028-
assert_eq!(r, e);
4029-
}
4030-
4031-
#[simd_test(enable = "neon")]
4032-
unsafe fn test_vhaddq_s8() {
4033-
let a: i8x16 = i8x16::new(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42);
4034-
let b: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
4035-
let e: i8x16 = i8x16::new(21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29);
4036-
let r: i8x16 = transmute(vhaddq_s8(transmute(a), transmute(b)));
4037-
assert_eq!(r, e);
4038-
}
4039-
4040-
#[simd_test(enable = "neon")]
4041-
unsafe fn test_vhadd_s16() {
4042-
let a: i16x4 = i16x4::new(42, 42, 42, 42);
4043-
let b: i16x4 = i16x4::new(1, 2, 3, 4);
4044-
let e: i16x4 = i16x4::new(21, 22, 22, 23);
4045-
let r: i16x4 = transmute(vhadd_s16(transmute(a), transmute(b)));
4046-
assert_eq!(r, e);
4047-
}
4048-
4049-
#[simd_test(enable = "neon")]
4050-
unsafe fn test_vhaddq_s16() {
4051-
let a: i16x8 = i16x8::new(42, 42, 42, 42, 42, 42, 42, 42);
4052-
let b: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
4053-
let e: i16x8 = i16x8::new(21, 22, 22, 23, 23, 24, 24, 25);
4054-
let r: i16x8 = transmute(vhaddq_s16(transmute(a), transmute(b)));
4055-
assert_eq!(r, e);
4056-
}
4057-
4058-
#[simd_test(enable = "neon")]
4059-
unsafe fn test_vhadd_s32() {
4060-
let a: i32x2 = i32x2::new(42, 42);
4061-
let b: i32x2 = i32x2::new(1, 2);
4062-
let e: i32x2 = i32x2::new(21, 22);
4063-
let r: i32x2 = transmute(vhadd_s32(transmute(a), transmute(b)));
4064-
assert_eq!(r, e);
4065-
}
4066-
4067-
#[simd_test(enable = "neon")]
4068-
unsafe fn test_vhaddq_s32() {
4069-
let a: i32x4 = i32x4::new(42, 42, 42, 42);
4070-
let b: i32x4 = i32x4::new(1, 2, 3, 4);
4071-
let e: i32x4 = i32x4::new(21, 22, 22, 23);
4072-
let r: i32x4 = transmute(vhaddq_s32(transmute(a), transmute(b)));
4073-
assert_eq!(r, e);
4074-
}
4075-
40763926
#[simd_test(enable = "neon")]
40773927
unsafe fn test_vrhadd_u8() {
40783928
let a: u8x8 = u8x8::new(42, 42, 42, 42, 42, 42, 42, 42);

crates/stdarch-gen/neon.spec

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,21 +331,17 @@ a = 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42
331331
b = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
332332
validate 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29
333333

334-
aarch64 = uhadd
335-
link-aarch64 = uhadd._EXT_
336-
generate uint*_t
337-
338334

339335
arm = vhadd.s
336+
aarch64 = uhadd
337+
link-aarch64 = uhadd._EXT_
340338
link-arm = vhaddu._EXT_
341339
generate uint*_t
342340

343341

342+
arm = vhadd.s
344343
aarch64 = shadd
345344
link-aarch64 = shadd._EXT_
346-
generate int*_t
347-
348-
arm = vhadd.s
349345
link-arm = vhadds._EXT_
350346
generate int*_t
351347

0 commit comments

Comments
 (0)