Skip to content

Commit

Permalink
Merge pull request #410 from heiher/loongarch64
Browse files Browse the repository at this point in the history
Add loongarch64 vendor conversions
  • Loading branch information
calebzulawski authored Apr 1, 2024
2 parents 5fa5358 + bfacd14 commit 53fe1a3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/core_simd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
all(target_arch = "arm", target_feature = "v7"),
feature(stdarch_arm_neon_intrinsics)
)]
#![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))]
#![cfg_attr(
any(target_arch = "powerpc", target_arch = "powerpc64"),
feature(stdarch_powerpc)
Expand Down
3 changes: 3 additions & 0 deletions crates/core_simd/src/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ mod arm;

#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
mod powerpc;

#[cfg(target_arch = "loongarch64")]
mod loongarch64;
31 changes: 31 additions & 0 deletions crates/core_simd/src/vendor/loongarch64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use crate::simd::*;
use core::arch::loongarch64::*;

from_transmute! { unsafe u8x16 => v16u8 }
from_transmute! { unsafe u8x32 => v32u8 }
from_transmute! { unsafe i8x16 => v16i8 }
from_transmute! { unsafe i8x32 => v32i8 }

from_transmute! { unsafe u16x8 => v8u16 }
from_transmute! { unsafe u16x16 => v16u16 }
from_transmute! { unsafe i16x8 => v8i16 }
from_transmute! { unsafe i16x16 => v16i16 }

from_transmute! { unsafe u32x4 => v4u32 }
from_transmute! { unsafe u32x8 => v8u32 }
from_transmute! { unsafe i32x4 => v4i32 }
from_transmute! { unsafe i32x8 => v8i32 }
from_transmute! { unsafe f32x4 => v4f32 }
from_transmute! { unsafe f32x8 => v8f32 }

from_transmute! { unsafe u64x2 => v2u64 }
from_transmute! { unsafe u64x4 => v4u64 }
from_transmute! { unsafe i64x2 => v2i64 }
from_transmute! { unsafe i64x4 => v4i64 }
from_transmute! { unsafe f64x2 => v2f64 }
from_transmute! { unsafe f64x4 => v4f64 }

from_transmute! { unsafe usizex2 => v2u64 }
from_transmute! { unsafe usizex4 => v4u64 }
from_transmute! { unsafe isizex2 => v2i64 }
from_transmute! { unsafe isizex4 => v4i64 }

0 comments on commit 53fe1a3

Please sign in to comment.