Skip to content

Commit dcacddc

Browse files
committed
use ptr.cast() and type inference instead of explicit casts
1 parent 297691b commit dcacddc

File tree

1 file changed

+24
-24
lines changed
  • crates/core_arch/src/aarch64/neon

1 file changed

+24
-24
lines changed

crates/core_arch/src/aarch64/neon/mod.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -464,191 +464,191 @@ pub unsafe fn vcopy_laneq_f64<const LANE1: i32, const LANE2: i32>(
464464
#[target_feature(enable = "neon")]
465465
#[cfg_attr(test, assert_instr(ldr))]
466466
pub unsafe fn vld1_s8(ptr: *const i8) -> int8x8_t {
467-
core::ptr::read_unaligned(ptr as *const int8x8_t)
467+
core::ptr::read_unaligned(ptr.cast())
468468
}
469469

470470
/// Load multiple single-element structures to one, two, three, or four registers.
471471
#[inline]
472472
#[target_feature(enable = "neon")]
473473
#[cfg_attr(test, assert_instr(ldr))]
474474
pub unsafe fn vld1q_s8(ptr: *const i8) -> int8x16_t {
475-
core::ptr::read_unaligned(ptr as *const int8x16_t)
475+
core::ptr::read_unaligned(ptr.cast())
476476
}
477477

478478
/// Load multiple single-element structures to one, two, three, or four registers.
479479
#[inline]
480480
#[target_feature(enable = "neon")]
481481
#[cfg_attr(test, assert_instr(ldr))]
482482
pub unsafe fn vld1_s16(ptr: *const i16) -> int16x4_t {
483-
core::ptr::read_unaligned(ptr as *const int16x4_t)
483+
core::ptr::read_unaligned(ptr.cast())
484484
}
485485

486486
/// Load multiple single-element structures to one, two, three, or four registers.
487487
#[inline]
488488
#[target_feature(enable = "neon")]
489489
#[cfg_attr(test, assert_instr(ldr))]
490490
pub unsafe fn vld1q_s16(ptr: *const i16) -> int16x8_t {
491-
core::ptr::read_unaligned(ptr as *const int16x8_t)
491+
core::ptr::read_unaligned(ptr.cast())
492492
}
493493

494494
/// Load multiple single-element structures to one, two, three, or four registers.
495495
#[inline]
496496
#[target_feature(enable = "neon")]
497497
#[cfg_attr(test, assert_instr(ldr))]
498498
pub unsafe fn vld1_s32(ptr: *const i32) -> int32x2_t {
499-
core::ptr::read_unaligned(ptr as *const int32x2_t)
499+
core::ptr::read_unaligned(ptr.cast())
500500
}
501501

502502
/// Load multiple single-element structures to one, two, three, or four registers.
503503
#[inline]
504504
#[target_feature(enable = "neon")]
505505
#[cfg_attr(test, assert_instr(ldr))]
506506
pub unsafe fn vld1q_s32(ptr: *const i32) -> int32x4_t {
507-
core::ptr::read_unaligned(ptr as *const int32x4_t)
507+
core::ptr::read_unaligned(ptr.cast())
508508
}
509509

510510
/// Load multiple single-element structures to one, two, three, or four registers.
511511
#[inline]
512512
#[target_feature(enable = "neon")]
513513
#[cfg_attr(test, assert_instr(ldr))]
514514
pub unsafe fn vld1_s64(ptr: *const i64) -> int64x1_t {
515-
core::ptr::read_unaligned(ptr as *const int64x1_t)
515+
core::ptr::read_unaligned(ptr.cast())
516516
}
517517

518518
/// Load multiple single-element structures to one, two, three, or four registers.
519519
#[inline]
520520
#[target_feature(enable = "neon")]
521521
#[cfg_attr(test, assert_instr(ldr))]
522522
pub unsafe fn vld1q_s64(ptr: *const i64) -> int64x2_t {
523-
core::ptr::read_unaligned(ptr as *const int64x2_t)
523+
core::ptr::read_unaligned(ptr.cast())
524524
}
525525

526526
/// Load multiple single-element structures to one, two, three, or four registers.
527527
#[inline]
528528
#[target_feature(enable = "neon")]
529529
#[cfg_attr(test, assert_instr(ldr))]
530530
pub unsafe fn vld1_u8(ptr: *const u8) -> uint8x8_t {
531-
core::ptr::read_unaligned(ptr as *const uint8x8_t)
531+
core::ptr::read_unaligned(ptr.cast())
532532
}
533533

534534
/// Load multiple single-element structures to one, two, three, or four registers.
535535
#[inline]
536536
#[target_feature(enable = "neon")]
537537
#[cfg_attr(test, assert_instr(ldr))]
538538
pub unsafe fn vld1q_u8(ptr: *const u8) -> uint8x16_t {
539-
core::ptr::read_unaligned(ptr as *const uint8x16_t)
539+
core::ptr::read_unaligned(ptr.cast())
540540
}
541541

542542
/// Load multiple single-element structures to one, two, three, or four registers.
543543
#[inline]
544544
#[target_feature(enable = "neon")]
545545
#[cfg_attr(test, assert_instr(ldr))]
546546
pub unsafe fn vld1_u16(ptr: *const u16) -> uint16x4_t {
547-
core::ptr::read_unaligned(ptr as *const uint16x4_t)
547+
core::ptr::read_unaligned(ptr.cast())
548548
}
549549

550550
/// Load multiple single-element structures to one, two, three, or four registers.
551551
#[inline]
552552
#[target_feature(enable = "neon")]
553553
#[cfg_attr(test, assert_instr(ldr))]
554554
pub unsafe fn vld1q_u16(ptr: *const u16) -> uint16x8_t {
555-
core::ptr::read_unaligned(ptr as *const uint16x8_t)
555+
core::ptr::read_unaligned(ptr.cast())
556556
}
557557

558558
/// Load multiple single-element structures to one, two, three, or four registers.
559559
#[inline]
560560
#[target_feature(enable = "neon")]
561561
#[cfg_attr(test, assert_instr(ldr))]
562562
pub unsafe fn vld1_u32(ptr: *const u32) -> uint32x2_t {
563-
core::ptr::read_unaligned(ptr as *const uint32x2_t)
563+
core::ptr::read_unaligned(ptr.cast())
564564
}
565565

566566
/// Load multiple single-element structures to one, two, three, or four registers.
567567
#[inline]
568568
#[target_feature(enable = "neon")]
569569
#[cfg_attr(test, assert_instr(ldr))]
570570
pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t {
571-
core::ptr::read_unaligned(ptr as *const uint32x4_t)
571+
core::ptr::read_unaligned(ptr.cast())
572572
}
573573

574574
/// Load multiple single-element structures to one, two, three, or four registers.
575575
#[inline]
576576
#[target_feature(enable = "neon")]
577577
#[cfg_attr(test, assert_instr(ldr))]
578578
pub unsafe fn vld1_u64(ptr: *const u64) -> uint64x1_t {
579-
core::ptr::read_unaligned(ptr as *const uint64x1_t)
579+
core::ptr::read_unaligned(ptr.cast())
580580
}
581581

582582
/// Load multiple single-element structures to one, two, three, or four registers.
583583
#[inline]
584584
#[target_feature(enable = "neon")]
585585
#[cfg_attr(test, assert_instr(ldr))]
586586
pub unsafe fn vld1q_u64(ptr: *const u64) -> uint64x2_t {
587-
core::ptr::read_unaligned(ptr as *const uint64x2_t)
587+
core::ptr::read_unaligned(ptr.cast())
588588
}
589589

590590
/// Load multiple single-element structures to one, two, three, or four registers.
591591
#[inline]
592592
#[target_feature(enable = "neon")]
593593
#[cfg_attr(test, assert_instr(ldr))]
594594
pub unsafe fn vld1_p8(ptr: *const p8) -> poly8x8_t {
595-
core::ptr::read_unaligned(ptr as *const poly8x8_t)
595+
core::ptr::read_unaligned(ptr.cast())
596596
}
597597

598598
/// Load multiple single-element structures to one, two, three, or four registers.
599599
#[inline]
600600
#[target_feature(enable = "neon")]
601601
#[cfg_attr(test, assert_instr(ldr))]
602602
pub unsafe fn vld1q_p8(ptr: *const p8) -> poly8x16_t {
603-
core::ptr::read_unaligned(ptr as *const poly8x16_t)
603+
core::ptr::read_unaligned(ptr.cast())
604604
}
605605

606606
/// Load multiple single-element structures to one, two, three, or four registers.
607607
#[inline]
608608
#[target_feature(enable = "neon")]
609609
#[cfg_attr(test, assert_instr(ldr))]
610610
pub unsafe fn vld1_p16(ptr: *const p16) -> poly16x4_t {
611-
core::ptr::read_unaligned(ptr as *const poly16x4_t)
611+
core::ptr::read_unaligned(ptr.cast())
612612
}
613613

614614
/// Load multiple single-element structures to one, two, three, or four registers.
615615
#[inline]
616616
#[target_feature(enable = "neon")]
617617
#[cfg_attr(test, assert_instr(ldr))]
618618
pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t {
619-
core::ptr::read_unaligned(ptr as *const poly16x8_t)
619+
core::ptr::read_unaligned(ptr.cast())
620620
}
621621

622622
/// Load multiple single-element structures to one, two, three, or four registers.
623623
#[inline]
624624
#[target_feature(enable = "neon")]
625625
#[cfg_attr(test, assert_instr(ldr))]
626626
pub unsafe fn vld1_f32(ptr: *const f32) -> float32x2_t {
627-
core::ptr::read_unaligned(ptr as *const float32x2_t)
627+
core::ptr::read_unaligned(ptr.cast())
628628
}
629629

630630
/// Load multiple single-element structures to one, two, three, or four registers.
631631
#[inline]
632632
#[target_feature(enable = "neon")]
633633
#[cfg_attr(test, assert_instr(ldr))]
634634
pub unsafe fn vld1q_f32(ptr: *const f32) -> float32x4_t {
635-
core::ptr::read_unaligned(ptr as *const float32x4_t)
635+
core::ptr::read_unaligned(ptr.cast())
636636
}
637637

638638
/// Load multiple single-element structures to one, two, three, or four registers.
639639
#[inline]
640640
#[target_feature(enable = "neon")]
641641
#[cfg_attr(test, assert_instr(ldr))]
642642
pub unsafe fn vld1_f64(ptr: *const f64) -> float64x1_t {
643-
core::ptr::read_unaligned(ptr as *const float64x1_t)
643+
core::ptr::read_unaligned(ptr.cast())
644644
}
645645

646646
/// Load multiple single-element structures to one, two, three, or four registers.
647647
#[inline]
648648
#[target_feature(enable = "neon")]
649649
#[cfg_attr(test, assert_instr(ldr))]
650650
pub unsafe fn vld1q_f64(ptr: *const f64) -> float64x2_t {
651-
core::ptr::read_unaligned(ptr as *const float64x2_t)
651+
core::ptr::read_unaligned(ptr.cast())
652652
}
653653

654654
/// Store multiple single-element structures from one, two, three, or four registers.

0 commit comments

Comments
 (0)