@@ -114,13 +114,13 @@ mod sealed {
114
114
// Macros implementing the spec APIs:
115
115
116
116
macro_rules! impl_splat {
117
- ( $id: ident[ $ivec_ty: ident : $elem_ty: ident] <= $x_ty: ident | $( $lane_id: ident) ,* ) => {
117
+ ( $id: ident[ $ivec_ty: ident : $elem_ty: ident => $instr : tt ] <= $x_ty: ident | $( $lane_id: ident) ,* ) => {
118
118
/// Create vector with identical lanes
119
119
///
120
120
/// Construct a vector with `x` replicated to all lanes.
121
121
#[ inline]
122
- // #[target_feature(enable = "simd128")]
123
- // FIXME: #[cfg_attr(test, assert_instr($ident.splat ))]
122
+ #[ target_feature( enable = "simd128" ) ]
123
+ #[ cfg_attr( test, assert_instr( $instr ) ) ]
124
124
pub const unsafe fn splat( x: $x_ty) -> v128 {
125
125
union U {
126
126
vec: self :: sealed:: $ivec_ty,
@@ -735,7 +735,7 @@ macro_rules! v8x16_shuffle {
735
735
pub mod i8x16 {
736
736
use super :: * ;
737
737
impl_splat ! (
738
- i8x16[ v8x16: i8 ] <= i32 | x0,
738
+ i8x16[ v8x16: i8 => "i8x16.splat" ] <= i32 | x0,
739
739
x1,
740
740
x2,
741
741
x3,
@@ -765,7 +765,7 @@ pub mod i8x16 {
765
765
/// WASM-specific v16x8 instructions with modulo-arithmetic semantics
766
766
pub mod i16x8 {
767
767
use super :: * ;
768
- impl_splat ! ( i16x8[ v16x8: i16 ] <= i32 | x0, x1, x2, x3, x4, x5, x6, x7) ;
768
+ impl_splat ! ( i16x8[ v16x8: i16 => "i16x8.splat" ] <= i32 | x0, x1, x2, x3, x4, x5, x6, x7) ;
769
769
impl_extract_lane ! ( i16x8[ v16x8: i16 |u16 ] ( LaneIdx8 ) => i32 ) ;
770
770
impl_replace_lane ! ( i16x8[ v16x8: i16 ] ( LaneIdx8 ) <= i32 ) ;
771
771
impl_wrapping_add_sub_neg ! ( i16x8[ v16x8] ) ;
@@ -779,7 +779,7 @@ pub mod i16x8 {
779
779
/// WASM-specific v32x4 instructions with modulo-arithmetic semantics
780
780
pub mod i32x4 {
781
781
use super :: * ;
782
- impl_splat ! ( i32x4[ v32x4: i32 ] <= i32 | x0, x1, x2, x3) ;
782
+ impl_splat ! ( i32x4[ v32x4: i32 => "i32x4.splat" ] <= i32 | x0, x1, x2, x3) ;
783
783
impl_extract_lane ! ( i32x4[ v32x4] ( LaneIdx4 ) => i32 ) ;
784
784
impl_replace_lane ! ( i32x4[ v32x4: i32 ] ( LaneIdx4 ) <= i32 ) ;
785
785
impl_wrapping_add_sub_neg ! ( i32x4[ v32x4] ) ;
@@ -795,7 +795,7 @@ pub mod i32x4 {
795
795
/// WASM-specific v64x2 instructions with modulo-arithmetic semantics
796
796
pub mod i64x2 {
797
797
use super :: * ;
798
- impl_splat ! ( i64x2[ v64x2: i64 ] <= i64 | x0, x1) ;
798
+ impl_splat ! ( i64x2[ v64x2: i64 => "i64x2.splat" ] <= i64 | x0, x1) ;
799
799
impl_extract_lane ! ( i64x2[ v64x2] ( LaneIdx2 ) => i64 ) ;
800
800
impl_replace_lane ! ( i64x2[ v64x2: i64 ] ( LaneIdx2 ) <= i64 ) ;
801
801
impl_wrapping_add_sub_neg ! ( i64x2[ v64x2] ) ;
@@ -811,7 +811,7 @@ pub mod i64x2 {
811
811
/// WASM-specific v32x4 floating-point instructions
812
812
pub mod f32x4 {
813
813
use super :: * ;
814
- impl_splat ! ( f32x4[ f32x4: f32 ] <= f32 | x0, x1, x2, x3) ;
814
+ impl_splat ! ( f32x4[ f32x4: f32 => "f32x4.splat" ] <= f32 | x0, x1, x2, x3) ;
815
815
impl_extract_lane ! ( f32x4[ f32x4] ( LaneIdx4 ) => f32 ) ;
816
816
impl_replace_lane ! ( f32x4[ f32x4: f32 ] ( LaneIdx4 ) <= f32 ) ;
817
817
impl_comparisons ! ( f32x4[ f32x4=>v32x4] ) ;
@@ -824,7 +824,7 @@ pub mod f32x4 {
824
824
/// WASM-specific v64x2 floating-point instructions
825
825
pub mod f64x2 {
826
826
use super :: * ;
827
- impl_splat ! ( f64x2[ f64x2: f64 ] <= f64 | x0, x1) ;
827
+ impl_splat ! ( f64x2[ f64x2: f64 => "f64x2.splat" ] <= f64 | x0, x1) ;
828
828
impl_extract_lane ! ( f64x2[ f64x2] ( LaneIdx2 ) => f64 ) ;
829
829
impl_replace_lane ! ( f64x2[ f64x2: f64 ] ( LaneIdx2 ) <= f64 ) ;
830
830
impl_comparisons ! ( f64x2[ f64x2=>v64x2] ) ;
0 commit comments