Skip to content
Merged
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
18 changes: 0 additions & 18 deletions crates/core_arch/src/loongarch64/lasx/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvfrint_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrint.d"]
fn __lasx_xvfrint_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvfrsqrt.s"]
fn __lasx_xvfrsqrt_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrsqrt.d"]
fn __lasx_xvfrsqrt_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvflogb.s"]
fn __lasx_xvflogb_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvflogb.d"]
Expand Down Expand Up @@ -1751,20 +1747,6 @@ pub fn lasx_xvfrint_d(a: m256d) -> m256d {
unsafe { transmute(__lasx_xvfrint_d(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvfrsqrt_s(a: m256) -> m256 {
unsafe { transmute(__lasx_xvfrsqrt_s(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvfrsqrt_d(a: m256d) -> m256d {
unsafe { transmute(__lasx_xvfrsqrt_d(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down
2 changes: 2 additions & 0 deletions crates/core_arch/src/loongarch64/lasx/portable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ impl_vv!("lasx", lasx_xvneg_w, is::simd_neg, m256i, i32x8);
impl_vv!("lasx", lasx_xvneg_d, is::simd_neg, m256i, i64x4);
impl_vv!("lasx", lasx_xvfsqrt_s, is::simd_fsqrt, m256, f32x8);
impl_vv!("lasx", lasx_xvfsqrt_d, is::simd_fsqrt, m256d, f64x4);
impl_vv!("lasx", lasx_xvfrsqrt_s, ls::simd_frsqrt_s, m256, f32x8);
impl_vv!("lasx", lasx_xvfrsqrt_d, ls::simd_frsqrt_d, m256d, f64x4);
impl_vv!("lasx", lasx_xvfrecip_s, ls::simd_frecip_s, m256, f32x8);
impl_vv!("lasx", lasx_xvfrecip_d, ls::simd_frecip_d, m256d, f64x4);
impl_vv!("lasx", lasx_xvreplve0_b, simd_replve0_b, m256i, i8x32);
Expand Down
18 changes: 0 additions & 18 deletions crates/core_arch/src/loongarch64/lsx/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ unsafe extern "unadjusted" {
fn __lsx_vfrint_s(a: __v4f32) -> __v4f32;
#[link_name = "llvm.loongarch.lsx.vfrint.d"]
fn __lsx_vfrint_d(a: __v2f64) -> __v2f64;
#[link_name = "llvm.loongarch.lsx.vfrsqrt.s"]
fn __lsx_vfrsqrt_s(a: __v4f32) -> __v4f32;
#[link_name = "llvm.loongarch.lsx.vfrsqrt.d"]
fn __lsx_vfrsqrt_d(a: __v2f64) -> __v2f64;
#[link_name = "llvm.loongarch.lsx.vflogb.s"]
fn __lsx_vflogb_s(a: __v4f32) -> __v4f32;
#[link_name = "llvm.loongarch.lsx.vflogb.d"]
Expand Down Expand Up @@ -1692,20 +1688,6 @@ pub fn lsx_vfrint_d(a: m128d) -> m128d {
unsafe { transmute(__lsx_vfrint_d(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lsx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lsx_vfrsqrt_s(a: m128) -> m128 {
unsafe { transmute(__lsx_vfrsqrt_s(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lsx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lsx_vfrsqrt_d(a: m128d) -> m128d {
unsafe { transmute(__lsx_vfrsqrt_d(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lsx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down
2 changes: 2 additions & 0 deletions crates/core_arch/src/loongarch64/lsx/portable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ impl_vv!("lsx", lsx_vneg_w, is::simd_neg, m128i, i32x4);
impl_vv!("lsx", lsx_vneg_d, is::simd_neg, m128i, i64x2);
impl_vv!("lsx", lsx_vfsqrt_s, is::simd_fsqrt, m128, f32x4);
impl_vv!("lsx", lsx_vfsqrt_d, is::simd_fsqrt, m128d, f64x2);
impl_vv!("lsx", lsx_vfrsqrt_s, ls::simd_frsqrt_s, m128, f32x4);
impl_vv!("lsx", lsx_vfrsqrt_d, ls::simd_frsqrt_d, m128d, f64x2);
impl_vv!("lsx", lsx_vfrecip_s, ls::simd_frecip_s, m128, f32x4);
impl_vv!("lsx", lsx_vfrecip_d, ls::simd_frecip_d, m128d, f64x2);

Expand Down
10 changes: 10 additions & 0 deletions crates/core_arch/src/loongarch64/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ pub(super) const unsafe fn simd_frecip_d<T: Copy>(a: T) -> T {
is::simd_div(is::simd_splat(1.0f64), a)
}

#[inline(always)]
pub(super) unsafe fn simd_frsqrt_s<T: Copy>(a: T) -> T {
ls::simd_frecip_s(is::simd_fsqrt(a))
}

#[inline(always)]
pub(super) unsafe fn simd_frsqrt_d<T: Copy>(a: T) -> T {
ls::simd_frecip_d(is::simd_fsqrt(a))
}

#[inline(always)]
#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")]
pub(super) const unsafe fn simd_ld<const I: i32, T: Copy>(a: *const i8) -> T {
Expand Down
2 changes: 2 additions & 0 deletions crates/stdarch-gen-loongarch/lasx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1914,11 +1914,13 @@ asm-fmts = xd, xj
data-types = V4DF, V4DF

/// lasx_xvfrsqrt_s
impl = portable
name = lasx_xvfrsqrt_s
asm-fmts = xd, xj
data-types = V8SF, V8SF

/// lasx_xvfrsqrt_d
impl = portable
name = lasx_xvfrsqrt_d
asm-fmts = xd, xj
data-types = V4DF, V4DF
Expand Down
2 changes: 2 additions & 0 deletions crates/stdarch-gen-loongarch/lsx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2001,11 +2001,13 @@ asm-fmts = vd, vj
data-types = V2DF, V2DF

/// lsx_vfrsqrt_s
impl = portable
name = lsx_vfrsqrt_s
asm-fmts = vd, vj
data-types = V4SF, V4SF

/// lsx_vfrsqrt_d
impl = portable
name = lsx_vfrsqrt_d
asm-fmts = vd, vj
data-types = V2DF, V2DF
Expand Down
4 changes: 4 additions & 0 deletions crates/stdarch-gen-loongarch/src/portable-intrinsics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ lsx_vrotri_w
lsx_vrotri_d
lsx_vfrecip_s
lsx_vfrecip_d
lsx_vfrsqrt_s
lsx_vfrsqrt_d

# LASX intrinsics
lasx_xvsll_b
Expand Down Expand Up @@ -555,3 +557,5 @@ lasx_xvrotri_w
lasx_xvrotri_d
lasx_xvfrecip_s
lasx_xvfrecip_d
lasx_xvfrsqrt_s
lasx_xvfrsqrt_d