Skip to content

Commit c2e254e

Browse files
committed
Patch our rust formatting.
1 parent cb058c1 commit c2e254e

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

src/binary16/arch.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ mod aarch64;
1313
mod loongarch64;
1414

1515
macro_rules! convert_fn {
16-
(if x86_feature("f16c") { $f16c:expr }
17-
else if aarch64_feature("fp16") { $aarch64:expr }
18-
else if loongarch64_feature("lsx") { $loongarch64:expr }
19-
else { $fallback:expr }) => {
16+
(
17+
if x86_feature("f16c") { $f16c:expr }else if aarch64_feature("fp16") { $aarch64:expr }else if loongarch64_feature("lsx") { $loongarch64:expr }else { $fallback:expr }
18+
) => {
2019
cfg_if::cfg_if! {
2120
// Use intrinsics directly when a compile target or using no_std
2221
if #[cfg(all(

src/binary16/arch/loongarch64.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use core::{mem::MaybeUninit, ptr};
2-
31
#[cfg(target_arch = "loongarch64")]
42
use core::arch::loongarch64::{lsx_vfcvt_h_s, lsx_vfcvtl_s_h, m128, m128i};
3+
use core::{mem::MaybeUninit, ptr};
54

65
/////////////// loongarch64 lsx/lasx ////////////////
76

@@ -46,12 +45,7 @@ pub(super) unsafe fn f32x4_to_f16x4_lsx(v: &[f32; 4]) -> [u16; 4] {
4645
pub(super) unsafe fn f16x4_to_f64x4_lsx(v: &[u16; 4]) -> [f64; 4] {
4746
let array = f16x4_to_f32x4_lsx(v);
4847
// Let compiler vectorize this regular cast for now.
49-
[
50-
array[0] as f64,
51-
array[1] as f64,
52-
array[2] as f64,
53-
array[3] as f64,
54-
]
48+
[array[0] as f64, array[1] as f64, array[2] as f64, array[3] as f64]
5549
}
5650

5751
#[target_feature(enable = "lsx")]

0 commit comments

Comments
 (0)