Skip to content

Commit

Permalink
Removed arm support
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Sep 24, 2024
1 parent fe5706b commit 41e3adb
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 173 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ workspace = { members = ["src/app"] }

[package]
name = "colorutils-rs"
version = "0.5.11"
version = "0.5.13"
edition = "2021"
description = "High performance utilities for color format handling and conversion."
readme = "README.md"
Expand All @@ -16,7 +16,7 @@ repository = "https://github.com/awxkee/colorutils-rs"
exclude = ["*.jpg"]

[dependencies]
erydanos = "0.2.12"
erydanos = "0.2.15"
half = "2.4.1"
num-traits = "0.2.19"

Expand Down
10 changes: 2 additions & 8 deletions src/concat_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
use crate::avx::*;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::*;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use std::arch::aarch64::*;
#[cfg(target_arch = "x86")]
#[allow(unused_imports)]
Expand Down Expand Up @@ -63,10 +60,7 @@ pub fn append_alpha(
}
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
unsafe {
while _cx + 4 < width as usize {
let xyz_pixel = vld3q_f32(src_ptr.add(_cx * 3usize));
Expand Down
10 changes: 2 additions & 8 deletions src/hsv_to_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use std::slice;

use crate::image::ImageConfiguration;
use crate::image_to_hsv_support::HsvTarget;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_hsv_u16_to_image;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_hsv_u16_to_image;
Expand Down Expand Up @@ -47,10 +44,7 @@ fn hsv_u16_to_channels<
_wide_row_handler = Some(sse_hsv_u16_to_image::<CHANNELS_CONFIGURATION, USE_ALPHA, TARGET>);
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler =
Some(neon_hsv_u16_to_image::<CHANNELS_CONFIGURATION, USE_ALPHA, TARGET>);
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_hsv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

use crate::image::ImageConfiguration;
use crate::image_to_hsv_support::HsvTarget;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_channels_to_hsv_u16;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_channels_to_hsv_u16;
Expand Down Expand Up @@ -40,10 +37,7 @@ fn channels_to_hsv_u16<
unsafe fn(usize, *const u8, usize, u32, *mut u16, usize, f32) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler =
Some(neon_channels_to_hsv_u16::<CHANNELS_CONFIGURATION, USE_ALPHA, TARGET>);
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_jzazbz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* // license that can be found in the LICENSE file.
*/
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_image_to_jzazbz;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_image_to_jzazbz;
Expand Down Expand Up @@ -53,10 +50,7 @@ fn channels_to_jzaz<const CHANNELS_CONFIGURATION: u8, const TARGET: u8>(
unsafe fn(usize, *const u8, usize, u32, *mut f32, usize, f32, TransferFunction) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handle = Some(neon_image_to_jzazbz::<CHANNELS_CONFIGURATION, TARGET>);
}
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
use crate::avx::avx_channels_to_linear;
use crate::gamma_curves::TransferFunction;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_channels_to_linear;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::*;
Expand Down Expand Up @@ -112,10 +109,7 @@ fn channels_to_linear<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: bool>(
};
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handle = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_linear_u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use std::slice;

use crate::gamma_curves::TransferFunction;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::*;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_image_to_linear_unsigned::sse_channels_to_linear_u8;
Expand Down Expand Up @@ -44,10 +41,7 @@ fn channels_to_linear<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: bool>(
unsafe fn(usize, *const u8, usize, u32, *mut u8, usize, TransferFunction) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_oklab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::avx::avx_image_to_oklab;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_image_to_oklab;
use crate::oklch::Oklch;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
Expand Down Expand Up @@ -54,10 +51,7 @@ fn channels_to_oklab<const CHANNELS_CONFIGURATION: u8, const TARGET: u8>(
unsafe fn(usize, *const u8, usize, u32, *mut f32, usize, TransferFunction) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handle = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_sigmoidal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
use crate::avx::avx_image_to_sigmoidal_row;

use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_image_to_sigmoidal;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_image_to_sigmoidal_row;
Expand All @@ -39,10 +36,7 @@ fn image_to_sigmoidal<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: bool>(

let mut _wide_row_handler: Option<unsafe fn(usize, *const u8, u32, *mut f32) -> usize> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = Some(neon_image_to_sigmoidal::<CHANNELS_CONFIGURATION, USE_ALPHA>);
}
Expand Down
10 changes: 2 additions & 8 deletions src/image_to_xyz_lab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
use crate::avx::avx2_image_to_xyz_lab;
use crate::gamma_curves::TransferFunction;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_channels_to_xyz_or_lab;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_channels_to_xyz_or_lab;
Expand Down Expand Up @@ -59,10 +56,7 @@ fn channels_to_xyz<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: bool, cons
) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/image_xyza_laba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
*/

use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_channels_to_xyza_or_laba;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_channels_to_xyza_laba;
Expand Down Expand Up @@ -85,10 +82,7 @@ fn channels_to_xyz_with_alpha<const CHANNELS_CONFIGURATION: u8, const TARGET: u8
}
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/jzazbz_to_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
*/
use crate::image::ImageConfiguration;
use crate::image_to_jzazbz::JzazbzTarget;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_jzazbz_to_image;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_jzazbz_to_image;
Expand Down Expand Up @@ -38,10 +35,7 @@ fn jzazbz_to_image<const CHANNELS_CONFIGURATION: u8, const TARGET: u8>(
_wide_row_handle = Some(sse_jzazbz_to_image::<CHANNELS_CONFIGURATION, TARGET>);
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handle = Some(neon_jzazbz_to_image::<CHANNELS_CONFIGURATION, TARGET>);
}
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ mod linear_to_image;
mod linear_to_image_u8;
pub mod linear_to_planar;
mod luv;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
mod neon;
mod oklab;
mod oklab_to_image;
Expand Down
10 changes: 2 additions & 8 deletions src/linear_to_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
use crate::avx::avx_linear_to_gamma;
use crate::gamma_curves::TransferFunction;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::neon_linear_to_gamma;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_linear_to_gamma;
Expand All @@ -37,10 +34,7 @@ fn linear_to_gamma_channels<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: b
unsafe fn(usize, *const f32, u32, *mut u8, u32, u32, TransferFunction) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handle = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/linear_to_image_u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use std::slice;

use crate::gamma_curves::TransferFunction;
use crate::image::ImageConfiguration;
#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::*;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_image_to_linear_unsigned::sse_channels_to_linear_u8;
Expand Down Expand Up @@ -82,10 +79,7 @@ fn linear_to_gamma_channels<const CHANNELS_CONFIGURATION: u8, const USE_ALPHA: b
};
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = match transfer_function {
TransferFunction::Srgb => Some(
Expand Down
10 changes: 2 additions & 8 deletions src/linear_to_planar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* // license that can be found in the LICENSE file.
*/

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
use crate::neon::linear_to_planar::neon_linear_plane_to_gamma;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use crate::sse::sse_linear_plane_to_gamma;
Expand All @@ -33,10 +30,7 @@ fn linear_to_gamma_channels(
unsafe fn(usize, *const f32, u32, *mut u8, u32, u32, TransferFunction) -> usize,
> = None;

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
{
_wide_row_handler = Some(neon_linear_plane_to_gamma);
}
Expand Down
5 changes: 1 addition & 4 deletions src/neon/xyz_lab_to_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ pub(crate) unsafe fn neon_xyz_lab_vld<
)
}

#[cfg(all(
any(target_arch = "aarch64", target_arch = "arm"),
target_feature = "neon"
))]
#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
#[inline(always)]
pub unsafe fn neon_xyz_to_channels<
const CHANNELS_CONFIGURATION: u8,
Expand Down
Loading

0 comments on commit 41e3adb

Please sign in to comment.