Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ARM intrinsic generator #1693

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
resolver = "1"
members = [
"crates/*",
"examples"
]
exclude = [
"crates/wasm-assert-instr-tests"
]

[profile.release]
Expand Down
38,112 changes: 15,891 additions & 22,221 deletions crates/core_arch/src/aarch64/neon/generated.rs

Large diffs are not rendered by default.

78,508 changes: 40,729 additions & 37,779 deletions crates/core_arch/src/arm_shared/neon/generated.rs

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions crates/core_arch/src/arm_shared/neon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,38 @@ use crate::{core_arch::simd::*, hint::unreachable_unchecked, intrinsics::simd::*
#[cfg(test)]
use stdarch_test::assert_instr;

pub(crate) trait AsUnsigned {
type Unsigned: ?Sized;
fn as_unsigned(self) -> Self::Unsigned;
}

pub(crate) trait AsSigned {
type Signed: ?Sized;
fn as_signed(self) -> Self::Signed;
}

macro_rules! impl_sign_conversions_neon {
($(($signed:ty, $unsigned:ty))*) => ($(
impl AsUnsigned for $signed {
type Unsigned = $unsigned;

#[inline]
fn as_unsigned(self) -> $unsigned {
unsafe { transmute(self) }
}
}

impl AsSigned for $unsigned {
type Signed = $signed;

#[inline]
fn as_signed(self) -> $signed {
unsafe { transmute(self) }
}
}
)*)
}

pub(crate) type p8 = u8;
pub(crate) type p16 = u16;
pub(crate) type p64 = u64;
Expand Down Expand Up @@ -1033,6 +1065,85 @@ pub struct poly64x2x4_t(
pub poly64x2_t,
);

impl_sign_conversions_neon! {
(i8, u8)
(i16, u16)
(i32, u32)
(i64, u64)
(*const i8, *const u8)
(*const i16, *const u16)
(*const i32, *const u32)
(*const i64, *const u64)
(*mut i8, *mut u8)
(*mut i16, *mut u16)
(*mut i32, *mut u32)
(*mut i64, *mut u64)
(int16x4_t, uint16x4_t)
(int16x8_t, uint16x8_t)
(int32x2_t, uint32x2_t)
(int32x4_t, uint32x4_t)
(int64x1_t, uint64x1_t)
(int64x2_t, uint64x2_t)
(int8x16_t, uint8x16_t)
(int8x8_t, uint8x8_t)
(uint16x4_t, int16x4_t)
(uint16x8_t, int16x8_t)
(uint32x2_t, int32x2_t)
(uint32x4_t, int32x4_t)
(uint64x1_t, int64x1_t)
(uint64x2_t, int64x2_t)
(uint8x16_t, int8x16_t)
(uint8x8_t, int8x8_t)
(int16x4x2_t, uint16x4x2_t)
(int16x4x3_t, uint16x4x3_t)
(int16x4x4_t, uint16x4x4_t)
(int16x8x2_t, uint16x8x2_t)
(int16x8x3_t, uint16x8x3_t)
(int16x8x4_t, uint16x8x4_t)
(int32x2x2_t, uint32x2x2_t)
(int32x2x3_t, uint32x2x3_t)
(int32x2x4_t, uint32x2x4_t)
(int32x4x2_t, uint32x4x2_t)
(int32x4x3_t, uint32x4x3_t)
(int32x4x4_t, uint32x4x4_t)
(int64x1x2_t, uint64x1x2_t)
(int64x1x3_t, uint64x1x3_t)
(int64x1x4_t, uint64x1x4_t)
(int64x2x2_t, uint64x2x2_t)
(int64x2x3_t, uint64x2x3_t)
(int64x2x4_t, uint64x2x4_t)
(int8x16x2_t, uint8x16x2_t)
(int8x16x3_t, uint8x16x3_t)
(int8x16x4_t, uint8x16x4_t)
(int8x8x2_t, uint8x8x2_t)
(int8x8x3_t, uint8x8x3_t)
(int8x8x4_t, uint8x8x4_t)
(uint16x4x2_t, int16x4x2_t)
(uint16x4x3_t, int16x4x3_t)
(uint16x4x4_t, int16x4x4_t)
(uint16x8x2_t, int16x8x2_t)
(uint16x8x3_t, int16x8x3_t)
(uint16x8x4_t, int16x8x4_t)
(uint32x2x2_t, int32x2x2_t)
(uint32x2x3_t, int32x2x3_t)
(uint32x2x4_t, int32x2x4_t)
(uint32x4x2_t, int32x4x2_t)
(uint32x4x3_t, int32x4x3_t)
(uint32x4x4_t, int32x4x4_t)
(uint64x1x2_t, int64x1x2_t)
(uint64x1x3_t, int64x1x3_t)
(uint64x1x4_t, int64x1x4_t)
(uint64x2x2_t, int64x2x2_t)
(uint64x2x3_t, int64x2x3_t)
(uint64x2x4_t, int64x2x4_t)
(uint8x16x2_t, int8x16x2_t)
(uint8x16x3_t, int8x16x3_t)
(uint8x16x4_t, int8x16x4_t)
(uint8x8x2_t, int8x8x2_t)
(uint8x8x3_t, int8x8x3_t)
(uint8x8x4_t, int8x8x4_t)
}

#[allow(improper_ctypes)]
extern "unadjusted" {
// absolute value (64-bit)
Expand Down
17 changes: 15 additions & 2 deletions crates/stdarch-gen-arm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
[package]
name = "stdarch-gen-arm"
name = "stdarch-gen2"
version = "0.1.0"
authors = ["Heinz Gies <heinz@licenser.net>"]
authors = ["Luca Vizzarro <luca.vizzarro@arm.com>",
"Jamie Cunliffe <Jamie.Cunliffe@arm.com>",
"Adam Gemmell <Adam.Gemmell@arm.com",
"Jacob Bramley <jacob.bramley@arm.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
itertools = "0.10"
lazy_static = "1.4.0"
proc-macro2 = "1.0"
quote = "1.0"
regex = "1.5"
serde = { version = "1.0", features = ["derive"] }
serde_with = "1.14"
serde_yaml = "0.8"
walkdir = "2.3.2"
11 changes: 0 additions & 11 deletions crates/stdarch-gen-arm/README.md

This file was deleted.

Loading
Loading