Skip to content
Draft
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
210 changes: 0 additions & 210 deletions crates/core_arch/src/loongarch64/lasx/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvfclass_s(a: __v8f32) -> __v8i32;
#[link_name = "llvm.loongarch.lasx.xvfclass.d"]
fn __lasx_xvfclass_d(a: __v4f64) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvfrecip.s"]
fn __lasx_xvfrecip_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrecip.d"]
fn __lasx_xvfrecip_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvfrecipe.s"]
fn __lasx_xvfrecipe_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrecipe.d"]
Expand All @@ -215,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 @@ -443,22 +435,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvfrintrne_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrintrne.d"]
fn __lasx_xvfrintrne_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvfrintrz.s"]
fn __lasx_xvfrintrz_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrintrz.d"]
fn __lasx_xvfrintrz_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvfrintrp.s"]
fn __lasx_xvfrintrp_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrintrp.d"]
fn __lasx_xvfrintrp_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvfrintrm.s"]
fn __lasx_xvfrintrm_s(a: __v8f32) -> __v8f32;
#[link_name = "llvm.loongarch.lasx.xvfrintrm.d"]
fn __lasx_xvfrintrm_d(a: __v4f64) -> __v4f64;
#[link_name = "llvm.loongarch.lasx.xvld"]
fn __lasx_xvld(a: *const i8, b: i32) -> __v32i8;
#[link_name = "llvm.loongarch.lasx.xvst"]
fn __lasx_xvst(a: __v32i8, b: *mut i8, c: i32);
#[link_name = "llvm.loongarch.lasx.xvstelm.b"]
fn __lasx_xvstelm_b(a: __v32i8, b: *mut i8, c: i32, d: u32);
#[link_name = "llvm.loongarch.lasx.xvstelm.h"]
Expand Down Expand Up @@ -489,10 +465,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvssrln_w_d(a: __v4i64, b: __v4i64) -> __v8i32;
#[link_name = "llvm.loongarch.lasx.xvldi"]
fn __lasx_xvldi(a: i32) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvldx"]
fn __lasx_xvldx(a: *const i8, b: i64) -> __v32i8;
#[link_name = "llvm.loongarch.lasx.xvstx"]
fn __lasx_xvstx(a: __v32i8, b: *mut i8, c: i64);
#[link_name = "llvm.loongarch.lasx.xvextl.qu.du"]
fn __lasx_xvextl_qu_du(a: __v4u64) -> __v4u64;
#[link_name = "llvm.loongarch.lasx.vext2xv.h.b"]
Expand Down Expand Up @@ -709,14 +681,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvmaddwod_w_hu_h(a: __v8i32, b: __v16u16, c: __v16i16) -> __v8i32;
#[link_name = "llvm.loongarch.lasx.xvmaddwod.h.bu.b"]
fn __lasx_xvmaddwod_h_bu_b(a: __v16i16, b: __v32u8, c: __v32i8) -> __v16i16;
#[link_name = "llvm.loongarch.lasx.xvrotr.b"]
fn __lasx_xvrotr_b(a: __v32i8, b: __v32i8) -> __v32i8;
#[link_name = "llvm.loongarch.lasx.xvrotr.h"]
fn __lasx_xvrotr_h(a: __v16i16, b: __v16i16) -> __v16i16;
#[link_name = "llvm.loongarch.lasx.xvrotr.w"]
fn __lasx_xvrotr_w(a: __v8i32, b: __v8i32) -> __v8i32;
#[link_name = "llvm.loongarch.lasx.xvrotr.d"]
fn __lasx_xvrotr_d(a: __v4i64, b: __v4i64) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvadd.q"]
fn __lasx_xvadd_q(a: __v4i64, b: __v4i64) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvsub.q"]
Expand Down Expand Up @@ -749,14 +713,6 @@ unsafe extern "unadjusted" {
fn __lasx_xvexth_du_wu(a: __v8u32) -> __v4u64;
#[link_name = "llvm.loongarch.lasx.xvexth.qu.du"]
fn __lasx_xvexth_qu_du(a: __v4u64) -> __v4u64;
#[link_name = "llvm.loongarch.lasx.xvrotri.b"]
fn __lasx_xvrotri_b(a: __v32i8, b: u32) -> __v32i8;
#[link_name = "llvm.loongarch.lasx.xvrotri.h"]
fn __lasx_xvrotri_h(a: __v16i16, b: u32) -> __v16i16;
#[link_name = "llvm.loongarch.lasx.xvrotri.w"]
fn __lasx_xvrotri_w(a: __v8i32, b: u32) -> __v8i32;
#[link_name = "llvm.loongarch.lasx.xvrotri.d"]
fn __lasx_xvrotri_d(a: __v4i64, b: u32) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvextl.q.d"]
fn __lasx_xvextl_q_d(a: __v4i64) -> __v4i64;
#[link_name = "llvm.loongarch.lasx.xvsrlni.b.h"]
Expand Down Expand Up @@ -1737,20 +1693,6 @@ pub fn lasx_xvfclass_d(a: m256d) -> m256i {
unsafe { transmute(__lasx_xvfclass_d(transmute(a))) }
}

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

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

#[inline]
#[target_feature(enable = "lasx,frecipe")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down Expand Up @@ -1793,20 +1735,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 Expand Up @@ -2623,66 +2551,6 @@ pub fn lasx_xvfrintrne_d(a: m256d) -> m256d {
unsafe { transmute(__lasx_xvfrintrne_d(transmute(a))) }
}

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

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

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

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

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

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

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub unsafe fn lasx_xvld<const IMM_S12: i32>(mem_addr: *const i8) -> m256i {
static_assert_simm_bits!(IMM_S12, 12);
transmute(__lasx_xvld(mem_addr, IMM_S12))
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(2)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub unsafe fn lasx_xvst<const IMM_S12: i32>(a: m256i, mem_addr: *mut i8) {
static_assert_simm_bits!(IMM_S12, 12);
__lasx_xvst(transmute(a), mem_addr, IMM_S12)
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(2, 3)]
Expand Down Expand Up @@ -2810,20 +2678,6 @@ pub fn lasx_xvldi<const IMM_S13: i32>() -> m256i {
unsafe { transmute(__lasx_xvldi(IMM_S13)) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub unsafe fn lasx_xvldx(mem_addr: *const i8, b: i64) -> m256i {
transmute(__lasx_xvldx(mem_addr, transmute(b)))
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub unsafe fn lasx_xvstx(a: m256i, mem_addr: *mut i8, b: i64) {
__lasx_xvstx(transmute(a), mem_addr, transmute(b))
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down Expand Up @@ -3592,34 +3446,6 @@ pub fn lasx_xvmaddwod_h_bu_b(a: m256i, b: m256i, c: m256i) -> m256i {
unsafe { transmute(__lasx_xvmaddwod_h_bu_b(transmute(a), transmute(b), transmute(c))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotr_b(a: m256i, b: m256i) -> m256i {
unsafe { transmute(__lasx_xvrotr_b(transmute(a), transmute(b))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotr_h(a: m256i, b: m256i) -> m256i {
unsafe { transmute(__lasx_xvrotr_h(transmute(a), transmute(b))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotr_w(a: m256i, b: m256i) -> m256i {
unsafe { transmute(__lasx_xvrotr_w(transmute(a), transmute(b))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotr_d(a: m256i, b: m256i) -> m256i {
unsafe { transmute(__lasx_xvrotr_d(transmute(a), transmute(b))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down Expand Up @@ -3732,42 +3558,6 @@ pub fn lasx_xvexth_qu_du(a: m256i) -> m256i {
unsafe { transmute(__lasx_xvexth_qu_du(transmute(a))) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotri_b<const IMM3: u32>(a: m256i) -> m256i {
static_assert_uimm_bits!(IMM3, 3);
unsafe { transmute(__lasx_xvrotri_b(transmute(a), IMM3)) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotri_h<const IMM4: u32>(a: m256i) -> m256i {
static_assert_uimm_bits!(IMM4, 4);
unsafe { transmute(__lasx_xvrotri_h(transmute(a), IMM4)) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotri_w<const IMM5: u32>(a: m256i) -> m256i {
static_assert_uimm_bits!(IMM5, 5);
unsafe { transmute(__lasx_xvrotri_w(transmute(a), IMM5)) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[rustc_legacy_const_generics(1)]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
pub fn lasx_xvrotri_d<const IMM6: u32>(a: m256i) -> m256i {
static_assert_uimm_bits!(IMM6, 6);
unsafe { transmute(__lasx_xvrotri_d(transmute(a), IMM6)) }
}

#[inline]
#[target_feature(enable = "lasx")]
#[unstable(feature = "stdarch_loongarch", issue = "117427")]
Expand Down
26 changes: 26 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,16 @@ 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_xvfrintrp_s, is::simd_ceil, m256, f32x8);
impl_vv!("lasx", lasx_xvfrintrp_d, is::simd_ceil, m256d, f64x4);
impl_vv!("lasx", lasx_xvfrintrm_s, is::simd_floor, m256, f32x8);
impl_vv!("lasx", lasx_xvfrintrm_d, is::simd_floor, m256d, f64x4);
impl_vv!("lasx", lasx_xvfrintrz_s, is::simd_trunc, m256, f32x8);
impl_vv!("lasx", lasx_xvfrintrz_d, is::simd_trunc, m256d, f64x4);
impl_vv!("lasx", lasx_xvreplve0_b, simd_replve0_b, m256i, i8x32);
impl_vv!("lasx", lasx_xvreplve0_h, simd_replve0_h, m256i, i16x16);
impl_vv!("lasx", lasx_xvreplve0_w, simd_replve0_w, m256i, i32x8);
Expand All @@ -339,6 +349,10 @@ impl_gv!("lasx", lasx_xvreplgr2vr_h, ls::simd_splat, m256i, i16x16, i32);
impl_gv!("lasx", lasx_xvreplgr2vr_w, ls::simd_splat, m256i, i32x8, i32);
impl_gv!("lasx", lasx_xvreplgr2vr_d, ls::simd_splat, m256i, i64x4, i64);

impl_ggv!("lasx", lasx_xvldx, simd_ldx, m256i, i8x32, *const i8, i64, unsafe);

impl_gsv!("lasx", lasx_xvld, simd_ld, m256i, i8x32, *const i8, 12, const, unsafe);

impl_sv!("lasx", lasx_xvrepli_b, ls::simd_splat, m256i, i8x32, 10);
impl_sv!("lasx", lasx_xvrepli_h, ls::simd_splat, m256i, i16x16, 10);
impl_sv!("lasx", lasx_xvrepli_w, ls::simd_splat, m256i, i32x8, 10);
Expand Down Expand Up @@ -434,6 +448,10 @@ impl_vvv!("lasx", lasx_xvsrl_b, ls::simd_shr, m256i, u8x32);
impl_vvv!("lasx", lasx_xvsrl_h, ls::simd_shr, m256i, u16x16);
impl_vvv!("lasx", lasx_xvsrl_w, ls::simd_shr, m256i, u32x8);
impl_vvv!("lasx", lasx_xvsrl_d, ls::simd_shr, m256i, u64x4);
impl_vvv!("lasx", lasx_xvrotr_b, ls::simd_rotr, m256i, u8x32);
impl_vvv!("lasx", lasx_xvrotr_h, ls::simd_rotr, m256i, u16x16);
impl_vvv!("lasx", lasx_xvrotr_w, ls::simd_rotr, m256i, u32x8);
impl_vvv!("lasx", lasx_xvrotr_d, ls::simd_rotr, m256i, u64x4);
impl_vvv!("lasx", lasx_xvbitclr_b, ls::simd_bitclr, m256i, u8x32);
impl_vvv!("lasx", lasx_xvbitclr_h, ls::simd_bitclr, m256i, u16x16);
impl_vvv!("lasx", lasx_xvbitclr_w, ls::simd_bitclr, m256i, u32x8);
Expand Down Expand Up @@ -499,6 +517,10 @@ impl_vvv!("lasx", lasx_xvpackod_h, simd_packod_h, m256i, i16x16);
impl_vvv!("lasx", lasx_xvpackod_w, simd_packod_w, m256i, i32x8);
impl_vvv!("lasx", lasx_xvpackod_d, simd_packod_d, m256i, i64x4);

impl_vgg!("lasx", lasx_xvstx, simd_stx, m256i, i8x32, *mut i8, i64, unsafe);

impl_vgs!("lasx", lasx_xvst, simd_st, m256i, i8x32, *mut i8, 12, const, unsafe);

impl_vuv!("lasx", lasx_xvslli_b, is::simd_shl, m256i, i8x32);
impl_vuv!("lasx", lasx_xvslli_h, is::simd_shl, m256i, i16x16);
impl_vuv!("lasx", lasx_xvslli_w, is::simd_shl, m256i, i32x8);
Expand All @@ -511,6 +533,10 @@ impl_vuv!("lasx", lasx_xvsrli_b, is::simd_shr, m256i, u8x32);
impl_vuv!("lasx", lasx_xvsrli_h, is::simd_shr, m256i, u16x16);
impl_vuv!("lasx", lasx_xvsrli_w, is::simd_shr, m256i, u32x8);
impl_vuv!("lasx", lasx_xvsrli_d, is::simd_shr, m256i, u64x4);
impl_vuv!("lasx", lasx_xvrotri_b, ls::simd_rotr, m256i, u8x32);
impl_vuv!("lasx", lasx_xvrotri_h, ls::simd_rotr, m256i, u16x16);
impl_vuv!("lasx", lasx_xvrotri_w, ls::simd_rotr, m256i, u32x8);
impl_vuv!("lasx", lasx_xvrotri_d, ls::simd_rotr, m256i, u64x4);
impl_vuv!("lasx", lasx_xvaddi_bu, is::simd_add, m256i, u8x32, 5);
impl_vuv!("lasx", lasx_xvaddi_hu, is::simd_add, m256i, u16x16, 5);
impl_vuv!("lasx", lasx_xvaddi_wu, is::simd_add, m256i, u32x8, 5);
Expand Down
Loading
Loading